[OpenSIPS-Users] Permission module use .

Surabhi Garg surabhi.garg at vvdntech.in
Mon Jul 25 13:42:20 CEST 2016


Hi  Sasmita,

Yes, permission module could be used for this. The permission module
provides function *"allow_registe*r*()"* which can be used in the
configuration script before saving the contact in your OpenSIPS
configuration file.

Below are the steps:

   - Create a *"register.deny" *file (this contains the details of IP
   addresses you'd like to block). Also, you could create *"register.allow"
   *file (this contains the details of IP addresses which will be always
   allowed).
   - Add *allow_register() *in your OpenSIPS configuration file as shown
   below in sample.


*NOTE: Sample of register.allow & register.deny file will be present in the
source code directory like /home/xxx/opensips/module/permissions/config/
for instance. You could refer them.*
*OpenSIPS configuration snippet for blocking IP:*

 if (is_method("REGISTER"))
        {
                if
(allow_register("/usr/local/etc/opensips/register.allow",
"/usr/local/etc/opensips/register.deny")) {
                        if (!save("location"))
                                sl_reply_error();
                } else  {
                        sl_send_reply("403", "Forbidden");
                };

                exit;
        }


*IMPORTANT: I'm assuming here that you'll be getting OpenSIPS own domain
address in the Contact. As far I know if you use OpenSIPS in proxy mode it
won't provide it's address in Contact header by default. This may happen if
OpenSIPS being used in B2BUA mode. *








*With Best Regards,Surabhi GargCell : +91
<%2B91%209910100290>8130321886| Skype : surabhi.garg9*



On Mon, Jul 25, 2016 at 1:45 PM, Sasmita Panda <spanda at 3clogic.com> wrote:

> Hi All ,
>
>       I am using openisn 1.11 . And my requirment is to block all the
> register requests having a perticualr ip in the contact uri .
>
>        Basically I wanted to block looping in the server . When ever a
> register request will come having the servers ip in the contact uri , I
> wanted to block this .
>
>         How can I do this ? Is permission module is needed to achieve this
> or without this I can solve my problem .
>
>      I am new to permission module so its bit confusing . Please help me
> if anybody has done this earlier .
>
> *Thanks & Regards*
> *Sasmita Panda*
> *Network Testing and Software Engineer*
> *3CLogic , ph:07827611765*
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160725/2d53ffdf/attachment.htm>


More information about the Users mailing list