[SR-Users] Get destination IP from forwarded invite

CUMHUR KARAHAN cumhur.karahan at consultant.turkcell.com.tr
Thu Jan 16 12:45:15 CET 2020

Hi all,

I'm a newbie for Kamailio and working on a feature needs end-users' destination IP in the first transferred/forwarded invite message.

Basically, our system/call flow is like:
ClientA -> Kamailio1 -> Kamailio2 -> ClientB

Invite from the clientA:

INVITE sip:905364167881 at testsip.tvoip.turkcell.com.tr:443 SIP/2.0
Via: SIP/2.0/TLS;branch=z9hG4bK.GoiTxA4Ee;rport
From: <sip:905368601286 at testsip.tvoip.turkcell.com.tr>;tag=WbINy0ypx
To: sip:905364167881 at testsip.tvoip.turkcell.com.tr

Needed Ip (Client B's IP for this case) is in the INVITE row of the forwarded message.

Invite to the Kamailio2 :

INVITE sip:905364167881 at;transport=tls SIP/2.0
Record-Route: <sip:gearbox11.turkcell.tgc:5060;r2=on;lr;did=7f5.f572;nat=yes>
Record-Route: <sip:testsip05.tvoip.turkcell.com.tr:443;transport=tls;r2=on;lr;did=7f5.f572;nat=yes>
Via: SIP/2.0/UDP gearbox11.turkcell.tgc:5060;branch=z9hG4bK67ad.4e8e863f2475ab8d3053af0593548557.1;i=f
Via: SIP/2.0/TLS;received=;branch=z9hG4bK.1SYkXD1Me;rport=32980
From: <sip:905368601286 at testsip.tvoip.turkcell.com.tr>;tag=WbINy0ypx
To: sip:905364167881 at testsip.tvoip.turkcell.com.tr

When the first invite message receives, the dialog variables or sel(msg...) parsed values belong to this first received message, as far as I understand during the tests. However I need the forwarded invite message's variables. Even after t_relay in RELAY route, it looks the message I have is the first one. So, I cannot reach this later IP in the forwarded invite message. As far as I understand, bear with me here please, this IP manipulation executes in t_relay function and in the C side of Kamailio. So, I cannot find a way to do that in the our native scripts.

Is there any way to get it without diving C code's abyss? Do you have any idea about it? I would appreciate it, if I can get any help or any clue.

Thanks for all...

S. Cumhur Karahan

[http://s.turkcell.com.tr/SiteAssets/Genel/mail-imza.jpg] <http://turkcell.li/ncfYh>

Bu elektronik posta ve onunla iletilen butun dosyalar sadece gondericisi tarafindan almasi amaclanan yetkili gercek ya da tuzel kisinin kullanimi icindir. Eger soz konusu yetkili alici degilseniz bu elektronik postanin icerigini aciklamaniz, kopyalamaniz, yonlendirmeniz ve kullanmaniz kesinlikle yasaktir ve bu elektronik postayi derhal silmeniz gerekmektedir.

TURKCELL bu mesajin icerdigi bilgilerin do?rulu?u veya eksiksiz oldugu konusunda herhangi bir garanti vermemektedir. Bu nedenle bu bilgilerin ne sekilde olursa olsun iceriginden, iletilmesinden, alinmasindan ve saklanmasindan sorumlu degildir. Bu mesajdaki gorusler yalnizca gonderen kisiye aittir ve TURKCELLin goruslerini yansitmayabilir

Bu e-posta bilinen butun bilgisayar viruslerine karsi taranmistir.


This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient you are hereby notified that any dissemination, forwarding, copying or use of any of the information is strictly prohibited, and the e-mail should immediately be deleted.

TURKCELL makes no warranty as to the accuracy or completeness of any information contained in this message and hereby excludes any liability of any kind for the information contained therein or for the information transmission, reception, storage or use of such in any way whatsoever. The opinions expressed in this message belong to sender alone and may not necessarily reflect the opinions of TURKCELL.

This e-mail has been scanned for all known computer viruses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200116/37a3c32b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 92 bytes
Desc: image001.gif
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200116/37a3c32b/attachment.gif>

More information about the sr-users mailing list