[SR-Users] Get ip from contact on redirect
Diego Nadares
dnadares at gmail.com
Fri Jan 20 18:15:42 CET 2017
Thanks Daniel. It was very useful but I had to do the transformation in two
parts maybe because I'm very new with this.
Is correct like this?
if (t_check_status("302")) {
#New contact is <sip:xx at 172.16.208.111:5060
;user=phone>;q=0.5,<sip:xx at 172.16.208.112:5060;user=phone>;q=0.25;
$var(redirect_uri) = $(T_rpl($ct){nameaddr.uri});
xlog("Got a 302 - redirecting to
$(var(redirect_uri){uri.host})" );
get_redirects("*:1");
$xavp(ip_b[$avp(current_route)]=>name)
= $(var(redirect_uri){uri.host});
xlog("Got a 302 - redirecting $hdr(Contact)");
route(RELAY);
#t_relay();
}
Is there a way to do it in one line?
Thanks again!
Diego
2017-01-20 13:16 GMT-03:00 Daniel Tryba <d.tryba at pocos.nl>:
> On Fri, Jan 20, 2017 at 05:11:32PM +0100, Daniel Tryba wrote:
> > The host part of this contact is: $(T_rpl($ct){nameaddr.uri});
>
> Which is not correct, {uri.host} should to the job (according to
> https://www.kamailio.org/wiki/cookbooks/4.1.x/transformations#urihost
> )
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170120/83865bd6/attachment.html>
More information about the sr-users
mailing list