[OpenSIPS-Users] How to call a default route on Drouting

joel.oliveira joel.oliveira at interacesso.pt
Tue Jun 28 14:53:50 CEST 2011


Hi again,

After talking with wdoekes2 in the IRC channel he also understood that there
is no way for do_routing to choose a default route if it doesn't match any
username in the dr_groups table.

Still, he did suggested something interesting, to use avpops to query the
table before and in case there is no group_id associated with the user, just
use the default one.

Something like:
avp_query("SELECT group_id FROM dr_groups WHERE username = '$avp(i:1)'",
"$avp(i:2)"); 
if (!$avp(i:2)) {
       $avp(i:2) = 0; # default group 
}

By this you'll call the do_routing(group_id,sort) and will spare the query
on the do_routing function because in fact you just did it before.

Hope it helps someone. Thanks for reading this,
Joel Oliveira

--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/How-to-call-a-default-route-on-Drouting-tp6524285p6524788.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list