<div dir="ltr">Thanks you so much for the reply . I have done the same thing . Finally I got that somewhere . <div><br></div><div>In general , my opensips wont do this . But this is a special requirement from customer to do so . </div><div><br></div><div><br></div><div>Thanks again for the info .</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b><i>Thanks & Regards</i></b><div><i>Sasmita Panda</i></div><div><i>Network Testing and Software Engineer</i></div><div><i>3CLogic , ph:07827611765</i></div></div></div></div>
<br><div class="gmail_quote">On Mon, Jul 25, 2016 at 5:12 PM, Surabhi Garg <span dir="ltr"><<a href="mailto:surabhi.garg@vvdntech.in" target="_blank">surabhi.garg@vvdntech.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra">Hi Sasmita,<br><br></div><div class="gmail_extra">Yes, permission module could be used for this. The permission module provides function <b>"allow_registe</b>r<b>()"</b> which can be used in the configuration script before saving the contact in your OpenSIPS configuration file. <br><br>Below are the steps:<br><ul><li>Create a <b>"register.deny" </b>file (this contains the details of IP addresses you'd like to block). Also, you could create <b>"register.allow" </b>file (this contains the details of IP addresses which will be always allowed).<br></li><li>Add <b>allow_register() </b>in your OpenSIPS configuration file as shown below in sample.<br></li></ul><i><u><b>NOTE:</b></u> 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.<br></i><br></div><div class="gmail_extra"><b>OpenSIPS configuration snippet for blocking IP:</b><br></div><div class="gmail_extra"><br> if (is_method("REGISTER"))<br> {<br> if (allow_register("/usr/local/etc/opensips/register.allow", "/usr/local/etc/opensips/register.deny")) {<br> if (!save("location"))<br> sl_reply_error();<br> } else {<br> sl_send_reply("403", "Forbidden");<br> };<br><br> exit;<br> }<br><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="background-color:rgb(255,255,0)"><span style="color:rgb(0,0,0)"><i><b>IMPORTANT:</b> 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. </i></span></span><br></div><div class="gmail_extra"><br><br><br><br><br clear="all"></div><div class="gmail_extra"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><br></div><br clear="all"><b><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt"><p style="margin:0in 0in 0.0001pt"><b>With Best
Regards,</b></p><p style="margin:0in 0in 0.0001pt"><b><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(89,89,89);background-image:initial;background-repeat:initial">Surabhi Garg<br></span></b></p><p style="margin:0in 0in 0.0001pt"><b><span style="font-size:11pt;font-family:Calibri,sans-serif;background-image:initial;background-repeat:initial"></span></b></p><p style="margin:0in 0in 0.0001pt;display:inline!important"><b><span style="font-size:11pt;font-family:Calibri,sans-serif;background-image:initial;background-repeat:initial">Cell :<span> </span><a href="tel:%2B91%209910100290" value="+919910100290" target="_blank">+91 </a>8130321886|<span> </span>Skype :<span> </span>surabhi.garg9</span></b></p></span></b><p style="font-family:arial;font-size:small">
</p><br></div></div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">On Mon, Jul 25, 2016 at 1:45 PM, Sasmita Panda <span dir="ltr"><<a href="mailto:spanda@3clogic.com" target="_blank">spanda@3clogic.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi All ,<div><br></div><div> I am using openisn 1.11 . And my requirment is to block all the register requests having a perticualr ip in the contact uri . </div><div><br></div><div> 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 . </div><div><br></div><div> How can I do this ? Is permission module is needed to achieve this or without this I can solve my problem . </div><div><br></div><div> I am new to permission module so its bit confusing . Please help me if anybody has done this earlier .</div><div> <br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><b><i>Thanks & Regards</i></b><span><font color="#888888"><div><i>Sasmita Panda</i></div><div><i>Network Testing and Software Engineer</i></div><div><i>3CLogic , ph:07827611765</i></div></font></span></div></div></div>
</div></div>
<br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>