[OpenSIPS-Users] drounting

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Nov 17 09:49:01 CET 2008

Hi David,

David Villasmil wrote:
> Hello,
>      I've been testing drouting, and as always with "new" modules, it 
> works great. I've got a question: dr_groups has a "username" and 
> "domain" field, it is my understanding that if I leave username blank 
> and put something on domain, everything directed to that domain will 
> be routed using the group id.
No, the username cannot mis - The table is to be used when you want to 
do a per user mapping of group ids.

For you case (per domain mapping), you can do it without the table, 
directly from script:
    if ($rd=="my_domain")
       $avp(i:10) = "1";  #use group 1
    else ......
> Now, lets say I want to route based on a source IP instead of 
> username? Say the source IP is NOT registered... what then?
you can compute the group id based on whatever information you need, 
from the script, and than pass it directly to the DR routing function.


More information about the Users mailing list