<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: 0in;">Hello,</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">I am using opensips-1.5.1. And I m
doing IP-black listing.</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">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.</p>
<p style="margin-bottom: 0in;">----------------------------------------------------------------------------</p>


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




<p style="margin-bottom: 0in;">loadmodule &quot;userblacklist.so&quot;<br>modparam(&quot;userblacklist&quot;,
&quot;db_url&quot;,&quot;mysql://<a href="http://opensips:opensipsrw@127.0.0.1/opensips">opensips:opensipsrw@127.0.0.1/opensips</a>&quot;)<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>
</p>

<p style="margin-bottom: 0in;">route[2]<br>{</p>
<p style="margin-bottom: 0in;">        $avp(i:80) = $rU;</p>
<p style="margin-bottom: 0in;">#       $avp(i:80) =
$rU=~&quot;192.168.1.10&quot;;</p>
<p style="margin-bottom: 0in;">#       $avp(i:80) =
$rU=~&quot;sip:1[0-9][0-9][0-9][1]@.*&quot;;</p>
<p style="margin-bottom: 0in;">#       # rewrite the R-URI</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">        xlog(&quot;L_INFO&quot;,&quot;
Be4 check user blacklist, --------------------------------------\n&quot;);</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">        if
(!check_user_blacklist(&quot;$avp(i:80)&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;"><br>
</p>

<p style="margin-bottom: 0in;">----------------------------------------------------------------------------<br>Table userblacklist entry</p>
<p style="margin-bottom: 0in;"><br>
</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;">2        10002                192.168.1.10                10001                0</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">Thanks for your attention.</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">-Urmi</p>
<p style="margin-bottom: 0in;"><br>
</p>