<p></p>

<h3>Description</h3>
<p>I'm running Kamailio 5.2.0, whenever I relay an invite via Kamailio, my original contact header is changed from the original:<br>
sip:+XXXXXXXXX@YYY.YYY.YYY.YYYY:5060;transport=udp;gw=netvision<br>
To<br>
sip:YYY.YYY.YYY.YYY;line=sr-.n274i0TMfsHMcCAlVyAMV5IlgCXvV8n4edQlgIUlgKQ4Vk74gI1LmZ69NM79FZAR3JC.cDNLfHUj3Wnp3MP9nd*.<br>
Even when I set it correctly on my route, using:<br>
remove_hf("Contact");<br>
append_hf("Contact: sip:$tU@YYY.YYY.YYY.YYY:5060;transport=udp;gw=netvision\r\n", "Contact");<br>
It still ends up being modified. What can I do to keep the contact header as it is?</p>

<h3>Troubleshooting</h3>
<h4>Reproduction</h4>

<h4>Debugging Data</h4>

<pre><code>(paste your debugging data here)
</code></pre>
<h4>Log Messages</h4>

<pre><code>(paste your log messages here)
</code></pre>
<h4>SIP Traffic</h4>

<pre><code>U YYY.YYY.YYY.YYY:5060 -> 81.24.193.248:5060
INVITE sip:+442033202609@81.24.193.248:5060 SIP/2.0.
Record-Route: <sip:YYY.YYY.YYY.YYY;r2=on;lr=on;ftag=mp0S9yH11vryH;vsf=AAAAAAAAAAAAAAAAAAAAAAADCAEACRgPGB8AAy4xNjM->.
Record-Route: <sip:2YYY.YYY.YYY.YYY;line=sr-.n274V8TlidQMVyUlg87vV8nlfDXlVHB9VD0.VHB9VDoLGtNRbH7ltlTEkyQl3jXEky1LNMoRkt5ukt5ukt5ukt5ukt5ukt5ukt5ukt5W8M5WktckoLuWAsduktTMm64pCAD>.
Via: SIP/2.0/UDP YYY.YYY.YYY.YYY;branch=z9hG4bK53e9.308596b23ed683368534c9d609dce0f6.0.
Via: SIP/2.0/UDP YYY.YYY.YYY.YYY;branch=z9hG4bKsr-kA2uvfsUlerJWtIylgCXvV8n4edQlgIUlgKQ4Vk74gI1.oJVjb2njburlgCXvV8n4edQlgIUlgKQ4HWsRbWPLVDX.GrXLcAHlcC74nZXKbTVpcHh4b6mMGZvJgLsLcJTkgtGu2PGgy**.
Max-Forwards: 67.
From: +18702935016 <sip:+18702935016@YYY.YYY.YYY.YYY>;tag=mp0S9yH11vryH.
To: <sip:+442033202609@81.24.193.248>.
Call-ID: !!:jbkfMgyHjbsDjblfjqAQlVldvgyHKolDlcIHlcknKVIdjcIT.
CSeq: 18182498 INVITE.
Contact: <sip:YYY.YYY.YYY.YYY;line=sr-.n274i0TMfsHMcCAlVyAMV5IlgCXvV8n4edQlgIUlgKQ4Vk74gI1LmZ69NM79FZAR3JC.cDNLfHUj3Wnp3MP9nd*>.
User-Agent: FreeSWITCH-mod_sofia/1.9.0+git~20180706T160334Z~de3df8dc0e~64bit.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY.
Supported: timer, path, replaces.
Allow-Events: talk, hold, conference, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 224.
Remote-Party-ID: "+18702935016" <sip:+18702935016@YYY.YYY.YYY.YYY>;party=calling;screen=yes;privacy=off.
..
v=0.
o=FreeSWITCH 1585439298 1585439299 IN IP4 ZZZ.ZZZ.ZZZ.ZZZ.
s=FreeSWITCH.
c=IN IP4 ZZZ.ZZZ
</code></pre>
<h3>Possible Solutions</h3>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.2.0-dev6 (x86_64/linux) c4daee
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: c4daee
compiled on 15:59:42 Aug 22 2018 with gcc 5.4.0

</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>Linux version 4.4.0-98-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #121-Ubuntu SMP Tue Oct 10 14:24:03 UTC 2017

Linux kamaillioegress 4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10 14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux


</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2266">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNETVKQ43ZD22UWSZTRJ44YDANCNFSM4LV6OPSA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMLILEJPGF4GIRBFQDRJ44YDA5CNFSM4LV6OPSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IZHKTLQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2266",
"url": "https://github.com/kamailio/kamailio/issues/2266",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>