[OpenSIPS-Users] drouting module

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Aug 26 19:01:34 CEST 2009


Hi Sebastian,

Sebastian Sastre wrote:
>
> Hi,
>
>  
>
> When applying the do_routing function without specifying the group id, 
> what are the matching patterns that it will look for?
>
As documented, if no group id is given to the function, it will try to 
discover the group Id by looking in the dr_group table for a record 
belonging to the FROM USER.

>  
>
> In other words If I want ALL the users behind domain test.com how 
> would I do it?
>
>  
>
> Leaving the username field empty and putting test.com in the domain 
> did not work.
>
I guess you did this is dr_group table, but this requires a full 
username and domain.

Note that do_routing() does accept the group id via a variable also, so 
you can load the group id from a DB via whatever query (see 
avp_db_query()) function. Or you can use dialplan module to have a 
translation from domain names to group ids . Or, the most simple static cfg:

    $var(dr_id) = 0;
    switch($rd) {
       case "test.com" : $var(dr_id) = 1; break;
       case "probe.com" : $var(dr_id) = 2; break;
       ............................
   }

    do_routing("$var(dr_id)");

Regards,
Bogdan
>
>  
>
> Thanks
>
>  
>
>  
>
> Sebastian
>
>  
>
>  
>
>  
>
>  
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   




More information about the Users mailing list