[Serusers] Using parameters from the database

Andreas Granig a.granig at inode.at
Mon Apr 26 16:22:08 CEST 2004


Shirley wrote:
> I need to use one of the subscriber table fields to do call forwarding.
> Please someone tell me is there any functions that I can use in the ser.cfg
> to retrieve values from the database as queries to input into the uri for
> call forwarding. Please help Please help.....

Why not just using the alias table for call forwarding?
If sip:user_a at domain.com should be forwarded to sip:1234 at pstn-gw.com, 
just invoke "serctl alias add user_a sip:1234 at pstn-gw.com"
and perform something like this:

lookup("aliases");
# just relay outbound alias contacts
if(!uri==myself) { t_relay(); break; }
# everything else goes as usual
if(!lookup("locations")) { ... }
...

Since user_a is now an alias for 1234 at pstn-gw.com, it is forwarded to 
that location...

hth,
Andy




More information about the sr-users mailing list