Hello, Bogdan,<br><br>My IP Blacklist feature is not working in opensips-1.5.1 version.<br>I want to block the calling based on the username first. For that have done the required modification as per ur instructions. But my call is working fine.For the blocked user it should not work, but its working.<br>
<br>Can u please have a look on it. and suggest the right way !!!<br><br>Thank you very much.<br><br>-Urmi<br><br><br><div class="gmail_quote">On Thu, Aug 13, 2009 at 7:14 PM, urmi lakkad <span dir="ltr"><<a href="mailto:urmi.lakkad@gmail.com">urmi.lakkad@gmail.com</a>></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;">Hello Bogdan,<br><br>Thank you for your quick reply and help.<br><br>I have already gone through the link u have specified i.e userblacklist module.<br>
I have done the following modification as per your guidance. Its now giving any error.<br>
But when I am firing a call from / to user number 10001 to any of my register numbers. The call is working fine. But that should not happen. The call should not establish.<br><br>In userblacklist table, there is a entry for 10001 and the whitelist flag is also set to 0.<br>
Then the call from 10001 should not be establish. It should block calls to and from 1001.<br>But its not working.<br>Now can u please give me the needed information ?<br>
        
        
        
<p style="margin-bottom: 0in;"> $avp(i:82) = $rU=~"";</p><div class="im"><br>$avp(i:80) =
$rU=~"sip:10001";
</div>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;"> if
(!check_user_blacklist("$avp(i:80)","$avp(i:82)","$avp(i:80)","userblacklist"))</p><div class="im"><br>{<br>xlog("L_INFO","
inside check user blacklist,
--------------------------------------\n");<br>sl_send_reply("403",
"Forbidden");<br># exit;<br>}
</div>
<p style="margin-bottom: 0in;">
</p>
Thanks a lot once again.<br><br>-Thanks & Regards,<br><font color="#888888">Urmi</font><div><div></div><div class="h5"><br><br><br><div class="gmail_quote">On Thu, Aug 13, 2009 at 3:45 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>></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>
Have you went through the documtation for the userblacklist modules:<br>
<a href="http://www.opensips.org/html/docs/modules/1.5.x/userblacklist.html#id227281" target="_blank">http://www.opensips.org/html/docs/modules/1.5.x/userblacklist.html#id227281</a><br>
<a href="http://www.opensips.org/html/docs/modules/1.5.x/userblacklist.html#id228172" target="_blank">http://www.opensips.org/html/docs/modules/1.5.x/userblacklist.html#id228172</a><br>
<br>
because the first param for check_user_blacklist() is the user you want to do the blocking for, the second is the domain of the user and optionally, the third is the prefix (default is RURI username) you want to filter.<div>
<br>
<br>
Regards,<br>
Bogdan<br>
<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>
Hello Bogdan,<br>
<br>
Thanks for ur attention.<br>
<br>
I m using OpenSIPs-1.5.1 version.<br>
<br>
I want to block some calls based either on user name or on IP.<br>
<br>
First, I want to block calls based on Username.<br>
<br>
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.<br>
<br>
-----------------------------------------------<br>
route[2]<br>
<br>
{<br>
<br>
$avp(i:80) = $rU=~"sip:10001";<br>
<br>
<br>
if (!check_user_blacklist("10001", "$avp(i:82)"))<br>
<br>
{<br>
<br>
xlog("L_INFO"," inside check user blacklist, --------------------------------------\n");<br>
<br>
sl_send_reply("403", "Forbidden");<br>
<br>
exit;<br>
<br>
}<br>
<br>
if (lookup("location"))<br>
<br>
{<br>
<br>
route(1);<br>
<br>
}else{<br>
<br>
sl_send_reply("404", "Not Found");<br>
<br>
};<br>
<br>
}<br>
<br>
----------------------------<br>
Table userblacklist entry<br>
<br>
*ID Username Domain prefix whitelist*<br>
<br>
1 10001 192.168.1.10 10001 0<br>
<br>
<br>
Once again thank you for your help.<br>
<br>
<br>
-Thanks & Regards,<br>
<br>
*Urmi*<br>
<br>
<br>
<br></div><div><div></div><div>
On Wed, Aug 12, 2009 at 8:46 PM, Bogdan-Andrei Iancu <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>> wrote:<br>
<br>
Hi Urmi,<br>
<br>
the check_user_blacklist() function the RURI (as number) and not<br>
the SRC IP (as you want).<br>
<br>
For your purposes, the allow_trusted() from permission module<br>
(<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>)<br>
may be more suitable.<br>
<br>
<br>
Regards,<br>
Bogdan<br>
<br>
urmi lakkad wrote:<br>
<br>
<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<br>
I m doing that, the calls are not blocked, its still working<br>
fine. Any suggestions on this ?? Below is my opensips.cfg.<br>
<br>
----------------------------------------------------------------------------<br>
<br>
loadmodule "userblacklist.so"<br>
modparam("userblacklist",<br>
"db_url","mysql://<a href="http://opensips:opensipsrw@127.0.0.1/opensips" target="_blank">opensips:opensipsrw@127.0.0.1/opensips</a><br>
<<a href="http://opensips:opensipsrw@127.0.0.1/opensips" target="_blank">http://opensips:opensipsrw@127.0.0.1/opensips</a>><br>
<<a href="http://opensips:opensipsrw@127.0.0.1/opensips" target="_blank">http://opensips:opensipsrw@127.0.0.1/opensips</a>>")<br>
<br>
modparam("userblacklist", "db_table", "userblacklist")<br>
modparam("userblacklist", "use_domain", 1) #non-zero value for<br>
domain support<br>
<br>
route[2]<br>
{<br>
<br>
$avp(i:80) = $rU;<br>
<br>
# $avp(i:80) = $rU=~"192.168.1.10";<br>
<br>
# $avp(i:80) = $rU=~"sip:1[0-9][0-9][0-9][1]@.*";<br>
<br>
# # rewrite the R-URI<br>
<br>
<br>
xlog("L_INFO"," Be4 check user blacklist,<br>
--------------------------------------\n");<br>
<br>
<br>
if (!check_user_blacklist("$avp(i:80)", "$avp(i:82)"))<br>
<br>
{<br>
<br>
xlog("L_INFO"," inside check user blacklist,<br>
--------------------------------------\n");<br>
<br>
sl_send_reply("403", "Forbidden");<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>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br></div></div>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>><div><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>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br>
</div></div></blockquote></div><br>