Use Blacklist Module Question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Use Blacklist Module Question

Alexander Perkins
Hi.  I have successfully implemented the User Blacklist module, but I noticed it checks the number the call is going to, not the CallerID.  Is it possible to lookup the CallerID instead of the number?  I have tried creating a dummy variable for $tU and then assiging the CallerID to $tU, but OpenSIPs failed (I guess $tU is read-only?).  I am using the global blacklist functionality.  This is the code I tried originally:

$var(TempVariable) = $tU;
$tU = $fU;

        if (!check_blacklist("globalblacklist"))
        {
                sl_send_reply("403", "Forbidden");
                exit;
        }

$tU =  $var(TempVariable);

Any help is appreciated,
Alex

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Use Blacklist Module Question

Bogdan-Andrei Iancu-2
Hi,

Have you tried to use the check_user_blacklist () function:
    http://www.opensips.org/html/docs/modules/2.4.x/userblacklist.html#func_check_user_blacklist

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam
On 05/01/2018 05:47 PM, Alexander Perkins wrote:
Hi.  I have successfully implemented the User Blacklist module, but I noticed it checks the number the call is going to, not the CallerID.  Is it possible to lookup the CallerID instead of the number?  I have tried creating a dummy variable for $tU and then assiging the CallerID to $tU, but OpenSIPs failed (I guess $tU is read-only?).  I am using the global blacklist functionality.  This is the code I tried originally:

$var(TempVariable) = $tU;
$tU = $fU;

        if (!check_blacklist("globalblacklist"))
        {
                sl_send_reply("403", "Forbidden");
                exit;
        }

$tU =  $var(TempVariable);

Any help is appreciated,
Alex


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Use Blacklist Module Question

Bogdan-Andrei Iancu-2
Hi Alexander,

There are other generic modules that can be used for implementing a black listing functionality - like Dynamic Routing (for prefix/DID blacklisting) or the dialplan module (for regexp based matching). Both do caching for speed reasons. If you really want to do it directly against a DB (like noSQL), you can simply do it from script level with raw queries and script checks - it is just a matter of organizing your data.

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam
On 05/18/2018 11:47 PM, Alexander Perkins wrote:
Hi Bogdan. Thank you for the advice. 

I ended up writing a custom blacklist module which works in real-time. The blacklist module native to OpenSIPS is great, but it lacked certain functionality that we really wanted. Among them, was real-time blacklisting (without the need to reload). 

We implemented a beta version and it’s working really well. We did this using MemCached. 

Thanks again, 
Alex

On Fri, May 18, 2018 at 6:16 AM Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi,

Have you tried to use the check_user_blacklist () function:
    http://www.opensips.org/html/docs/modules/2.4.x/userblacklist.html#func_check_user_blacklist

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam
On 05/01/2018 05:47 PM, Alexander Perkins wrote:
Hi.  I have successfully implemented the User Blacklist module, but I noticed it checks the number the call is going to, not the CallerID.  Is it possible to lookup the CallerID instead of the number?  I have tried creating a dummy variable for $tU and then assiging the CallerID to $tU, but OpenSIPs failed (I guess $tU is read-only?).  I am using the global blacklist functionality.  This is the code I tried originally:

$var(TempVariable) = $tU;
$tU = $fU;

        if (!check_blacklist("globalblacklist"))
        {
                sl_send_reply("403", "Forbidden");
                exit;
        }

$tU =  $var(TempVariable);

Any help is appreciated,
Alex


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

check_blacklist function Question

basitengr
Hi Team,
I have a scenario where I have to block list certain numbers (premium ones).
I populated these numbers with in "globalblacklist" table. I followed documentation:

While part of destination number defined as prefix, like 1437, blacklisting works and all the calls starting with destination number '1437' will block.
id     prefix  whitelist    description
1      1437     0            NULL

But for the required case, if I add full number in prefix column, like 14375436291, opensips will not block the call.
id     prefix                whitelist    description
1      14375436291     0            NULL

How can i block list of full numbers through opensips?

--
regards,

abdul basit

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: check_blacklist function Question

basitengr
Never mind. Issue has been fixed.
I was overlooking the number. Few digits were different in next request that fail the exact number match and causing call to go through.

--
regards,

abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445


On Sun, 15 Jul 2018 at 06:12, Abdul Basit <[hidden email]> wrote:
Hi Team,
I have a scenario where I have to block list certain numbers (premium ones).
I populated these numbers with in "globalblacklist" table. I followed documentation:

While part of destination number defined as prefix, like 1437, blacklisting works and all the calls starting with destination number '1437' will block.
id     prefix  whitelist    description
1      1437     0            NULL

But for the required case, if I add full number in prefix column, like 14375436291, opensips will not block the call.
id     prefix                whitelist    description
1      14375436291     0            NULL

How can i block list of full numbers through opensips?

--
regards,

abdul basit

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users