Discussion:
[sr-dev] [kamailio/kamailio] IPV6 Contact Parsed as V4 notation (#2742)
chappo
2021-05-23 04:21:24 UTC
Permalink
### Description

Saving contact location details for IPV6 client via UDP results in a IPv4 notation. Changing to TCP correctly saves the IPV6 notation and functions correctly.

### Troubleshooting

Tested on 4.4 / 4.5 & Devel. Default and custom configuration

#### Reproduction

Using default configuration the contact location for a IPv6 UDP client is saved as a shortened v4 style address. Using TCP with exact same configuration the client is correctly saved in IPV6 notation.


#### Debugging Data

May 23 03:29:50 localhost /usr/local/sbin/kamailio[32104]: DEBUG: <core> [core/udp_server.c:493]: udp_rcv_loop(): received on udp socket: (106/100/528) [[REGISTER sip:voip.domain.com SIP/2.0 0D 0A Via: SIP/2.0/UDP 32.1.128.4:52692;rport;branch=z9hG4bKPj]]

May 23 03:29:50 localhost /usr/local/sbin/kamailio[32104]: DEBUG: {1 8093 REGISTER nTrprYhDHmupMBiLT6fuYVwvy31d0YPB} <core> [core/socket_info.c:641]: grep_sock_info(): checking if host==us: 39==33 && [2001:8004:13C1:7751:7999:6FB5:216D:A4A8] == [2400:8907:0:0:F03C:92FF:FE22:XXXX]

#### Log Messages

[syslog.log](https://github.com/kamailio/kamailio/files/6527523/syslog.log)


#### SIP Traffic

![IPV6TCP-Issue](Loading Image...)
![IPV6UDP-Issue](Loading Image...)

### Additional Information

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

version: kamailio 5.5.0 (x86_64/linux) ef765d
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, 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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
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: ef765d
compiled on 03:53:39 May 23 2021 with gcc 8.3.0

version: kamailio 5.5.0 (x86_64/linux) ef765d
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, 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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
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: ef765d
compiled on 04:15:07 May 23 2021 with gcc 8.3.0



* **Operating System**:

4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) 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/2742
Daniel-Constantin Mierla
2021-05-27 07:58:22 UTC
Permalink
It is not clear for me what you mean by ` shortened v4 style address`.

Can you get the output of `kamctl ul show` for the contact record that exposes the problem and paste it here?

Also, note that screenshots are not really useful when reporting bugs to kamailio. Either attach pcap files of the SIP traffic exposing the issues or ngrep output as text (which is easier to edit and replace ip addresses, if you need that).
--
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/2742#issuecomment-849423104
chappo
2021-05-27 08:37:30 UTC
Permalink
@miconda Apologies - contact location is saved as 32.1.128.4 vs the actual ip address of 2400:8907:0:0:F03C:92FF:FE22:XXXX

Per the syslog - reated Contact HF: Contact: <sip:***@32.1.128.4:52692;ob>;expires=300#015#012

DEBUG: [core/udp_server.c:493]: udp_rcv_loop(): received on udp socket: (106/100/528) [[REGISTER sip:voip.domain.com SIP/2.0 0D 0A Via: SIP/2.0/UDP **32.1.128.4:52692**;rport;branch=z9hG4bKPj]]

May 23 03:29:50 localhost /usr/local/sbin/kamailio[32104]: DEBUG: {1 8093 REGISTER nTrprYhDHmupMBiLT6fuYVwvy31d0YPB} [core/socket_info.c:641]: grep_sock_info(): checking if host==us: 39==33 && **[2001:8004:13C1:7751:7999:6FB5:216D:A4A8] == [2400:8907:0:0:F03C:92FF:FE22:XXXX]**

Sorry I don't have the sip capture at present but will do so shortly.
--
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/2742#issuecomment-849449505
chappo
2021-05-27 15:22:39 UTC
Permalink
SIP Capture attached for two register attempts, one on UDP and the other on TCP.

UDP =
U 2001:8004:13c0:5fed:dd64:812e:f2cd:8bf6:45417 -> fd00:db8:deca::4:5060 #2718
REGISTER sip:voip.domain.com SIP/2.0.
Via: SIP/2.0/UDP 32.1.128.4:45417;rport;branch=z9hG4bKPjZ5fpsipsncRX35bosd-juQhhswwf2n.t.
Contact: <sip:***@32.1.128.4:45417;ob>.

TCP (Works) =
T 2001:8004:13c0:5fed:dd64:812e:f2cd:8bf6:63053 -> fd00:db8:deca::4:5060 [AP] #4321
REGISTER sip:voip.domain.com;transport=tcp SIP/2.0.
Via: SIP/2.0/TCP [2001:8004:13c0:5fed:dd64:812e:f2cd:8bf6]:63053;rport;branch=z9hG4bKPjZyp0v51VSpi72vDLN0qA-rZBJv4FuMfG;alias.
Contact: <sip:83@[2001:8004:13c0:5fed:dd64:812e:f2cd:8bf6]:63053;transport=TCP;ob>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-0000f9855a1c>".



[SIP Capture.txt](https://github.com/kamailio/kamailio/files/6555068/SIP.Capture.txt)
--
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/2742#issuecomment-849724412
sergey-safarov
2021-05-27 18:51:44 UTC
Permalink
You can see
```
REGISTER sip:voip.domain.com SIP/2.0.
Via: SIP/2.0/UDP 32.1.128.4:45417;rport;branch=z9hG4bKPjZ5fpsipsncRX35bosd-juQhhswwf2n.t.
Max-Forwards: 70.
From: <sip:***@voip.domain.com>;tag=zMJ4EsFF8lnLBuDCWxk52XJgy84zU180.
To: <sip:***@voip.domain.com>.
Call-ID: qlKuZzPgK8dIzwwwpRRsP8yNr3xpWzzE.
CSeq: 54489 REGISTER.
User-Agent: ABTO VoIP SDK.
```

These messages send not by `Kamailio`.
This message send by "ABTO VoIP SDK".

You need to check "ABTO VoIP SDK" provider to config manage difference with IPv6/IPv4 address when used TCP/UDP transport.
--
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/2742#issuecomment-849861775
chappo
2021-05-28 07:32:00 UTC
Permalink
Closed #2742.
--
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/2742#event-4810566601
chappo
2021-05-28 07:32:00 UTC
Permalink
Thankyou. I have got the client logs from the developer and yes its due to a lookup error, SRV records should fix the issue
Closing
--
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/2742#issuecomment-850213513
Loading...