[SR-Users] How to encode domain in username for Asterisk REGISTER forwarding (was: How to configure Kamailio + Asterisk (on same server) to route between several disjoint networks?)

Klaus Darilion klaus.mailinglists at pernau.at
Mon Mar 10 10:06:40 CET 2014


AFAIK Asterisk supports multiple domains, but it seems that is not used 
for registration.

On 09.03.2014 00:58, Alex Villací­s Lasso wrote:
>
> The above is the non-encoding version. What is the best way to modify it
> to do a domain encoding in the username? Or, if a better solution
> exists, what is it?


It should work this way:
   $uac_req(furi)="sip:" + $au + "_" + $fd + "@" + $var(rip) + ":5060";
   $uac_req(turi)="sip:" + $au + "_" + $td + "@" + $var(rip) + ":5060";

Be aware that $fd/$td can contain an optional port (depends on what the 
client sends and if you want to accept not only "domain.com" but also 
"domain.com:5060"). So you may need to use one of the transformations to 
URI-escape the domain part.

Of course in the incoming part you have to restore the original URI 
before lookup() the user.

regards
Klaus



More information about the sr-users mailing list