[OpenSIPS-Users] opensips + IP Blacklist Issue

urmi lakkad urmi.lakkad at gmail.com
Fri Aug 7 11:40:52 CEST 2009


Hello,

 I am using opensips-1.5.1. And I m doing IP-black listing.

 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.

----------------------------------------------------------------------------

 loadmodule "userblacklist.so"
modparam("userblacklist", "db_url","mysql://
opensips:opensipsrw at 127.0.0.1/opensips")
modparam("userblacklist", "db_table", "userblacklist")
modparam("userblacklist", "use_domain", 1) #non-zero value for domain
support

 route[2]
{

$avp(i:80) = $rU;

# $avp(i:80) = $rU=~"192.168.1.10";

# $avp(i:80) = $rU=~"sip:1[0-9][0-9][0-9][1]@.*";

# # rewrite the R-URI


 xlog("L_INFO"," Be4 check user blacklist,
--------------------------------------\n");


 if (!check_user_blacklist("$avp(i:80)", "$avp(i:82)"))

{

xlog("L_INFO"," inside check user blacklist,
--------------------------------------\n");

sl_send_reply("403", "Forbidden");

exit;

}

}



----------------------------------------------------------------------------
Table userblacklist entry


 *ID Username Domain prefix whitelist*

1 10001 192.168.1.10 10001 0

2 10002 192.168.1.10 10001 0



 Thanks for your attention.

 -Urmi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090807/9c1db9d1/attachment.htm 


More information about the Users mailing list