Hello Bogdan,<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 2.3  (Unix)">
        
        
        <style type="text/css">
        <!--
                @page { size: 8.5in 11in; margin: 0.79in }
                P { margin-bottom: 0.08in }
        -->
        </style>

<p style="margin-bottom: 0.17in;"><font face="Times New Roman"><font size="3">Thanks
for ur attention.</font></font></p>
<p style="margin-bottom: 0.17in;"><font face="Times New Roman"><font size="3">I
m using OpenSIPs-1.5.1 version.</font></font></p>
<p style="margin-bottom: 0in;">I want to block some calls based either
on user name or on IP.</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">First, I want to block calls based on
Username.</p>
<p style="margin-bottom: 0in;">For instance: want to block calls  from
user having number 10001. So that the calls should not  be
established for the  user name 10001. Right !!! but its not blocking
the calls. It successfully allow the calls to establish. Can u help
me in this ?  I have done following configuration for blocking calls
based on user name.</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">-----------------------------------------------<br>route[2]
</p>
<p style="margin-bottom: 0in;">{
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
        $avp(i:80) =
$rU=~&quot;sip:10001&quot;;
</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">        if
(!check_user_blacklist(&quot;10001&quot;, &quot;$avp(i:82)&quot;))
</p>
<p style="margin-bottom: 0in;">        {
</p>
<p style="margin-bottom: 0in;">                xlog(&quot;L_INFO&quot;,&quot;
inside check user blacklist,
--------------------------------------\n&quot;);
</p>
<p style="margin-bottom: 0in;">                sl_send_reply(&quot;403&quot;,
&quot;Forbidden&quot;);
</p>
<p style="margin-bottom: 0in;">                exit;
</p>
<p style="margin-bottom: 0in;">        }
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">        if (lookup(&quot;location&quot;))
</p>
<p style="margin-bottom: 0in;">        {
</p>
<p style="margin-bottom: 0in;">                route(1);
</p>
<p style="margin-bottom: 0in;">        }else{
</p>
<p style="margin-bottom: 0in;">                sl_send_reply(&quot;404&quot;,
&quot;Not Found&quot;);
</p>
<p style="margin-bottom: 0in;">        };</p>
<p style="margin-bottom: 0in;">}
</p>

<p style="margin-bottom: 0in;">
</p>

<p style="margin-bottom: 0in;">----------------------------<br>Table userblacklist entry</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;"><b>ID Username Domain prefix whitelist</b></p>
<p style="margin-bottom: 0in;">1 10001 192.168.1.10 10001 0</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">Once again thank you for your help.</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">-Thanks &amp; Regards,</p>
<p style="margin-bottom: 0in;"><b>Urmi</b></p>
<br><br><div class="gmail_quote">On Wed, Aug 12, 2009 at 8:46 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Urmi,<br>
<br>
the check_user_blacklist() function the RURI (as number) and not the SRC IP (as you want).<br>
<br>
For your purposes, the allow_trusted() from permission module (<a href="http://www.opensips.org/html/docs/modules/1.5.x/permissions.html#id272063" target="_blank">http://www.opensips.org/html/docs/modules/1.5.x/permissions.html#id272063</a>) may be more suitable.<div class="im">
<br>
<br>
Regards,<br>
Bogdan<br>
<br>
urmi lakkad wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
<br>
Hello,<br>
<br>
I am using opensips-1.5.1. And I m doing IP-black listing.<br>
<br>
I want to block calls from particular IP(i.e 192.168.10). When I m doing that, the calls are not blocked, its still working fine. Any suggestions on this ?? Below is my opensips.cfg.<br>
<br>
----------------------------------------------------------------------------<br>
<br>
loadmodule &quot;userblacklist.so&quot;<br></div>
modparam(&quot;userblacklist&quot;, &quot;db_url&quot;,&quot;mysql://<a href="http://opensips:opensipsrw@127.0.0.1/opensips" target="_blank">opensips:opensipsrw@127.0.0.1/opensips</a> &lt;<a href="http://opensips:opensipsrw@127.0.0.1/opensips" target="_blank">http://opensips:opensipsrw@127.0.0.1/opensips</a>&gt;&quot;)<div class="im">
<br>
modparam(&quot;userblacklist&quot;, &quot;db_table&quot;, &quot;userblacklist&quot;)<br>
modparam(&quot;userblacklist&quot;, &quot;use_domain&quot;, 1) #non-zero value for domain support<br>
<br>
route[2]<br>
{<br>
<br>
$avp(i:80) = $rU;<br>
<br>
# $avp(i:80) = $rU=~&quot;192.168.1.10&quot;;<br>
<br>
# $avp(i:80) = $rU=~&quot;sip:1[0-9][0-9][0-9][1]@.*&quot;;<br>
<br>
# # rewrite the R-URI<br>
<br>
<br>
xlog(&quot;L_INFO&quot;,&quot; Be4 check user blacklist, --------------------------------------\n&quot;);<br>
<br>
<br>
if (!check_user_blacklist(&quot;$avp(i:80)&quot;, &quot;$avp(i:82)&quot;))<br>
<br>
{<br>
<br>
xlog(&quot;L_INFO&quot;,&quot; inside check user blacklist, --------------------------------------\n&quot;);<br>
<br>
sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>
<br>
exit;<br>
<br>
}<br>
<br>
}<br>
<br>
<br>
----------------------------------------------------------------------------<br>
Table userblacklist entry<br>
<br>
<br>
*ID Username Domain prefix whitelist*<br>
<br>
1 10001 192.168.1.10 10001 0<br>
<br>
2 10002 192.168.1.10 10001 0<br>
<br>
<br>
<br>
Thanks for your attention.<br>
<br>
-Urmi<br>
<br>
<br></div><div class="im">
------------------------------------------------------------------------<br>
<br>
_______________________________________________<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" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
  <br>
</div></blockquote>
<br>
</blockquote></div><br>