[OpenSIPS-Users] Blacklisting on prefix and domain

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Mar 26 14:40:52 CET 2010


Hi Magnus,

Seams the userblacklist module has a lack of flexibility here (like 
who's the owner of the blacklist)....

So an option will be to enhance the userblacklist module, another one 
will be to use the dialplan (you can do regexp based matching) to build 
blacklists - see
       
http://www.opensips.org/html/docs/modules/1.6.x/dialplan.html#id226122

Regards,
Bogdan

Magnus Burman wrote:
> Hi guys,
>
> What would be the preferred way to do user blackinglisting on domain? 
> The userblacklist module only seem to look at username (I can't find a 
> reference to domain in the mysql log), and even if it did I assume it 
> would look for a match on both username and module.
>
> I would prefer to have it tied to drouting as it'd give me a single 
> place for my destinations, but anything "native" would be considered. 
> I try to stay away from avp_db_query when I can, but atm I'm using the 
> below. While it works, I'd really like to move away from customer 
> queries whenever possible.
>
> if(avp_db_query("select whitelist from userblacklist where domain like 
> '$fd' and '$rU' like concat(prefix, '%') order by char_length(prefix) 
> desc limit 1", "$avp(s:dbl)")) {
>     if($avp(s:dbl) == 0) {
>         sl_send_reply("403", "Forbidden destination");
>         exit;
>     }
> }
>
> Cheers,
> Magnus
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list