[OpenSIPS-Users] Blacklisting on prefix and domain

Magnus Burman magnus.burman at adamo.es
Fri Mar 26 12:57:11 CET 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100326/d3cf4644/attachment.htm 


More information about the Users mailing list