[SR-Users] Kamailio Infront of Asterisk with remote PBX

Daniel Tryba daniel at pocos.nl
Fri Oct 24 13:40:13 CEST 2014


On Thursday 23 October 2014 19:16:58 Kenny Watson wrote:
> What I need to figure out is how to on kamailo maybe using a dial prefix
> specify that the call is going to a remote extension on a "user" and
> rewrite the to header to be extension at useripaddress rather than
> user at useripaddress.

I think your "problem" can be summarized as:

initial trunk invite: INVITE sip:number at kamailio
in kamailio $rU is number, but after a successful location lookup 
(lookup("location")/alias_db_lookup) $rU is the username from subscribers or 
dbaliases. Without further processing the invite to asterisk would look like:
INVITE sip:username at asterisk

The solution I use is simple:
-before lookup I store the initial $rU in an avp(callednumber).
-lookup
-check in usr_preferences wether the endpoint wants DID or should be addressed 
with its username (true/false)
-if true: $rU=$avp(callednumber)
-t_relay()

-- 

POCOS B.V. - Croy 9c - 5653 LC Eindhoven
Telefoon: 040 293 8661 - Fax: 040 293 8658
http://www.pocos.nl/   - http://www.sipo.nl/
K.v.K. Eindhoven 17097024



More information about the sr-users mailing list