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

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Jul 1 15:27:49 CEST 2011


Hi Joel,

yeah, that's true - if you use the builtin group detection for drouting, 
the module expects to find something in dr_groups. If no record -> 
error. Right now there is no way to set a default fallback group.

What you can simply do, to avoid query duplicity, is to run the group 
query from script only and pass all the time the group value to 
do_routing - I guess is what you are doing right now, right ?

Regards,
Bogdan


On 06/28/2011 03:53 PM, joel.oliveira wrote:
> 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.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Bogdan-Andrei Iancu
OpenSIPS solutions and "know-how"




More information about the Users mailing list