[SR-Users] Retrieve last via IP from SIP MEssage

Henning Westerholt hw at gilawa.com
Fri Jan 14 09:27:39 CET 2022


Hello,

if you want to use "selects" you need to use the proper PV:
http://www.kamailio.org/wiki/cookbooks/5.4.x/pseudovariables#sel_name_-_selects

If you just want to access the Via header, you can also simply use $hdr(Via):

http://www.kamailio.org/wiki/cookbooks/5.4.x/pseudovariables#hdr_name_-_headers

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com<https://gilawa.com/>

From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Adarsh Chauhan
Sent: Friday, January 14, 2022 2:02 AM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Subject: [SR-Users] Retrieve last via IP from SIP MEssage

Hi All,

I have tried couple of methods to retrieve last via IP of SIP message but failed to retrieve it, trying to retrieve the source

- @hf_value.via[-1].host,
it simply prints the exact text back @hf_value.via[-1].host

- $sel(@hf_value.via[-1])
it doest give the IP but the entire via value
SIP/2.0/TCP 172.31.30.144;branch=z9hG4bKf8bd.753341d2000000000000000000000000.0.host

@via[-1].host
it also simply prints the exact text back @via[-1].host

Regards,
Adarsh Chauha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220114/1953d4e1/attachment.htm>


More information about the sr-users mailing list