[sr-dev] [kamailio/kamailio] Kamailio breaks RFC's 'Contact Header' (#2266)

ObakeFilter notifications at github.com
Sun Mar 29 14:24:33 CEST 2020


<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.

If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:

  * http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:

  * http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.

If there is no content to be filled in a section, the entire section can be removed.

You can delete the comments from the template sections when filling.

You can delete next line and everything above before submitting (it is a comment).
-->

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

### Troubleshooting

#### Reproduction

<!--
If the issue can be reproduced, describe how it can be done.
-->

#### Debugging Data

<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.

  gdb /path/to/kamailio /path/to/corefile
  bt full
  info locals
  list

If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->

```
(paste your debugging data here)
```

#### Log Messages

<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->

```
(paste your log messages here)
```

#### SIP Traffic

<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->

```
U YYY.YYY.YYY.YYY:5060 -> 81.24.193.248:5060
INVITE sip:+442033202609 at 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 at YYY.YYY.YYY.YYY>;tag=mp0S9yH11vryH.
To: <sip:+442033202609 at 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 at 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
```

### Possible Solutions

<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
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

```

* **Operating System**:

<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->

```
Linux version 4.4.0-98-generic (buildd at 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


```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2266
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200329/c45dd1fd/attachment-0001.html>


More information about the sr-dev mailing list