[OpenSIPS-Users] opensips + IP Blacklist Issue

urmi lakkad urmi.lakkad at gmail.com
Mon Aug 24 15:34:12 CEST 2009


Hello, Bogdan,

My IP Blacklist feature is not working in opensips-1.5.1 version.
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.

Can u please have a look on it. and suggest the right way !!!

Thank you very much.

-Urmi


On Thu, Aug 13, 2009 at 7:14 PM, urmi lakkad <urmi.lakkad at gmail.com> wrote:

> Hello Bogdan,
>
> Thank you for your quick reply and help.
>
> I have already gone through the link u have specified i.e userblacklist
> module.
> I have done the following modification as per your guidance. Its now giving
> any error.
> 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.
>
> In userblacklist table, there is a entry for 10001 and the whitelist flag
> is also set to 0.
> Then the call from 10001 should not be establish. It should block calls to
> and from 1001.
> But its not working.
> Now can u please give me the needed information ?
>
> $avp(i:82) = $rU=~"";
>
> $avp(i:80) = $rU=~"sip:10001";
>
>  if
> (!check_user_blacklist("$avp(i:80)","$avp(i:82)","$avp(i:80)","userblacklist"))
>
> {
> xlog("L_INFO"," inside check user blacklist,
> --------------------------------------\n");
> sl_send_reply("403", "Forbidden");
> # exit;
> }
>
>  Thanks a lot once again.
>
> -Thanks & Regards,
> Urmi
>
>
>
> On Thu, Aug 13, 2009 at 3:45 PM, Bogdan-Andrei Iancu <
> bogdan at voice-system.ro> wrote:
>
>> Hi Urmi,
>>
>> Have you went through the documtation for the userblacklist modules:
>>
>> http://www.opensips.org/html/docs/modules/1.5.x/userblacklist.html#id227281
>>
>> http://www.opensips.org/html/docs/modules/1.5.x/userblacklist.html#id228172
>>
>> 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.
>>
>> Regards,
>> Bogdan
>>
>>
>> urmi lakkad wrote:
>>
>>> Hello Bogdan,
>>>
>>> Thanks for ur attention.
>>>
>>> I m using OpenSIPs-1.5.1 version.
>>>
>>> I want to block some calls based either on user name or on IP.
>>>
>>> First, I want to block calls based on Username.
>>>
>>> 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.
>>>
>>> -----------------------------------------------
>>> route[2]
>>>
>>> {
>>>
>>> $avp(i:80) = $rU=~"sip:10001";
>>>
>>>
>>> if (!check_user_blacklist("10001", "$avp(i:82)"))
>>>
>>> {
>>>
>>> xlog("L_INFO"," inside check user blacklist,
>>> --------------------------------------\n");
>>>
>>> sl_send_reply("403", "Forbidden");
>>>
>>> exit;
>>>
>>> }
>>>
>>> if (lookup("location"))
>>>
>>> {
>>>
>>> route(1);
>>>
>>> }else{
>>>
>>> sl_send_reply("404", "Not Found");
>>>
>>> };
>>>
>>> }
>>>
>>> ----------------------------
>>> Table userblacklist entry
>>>
>>> *ID Username Domain prefix whitelist*
>>>
>>> 1 10001 192.168.1.10 10001 0
>>>
>>>
>>> Once again thank you for your help.
>>>
>>>
>>> -Thanks & Regards,
>>>
>>> *Urmi*
>>>
>>>
>>>
>>> On Wed, Aug 12, 2009 at 8:46 PM, Bogdan-Andrei Iancu <
>>> bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> wrote:
>>>
>>>    Hi Urmi,
>>>
>>>    the check_user_blacklist() function the RURI (as number) and not
>>>    the SRC IP (as you want).
>>>
>>>    For your purposes, the allow_trusted() from permission module
>>>    (
>>> http://www.opensips.org/html/docs/modules/1.5.x/permissions.html#id272063
>>> )
>>>    may be more suitable.
>>>
>>>
>>>    Regards,
>>>    Bogdan
>>>
>>>    urmi lakkad wrote:
>>>
>>>
>>>        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@127.0.0.1/opensips
>>>        <http://opensips:opensipsrw@127.0.0.1/opensips>
>>>        <http://opensips:opensipsrw@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
>>>
>>>
>>>
>>>  ------------------------------------------------------------------------
>>>
>>>        _______________________________________________
>>>        Users mailing list
>>>        Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>>        http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090824/6161ca29/attachment.htm 


More information about the Users mailing list