[kamailio/kamailio] IPv6 parse_uri error (#1136)

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

[kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz

Description

When making end-to-end IMS voice call over IPv6, Kamailio PCSCF doesn't send the Sip Invite to callee. I saw the following error in PCSCF logs:

4(32107) DEBUG: [parser/parse_uri.c:1258]: parse_uri(): parse_uri: bad char ':' in state 2 parsed: sip:FC00:1234 (13) / sip:FC00🔢3:2:0:0:0:0:5060 (30)
4(32107) ERROR: tm [ut.h:254]: uri2dst2(): ERROR: uri2dst: bad_uri: [sip:FC00🔢3:2:0:0:0:0:5060]
4(32107) ERROR: tm [t_fwd.c:1737]: t_forward_nonack(): ERROR: t_forward_nonack: failure to add branches
4(32107) DEBUG: tm [t_funcs.c:331]: t_relay_to(): t_forward_nonack returned error -478 (-478)
4(32107) DEBUG: tm [t_funcs.c:348]: t_relay_to(): -478 error reply generation delayed

I saw a similar issue in your database: nat_traversal: Builds wrong URI for IPv6, bad URI parsing #362.
Have you fixed this issue?

Troubleshooting

To me, sip:FC00🔢3:2:0:0:0:0:5060 should be sip:[FC00🔢3:2:0:0:0:0]:5060. After I added the workarround to change it to sip:[FC00🔢3:2:0:0:0:0]:5060, PCSCF can send the Sip Invite to callee and the IMS voice call can be established.

Reproduction

I can reproduce this issue using two soft phones: Linphone and Jitsi.

Debugging Data

(paste your debugging data here)

Log Messages

(paste your log messages here)

4(32107) DEBUG: [parser/parse_uri.c:1258]: parse_uri(): parse_uri: bad char ':' in state 2 parsed: sip:FC00:1234 (13) / sip:FC00🔢3:2:0:0:0:0:5060 (30)
4(32107) ERROR: tm [ut.h:254]: uri2dst2(): ERROR: uri2dst: bad_uri: [sip:FC00🔢3:2:0:0:0:0:5060]
4(32107) ERROR: tm [t_fwd.c:1737]: t_forward_nonack(): ERROR: t_forward_nonack: failure to add branches
4(32107) DEBUG: tm [t_funcs.c:331]: t_relay_to(): t_forward_nonack returned error -478 (-478)
4(32107) DEBUG: tm [t_funcs.c:348]: t_relay_to(): -478 error reply generation delayed

SIP Traffic

(paste your sip traffic here)

INVITE sip:bob@[fc00🔢3:2:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org SIP/2.0
Record-Route: sip:mt@[FC00🔢1:0:0:0:0:47];lr=on;ftag=be2790bd;did=557.1972
Route: sip:[hidden email]:5060;nat=yes;received=sip:FC00🔢3:2:0:0:0:0:5060;lr
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:47];lr=on;ftag=be2790bd;did=557.1972
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:45];lr=on;ftag=be2790bd;nat=yes;did=557.f271
Call-ID: 16a983b6edc2370ad08370112a800d98@0:0:0:0:0:0:0:0
CSeq: 1 INVITE
From: "alice" sip:[hidden email];tag=be2790bd
To: sip:[hidden email]
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:47];branch=z9hG4bKc87.6294094b4129fdf733069ffd6625d303.0
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:46];branch=z9hG4bKc87.66958ffdcce62f80024bf5913086e312.1
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:47];branch=z9hG4bKc87.5d9a7aae58830978432d73b25057fb39.0
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:45];branch=z9hG4bKc87.b56bcd8f177f65d2b1ec20ccca46519a.0
Via: SIP/2.0/UDP [fc00🔢3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-363237-5db2dc2ac95e17a0c589ae29eb75a0ce
Max-Forwards: 66
Contact: "alice" sip:alice@[fc00🔢3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org
User-Agent: Jitsi2.10.5550Linux
Content-Type: application/sdp
Content-Length: 910
X-RTP: mo
P-Asserted-Identity: sip:[hidden email]

v=0
o=alice-jitsi.org 0 0 IN IP6 fc00🔢3:1:0:0:0:0
s=-
c=IN IP6 fc00🔢3:1:0:0:0:0
t=0 0
m=audio 5056 RTP/AVP 96 97 98 9 100 102 0 8 103 3 104 101
a=rtpmap:96 opus/48000/2
a=fmtp:96 usedtx=1
a=ptime:20
a=rtpmap:97 SILK/24000
a=rtpmap:98 SILK/16000
a=rtpmap:9 G722/8000
a=rtpmap:100 speex/32000
a=rtpmap:102 speex/16000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:103 iLBC/8000
a=rtpmap:3 GSM/8000
a=rtpmap:104 speex/8000
a=rtpmap:101 telephone-event/8000
a=extmap:1 urn:ietf:params:rtp-hdrext:csrc-audio-level
a=extmap:2 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=rtcp-xr:voip-metrics
m=video 5058 RTP/AVP 105 99
a=recvonly
a=rtpmap:105 H264/90000
a=fmtp:105 profile-level-id=4DE01f;packetization-mode=1
a=imageattr:105 send * recv [x=[1:1376],y=[1:883]]
a=rtpmap:99 H264/90000
a=fmtp:99 profile-level-id=4DE01f
a=imageattr:99 send * recv [x=[1:1376],y=[1:883]]

Possible Solutions

Additional Information

  • Kamailio Version - output of kamailio -v
(paste your output here)

version: kamailio 5.0.0-dev5 (x86_64/linux)
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_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 21:48:42 Feb 21 2017 with gcc 5.4.0

  • Operating System:
(paste your output here)

Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"IPv6 parse_uri error (#1136)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz

Do you set the r-uri value inside kamailio.cfg via some assignment operations? Or it is updated only by the ims modules you are using?

If later, maybe @jaybeepee, @ngvoice or @richardgood can comment more on what happens in the c code for the modules.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1136: Do you set the r-uri value inside kamailio.cfg via some assignment operations? Or it is updated only by the ims modules you are using?\r\n\r\nIf later, maybe @jaybeepee, @ngvoice or @richardgood can comment more on what happens in the c code for the modules."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-306407150"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

Thank you, miconda. We don't set r-uri value in pcscf.cfg, icscf.cfg or scscf.cfg. I will show more details below using the logs with Jitsi. I will omit SDP to save space.

  1. When PCSCF received the Sip Invite from caller, the Sip headers look fine:

INVITE sip:[hidden email] SIP/2.0
Call-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0
CSeq: 1 INVITE
From: "alice" sip:[hidden email];tag=94b2833a
To: sip:[hidden email]
Via: SIP/2.0/UDP [fc00🔢3:1:0:0:0:0]:5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd
Max-Forwards: 70
Contact: "alice" sip:alice@[fc00🔢3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org
User-Agent: Jitsi2.10.5550Linux
Content-Type: application/sdp
Content-Length: 910

  1. Then PCSCF sent it to SCSCF:

INVITE sip:[hidden email] SIP/2.0
Route: sip:[hidden email]:5060;lr
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181
Call-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0
CSeq: 1 INVITE
From: "alice" sip:[hidden email];tag=94b2833a
To: sip:[hidden email]
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0
Via: SIP/2.0/UDP [fc00🔢3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd
Max-Forwards: 69
Contact: "alice" sip:alice@[fc00🔢3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org
User-Agent: Jitsi2.10.5550Linux
Content-Type: application/sdp
Content-Length: 910
P-Asserted-Identity: sip:[hidden email]
X-RTP: mo

  1. The SCSCF sent to ICSCF:

INVITE sip:[hidden email] SIP/2.0
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181
Call-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0
CSeq: 1 INVITE
From: "alice" sip:[hidden email];tag=94b2833a
To: sip:[hidden email]
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:47];branch=z9hG4bK0d1b.3b5263a0a9b70cdde23243c3423be371.0
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0
Via: SIP/2.0/UDP [fc00🔢3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd
Max-Forwards: 68
Contact: "alice" sip:alice@[fc00🔢3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org
User-Agent: Jitsi2.10.5550Linux
Content-Type: application/sdp
Content-Length: 910
X-RTP: mo
P-Asserted-Identity: sip:[hidden email]

  1. Then ICSCF sent it to SCSCF:

INVITE sip:[hidden email] SIP/2.0
Route: sip:scscf.ims.mnc001.mcc001.3gppnetwork.org:5060
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181
Call-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0
CSeq: 1 INVITE
From: "alice" sip:[hidden email];tag=94b2833a
To: sip:[hidden email]
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:46];branch=z9hG4bK0d1b.acefb88ca4d295d2bd315467f0670d7f.1
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:47];branch=z9hG4bK0d1b.3b5263a0a9b70cdde23243c3423be371.0
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0
Via: SIP/2.0/UDP [fc00🔢3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd
Max-Forwards: 67
Contact: "alice" sip:alice@[fc00🔢3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org
User-Agent: Jitsi2.10.5550Linux
Content-Type: application/sdp
Content-Length: 910
X-RTP: mo
P-Asserted-Identity: sip:[hidden email]

  1. Then SCSCF sent it to the PCSCF of the callee:

INVITE sip:bob@[fc00🔢3:2:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org SIP/2.0
Record-Route: sip:mt@[FC00🔢1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322
Route: sip:[hidden email]:5060;nat=yes;received=sip:FC00🔢3:2:0:0:0:0:5060;lr
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322
Record-Route: sip:mo@[FC00🔢1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181
Call-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0
CSeq: 1 INVITE
From: "alice" sip:[hidden email];tag=94b2833a
To: sip:[hidden email]
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:47];branch=z9hG4bK0d1b.da418b33c49aee4296db5cf6393c2c36.0
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:46];branch=z9hG4bK0d1b.acefb88ca4d295d2bd315467f0670d7f.1
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:47];branch=z9hG4bK0d1b.3b5263a0a9b70cdde23243c3423be371.0
Via: SIP/2.0/UDP [FC00🔢1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0
Via: SIP/2.0/UDP [fc00🔢3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd
Max-Forwards: 66
Contact: "alice" sip:alice@[fc00🔢3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org
User-Agent: Jitsi2.10.5550Linux
Content-Type: application/sdp
Content-Length: 910
X-RTP: mo
P-Asserted-Identity: sip:[hidden email]

In the last invite message, there is sip:FC00🔢3:2:0:0:0:0:5060 which doesn't have [ ] and probably cause this issue.

Any thoughts?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@davidxbwang in #1136: Thank you, miconda. We don't set r-uri value in pcscf.cfg, icscf.cfg or scscf.cfg. I will show more details below using the logs with Jitsi. I will omit SDP to save space.\r\n\r\n1. When PCSCF received the Sip Invite from caller, the Sip headers look fine:\r\n\r\nINVITE sip:bob@ims.mnc001.mcc001.3gppnetwork.org SIP/2.0\r\nCall-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0\r\nCSeq: 1 INVITE\r\nFrom: \"alice\" \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e;tag=94b2833a\r\nTo: \u003csip:bob@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nVia: SIP/2.0/UDP [fc00:1234:3:1:0:0:0:0]:5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd\r\nMax-Forwards: 70\r\nContact: \"alice\" \u003csip:alice@[fc00:1234:3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org\u003e\r\nUser-Agent: Jitsi2.10.5550Linux\r\nContent-Type: application/sdp\r\nContent-Length: 910\r\n\r\n2. Then PCSCF sent it to SCSCF:\r\n\r\nINVITE sip:bob@ims.mnc001.mcc001.3gppnetwork.org SIP/2.0\r\nRoute: \u003csip:orig@scscf.ims.mnc001.mcc001.3gppnetwork.org:5060;lr\u003e\r\nRecord-Route: \u003csip:mo@[FC00:1234:1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181\u003e\r\nCall-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0\r\nCSeq: 1 INVITE\r\nFrom: \"alice\" \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e;tag=94b2833a\r\nTo: \u003csip:bob@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0\r\nVia: SIP/2.0/UDP [fc00:1234:3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd\r\nMax-Forwards: 69\r\nContact: \"alice\" \u003csip:alice@[fc00:1234:3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org\u003e\r\nUser-Agent: Jitsi2.10.5550Linux\r\nContent-Type: application/sdp\r\nContent-Length: 910\r\nP-Asserted-Identity: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nX-RTP: mo\r\n\r\n3. The SCSCF sent to ICSCF:\r\n\r\nINVITE sip:bob@ims.mnc001.mcc001.3gppnetwork.org SIP/2.0\r\nRecord-Route: \u003csip:mo@[FC00:1234:1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322\u003e\r\nRecord-Route: \u003csip:mo@[FC00:1234:1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181\u003e\r\nCall-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0\r\nCSeq: 1 INVITE\r\nFrom: \"alice\" \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e;tag=94b2833a\r\nTo: \u003csip:bob@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:47];branch=z9hG4bK0d1b.3b5263a0a9b70cdde23243c3423be371.0\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0\r\nVia: SIP/2.0/UDP [fc00:1234:3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd\r\nMax-Forwards: 68\r\nContact: \"alice\" \u003csip:alice@[fc00:1234:3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org\u003e\r\nUser-Agent: Jitsi2.10.5550Linux\r\nContent-Type: application/sdp\r\nContent-Length: 910\r\nX-RTP: mo\r\nP-Asserted-Identity: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\n\r\n4. Then ICSCF sent it to SCSCF:\r\n\r\nINVITE sip:bob@ims.mnc001.mcc001.3gppnetwork.org SIP/2.0\r\nRoute: \u003csip:scscf.ims.mnc001.mcc001.3gppnetwork.org:5060\u003e\r\nRecord-Route: \u003csip:mo@[FC00:1234:1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322\u003e\r\nRecord-Route: \u003csip:mo@[FC00:1234:1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181\u003e\r\nCall-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0\r\nCSeq: 1 INVITE\r\nFrom: \"alice\" \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e;tag=94b2833a\r\nTo: \u003csip:bob@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:46];branch=z9hG4bK0d1b.acefb88ca4d295d2bd315467f0670d7f.1\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:47];branch=z9hG4bK0d1b.3b5263a0a9b70cdde23243c3423be371.0\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0\r\nVia: SIP/2.0/UDP [fc00:1234:3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd\r\nMax-Forwards: 67\r\nContact: \"alice\" \u003csip:alice@[fc00:1234:3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org\u003e\r\nUser-Agent: Jitsi2.10.5550Linux\r\nContent-Type: application/sdp\r\nContent-Length: 910\r\nX-RTP: mo\r\nP-Asserted-Identity: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\n\r\n5. Then SCSCF sent it to the PCSCF of the callee:\r\n\r\nINVITE sip:bob@[fc00:1234:3:2:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org SIP/2.0\r\nRecord-Route: \u003csip:mt@[FC00:1234:1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322\u003e\r\nRoute: \u003csip:term@pcscf.ims.mnc001.mcc001.3gppnetwork.org:5060;nat=yes;received=sip:FC00:1234:3:2:0:0:0:0:5060;lr\u003e\r\nRecord-Route: \u003csip:mo@[FC00:1234:1:0:0:0:0:47];lr=on;ftag=94b2833a;did=991.b322\u003e\r\nRecord-Route: \u003csip:mo@[FC00:1234:1:0:0:0:0:45];lr=on;ftag=94b2833a;nat=yes;did=991.9181\u003e\r\nCall-ID: 0b23b2ee62c061ae9f3cc1569b7824b3@0:0:0:0:0:0:0:0\r\nCSeq: 1 INVITE\r\nFrom: \"alice\" \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e;tag=94b2833a\r\nTo: \u003csip:bob@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:47];branch=z9hG4bK0d1b.da418b33c49aee4296db5cf6393c2c36.0\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:46];branch=z9hG4bK0d1b.acefb88ca4d295d2bd315467f0670d7f.1\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:47];branch=z9hG4bK0d1b.3b5263a0a9b70cdde23243c3423be371.0\r\nVia: SIP/2.0/UDP [FC00:1234:1:0:0:0:0:45];branch=z9hG4bK0d1b.9247221bd3cd63299ff9b3e1486a94e0.0\r\nVia: SIP/2.0/UDP [fc00:1234:3:1:0:0:0:0]:5060;rport=5060;branch=z9hG4bK-393032-567b1c47371a83386f685807100ab5bd\r\nMax-Forwards: 66\r\nContact: \"alice\" \u003csip:alice@[fc00:1234:3:1:0:0:0:0]:5060;transport=udp;registering_acc=ims_mnc001_mcc001_3gppnetwork_org\u003e\r\nUser-Agent: Jitsi2.10.5550Linux\r\nContent-Type: application/sdp\r\nContent-Length: 910\r\nX-RTP: mo\r\nP-Asserted-Identity: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\n\r\nIn the last invite message, there is sip:FC00:1234:3:2:0:0:0:0:5060 which doesn't have [ ] and probably cause this issue. \r\n\r\nAny thoughts?\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-306533802"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

Attached is wireshark log. Thank you!

ipv6 Jitsi parse error.pcapng.zip


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@davidxbwang in #1136: Attached is wireshark log. Thank you!\r\n\r\n[ipv6 Jitsi parse error.pcapng.zip](https://github.com/kamailio/kamailio/files/1055707/ipv6.Jitsi.parse.error.pcapng.zip)\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-306537122"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

It seems like this issue is introduced by PCSCF when Soft Phone registers. The SIP Register from PCSCF to ICSCF is as below:

REGISTER sip:ims.mnc001.mcc001.3gppnetwork.org SIP/2.0
Via: SIP/2.0/UDP [FC00:1235:1:0:0:0:0:45];branch=z9hG4bK9fc5.213ad03f122aa3a2b0840eae36a852ba.1
Via: SIP/2.0/UDP [fc00:1235:3:1::]:5060;rport=5060;received=FC00:1235:3:1:0:0:0:0;branch=z9hG4bK2107430722
From: sip:[hidden email];tag=60956342
To: sip:[hidden email]
Call-ID: 2069996946
CSeq: 1 REGISTER
Contact: sip:alice@[fc00:1235:3:1::];line=572ba75522c0a87;alias=[FC00:1235:3:1:0:0:0:0]~5060~1
Max-Forwards: 69
User-Agent: Linphone/3.6.1 (eXosip2/4.1.0)
Expires: 3600
Content-Length: 0
Path: sip:[hidden email]:5060;nat=yes;received=**sip:FC00:1235:3:1:0:0:0:0:5060**;lr
Supported: path
Require: path
P-Visited-Network-ID: ims.mnc001.mcc001.3gppnetwork.org

The SIP Register from Soft Phone is fine:

REGISTER sip:ims.mnc001.mcc001.3gppnetwork.org SIP/2.0
Via: SIP/2.0/UDP [fc00:1235:3:1::]:5060;branch=z9hG4bK2107430722
From: sip:[hidden email];tag=60956342
To: sip:[hidden email]
Call-ID: 2069996946
CSeq: 1 REGISTER
Contact: sip:alice@[fc00:1235:3:1::];line=572ba75522c0a87
Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.1.0)
Expires: 3600
Content-Length: 0


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@davidxbwang in #1136: It seems like this issue is introduced by PCSCF when Soft Phone registers. The SIP Register from PCSCF to ICSCF is as below:\r\n\r\nREGISTER sip:ims.mnc001.mcc001.3gppnetwork.org SIP/2.0\r\nVia: SIP/2.0/UDP [FC00:1235:1:0:0:0:0:45];branch=z9hG4bK9fc5.213ad03f122aa3a2b0840eae36a852ba.1\r\nVia: SIP/2.0/UDP [fc00:1235:3:1::]:5060;rport=5060;received=FC00:1235:3:1:0:0:0:0;branch=z9hG4bK2107430722\r\nFrom: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e;tag=60956342\r\nTo: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nCall-ID: 2069996946\r\nCSeq: 1 REGISTER\r\nContact: \u003csip:alice@[fc00:1235:3:1::];line=572ba75522c0a87;alias=[FC00:1235:3:1:0:0:0:0]~5060~1\u003e\r\nMax-Forwards: 69\r\nUser-Agent: Linphone/3.6.1 (eXosip2/4.1.0)\r\nExpires: 3600\r\nContent-Length: 0\r\nPath: \u003csip:term@pcscf.ims.mnc001.mcc001.3gppnetwork.org:5060;nat=yes;received=**sip:FC00:1235:3:1:0:0:0:0:5060**;lr\u003e\r\nSupported: path\r\nRequire: path\r\nP-Visited-Network-ID: ims.mnc001.mcc001.3gppnetwork.org\r\n\r\nThe SIP Register from Soft Phone is fine:\r\n\r\nREGISTER sip:ims.mnc001.mcc001.3gppnetwork.org SIP/2.0\r\nVia: SIP/2.0/UDP [fc00:1235:3:1::]:5060;branch=z9hG4bK2107430722\r\nFrom: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e;tag=60956342\r\nTo: \u003csip:alice@ims.mnc001.mcc001.3gppnetwork.org\u003e\r\nCall-ID: 2069996946\r\nCSeq: 1 REGISTER\r\nContact: \u003csip:alice@[fc00:1235:3:1::];line=572ba75522c0a87\u003e\r\nMax-Forwards: 70\r\nUser-Agent: Linphone/3.6.1 (eXosip2/4.1.0)\r\nExpires: 3600\r\nContent-Length: 0\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-308493913"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

@davidxbwang please use markdown format when pasting.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@linuxmaniac in #1136: @davidxbwang please use markdown format when pasting."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-309082579"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

@linuxmaniac Thank you. I corrected a format issue in my previous post. How to select "markdown format"?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@davidxbwang in #1136: @linuxmaniac Thank you. I corrected a format issue in my previous post. How to select \"markdown format\"?"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-309224390"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

@linuxmaniac, @miconda, I work with @davidxbwang

I found the issue in modules/pv/pv_core.c. Function pv_get_srcip(). We should substitute the function ip_addr2strz() for ip_addr2a(). ip_addr2strz() correctly inserts the [] in the string when the address is IPv6. Also, I noticed that both of these functions use a static buffer that is one character too small. Since they put a null terminator, if you have a maximum size IPv6 address (no leading zeros) you will overwrite the end of the buffer.

We tested the fix, and, it appears to not affect other parts of the code that might not expect the brackets [] added.

Below the fix is shown with the old line commented out.

int pv_get_srcip(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
{
str s;
if(msg==NULL)
return -1;

    //s.s = ip_addr2a(&msg->rcv.src_ip);
    s.s = ip_addr2strz(&msg->rcv.src_ip);
    s.len = strlen(s.s);
    return pv_get_strval(msg, param, res, &s);

}

Don.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@doncarr in #1136: @linuxmaniac, @miconda, I work with @davidxbwang \r\n\r\nI found the issue in modules/pv/pv_core.c. Function pv_get_srcip(). We should substitute the function ip_addr2strz() for ip_addr2a(). ip_addr2strz() correctly inserts the [] in the string when the address is IPv6. Also, I noticed that both of these functions use a static buffer that is one character too small. Since they put a null terminator, if you have a maximum size IPv6 address (no leading zeros) you will overwrite the end of the buffer. \r\n\r\nWe tested the fix, and, it appears to not affect other parts of the code that might not expect the brackets [] added. \r\n\r\nBelow the fix is shown with the old line commented out.\r\n\r\nint pv_get_srcip(struct sip_msg *msg, pv_param_t *param,\r\n pv_value_t *res)\r\n{\r\n str s;\r\n if(msg==NULL)\r\n return -1;\r\n \r\n //s.s = ip_addr2a(\u0026msg-\u003ercv.src_ip);\r\n s.s = ip_addr2strz(\u0026msg-\u003ercv.src_ip);\r\n s.len = strlen(s.s);\r\n return pv_get_strval(msg, param, res, \u0026s);\r\n}\r\n \r\nDon."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310208571"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

This function is behind $si variable that is supposed to return plain source ip address. The [] around IPv6 is required in URIs, but the IP address itself is without [].

The function is not used from other modules, therefore you use $si in your configuration file somewhere. Can you check that?

You can replace do:

if(af==INET6) {
  $var(si) = "[" + $si + "]";
} else {
  $var(si) = $si;
}

Then use $var(si) instead of $si. Maybe a variable to get the source ip with square brackets would be useful, but that will be a new feature, $si will stay as it is, because it is useful in many cases.

Anyhow, it looks like an issue in kamailio.cfg, not in code.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1136: This function is behind `$si` variable that is supposed to return plain source ip address. The `[]` around IPv6 is required in URIs, but the IP address itself is without `[]`.\r\n\r\nThe function is not used from other modules, therefore you use `$si` in your configuration file somewhere. Can you check that?\r\n\r\nYou can replace do:\r\n\r\n```\r\nif(af==INET6) {\r\n $var(si) = \"[\" + $si + \"]\";\r\n} else {\r\n $var(si) = $si;\r\n}\r\n```\r\n\r\nThen use $var(si) instead of $si. Maybe a variable to get the source ip with square brackets would be useful, but that will be a new feature, $si will stay as it is, because it is useful in many cases.\r\n\r\nAnyhow, it looks like an issue in kamailio.cfg, not in code."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310216148"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

@miconda Thank you so much for your advice! We will try your suggestion.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@davidxbwang in #1136: @miconda Thank you so much for your advice! We will try your suggestion."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310254309"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

Btw, where is the issue with the null termination, the buffers seem to be defined with max_address_len + 1? Can you point in the source code (file path and line)?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1136: Btw, where is the issue with the null termination, the buffers seem to be defined with `max_address_len + 1`? Can you point in the source code (file path and line)?"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310288369"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

Is there any reason for an IPv6 address string without brackets? Really, any IPv6 address floating around in text format without the brackets is a danger, and will require extra case switch or if-then-else. It might be good to eliminate functions that create the IP address strings without brackets. The code also does not use the standard system call to convert IP addresses to string, and gives a legal, but non-standard string. We will take a look at your suggested solution and provide feedback. We could also change the documentation if it is not yet used anywhere where it it expected without brackets.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@doncarr in #1136: Is there any reason for an IPv6 address string without brackets? Really, any IPv6 address floating around in text format without the brackets is a danger, and will require extra case switch or if-then-else. It might be good to eliminate functions that create the IP address strings without brackets. The code also does not use the standard system call to convert IP addresses to string, and gives a legal, but non-standard string. We will take a look at your suggested solution and provide feedback. We could also change the documentation if it is not yet used anywhere where it it expected without brackets."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310386312"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

The $si is one of the oldest variables, being in this form from beginning. Not sure about others, but I use it in many API requests or sqlops queries. Moreover, the definition of an IPv6 address is without brackets. The brackets are in the grammar of an address or URI. The $si won't change, I can bet is going to break a lot of configs. I added $siz to master branch that should return the ipv6 address in between brackets.

I am closing this one being a config issue, not a code problem. If you still think there is not enough space in the static buffer, open a new issue pointing in the code where you think the problem is.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1136: The $si is one of the oldest variables, being in this form from beginning. Not sure about others, but I use it in many API requests or sqlops queries. Moreover, the definition of an IPv6 address is without brackets. The brackets are in the grammar of an address or URI. The $si won't change, I can bet is going to break a lot of configs. I added $siz to master branch that should return the ipv6 address in between brackets.\r\n\r\nI am closing this one being a config issue, not a code problem. If you still think there is not enough space in the static buffer, open a new issue pointing in the code where you think the problem is."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310495178"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

Closed #1136.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Closed #1136."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#event-1135470266"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

My opinion is it is better to just change the existing code, and all existing installations will start working with IPv6 when they upgrade. It is also much simpler.

However, the following has been tested and also works to add a $ function that returns a correct IP string for IPv6:

The following would need to be added to the table in modules/pv/pv.c
{{"sibr", (sizeof("sibr")-1)}, /* */
PVT_OTHER, pv_get_srcip_bracket, 0,
0, 0, 0, 0},

Then a new function in modules/pv/pv.c
/* The following fundtion gets the source IP with brackets for IPv6 */
int pv_get_srcip_bracket(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
{
str s;
if(msg==NULL)
return -1;

    s.s = ip_addr2strz(&msg->rcv.src_ip);
    s.len = strlen(s.s);
    return pv_get_strval(msg, param, res, &s);

}

Finally, a change to the config file line:
append_hf("Path: sip:term@HOSTNAME:"+PORT+";nat=yes;received=sip:$sibr:$sp;$var(ws_transport)lr\r\n")


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@doncarr in #1136: My opinion is it is better to just change the existing code, and all existing installations will start working with IPv6 when they upgrade. It is also much simpler.\r\n\r\nHowever, the following has been tested and also works to add a $ function that returns a correct IP string for IPv6:\r\n\r\nThe following would need to be added to the table in modules/pv/pv.c \r\n {{\"sibr\", (sizeof(\"sibr\")-1)}, /* */\r\n PVT_OTHER, pv_get_srcip_bracket, 0,\r\n 0, 0, 0, 0},\r\n\r\nThen a new function in modules/pv/pv.c \r\n/* The following fundtion gets the source IP with brackets for IPv6 */\r\nint pv_get_srcip_bracket(struct sip_msg *msg, pv_param_t *param,\r\n pv_value_t *res)\r\n{\r\n str s;\r\n if(msg==NULL)\r\n return -1;\r\n\r\n s.s = ip_addr2strz(\u0026msg-\u003ercv.src_ip);\r\n s.len = strlen(s.s);\r\n return pv_get_strval(msg, param, res, \u0026s);\r\n}\r\n\r\nFinally, a change to the config file line:\r\n append_hf(\"Path: \u003csip:term@HOSTNAME:\"+PORT+\";nat=yes;received=sip:$sibr:$sp;$var(ws_transport)lr\u003e\\r\\n\")\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310497694"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

Ok, sorry, I posted about the same time. We will use your fix using "siz" as the function name. Not sure there is any place you need it without brackets . . . Thanks.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@doncarr in #1136: Ok, sorry, I posted about the same time. We will use your fix using \"siz\" as the function name. Not sure there is any place you need it without brackets . . . Thanks.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310499408"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

I have installations with IPv6 since 2002 and they work. I don't get what you mean by "all existing installations will start working with IPv6 when they upgrade".

And as I said, I use bare IPv6 in a lot of database tables that I query with sqlops or do HTTP API requests to external systems that expect standard IPv6 format.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1136: I have installations with IPv6 since 2002 and they work. I don't get what you mean by \"all existing installations will start working with IPv6 when they upgrade\".\r\n\r\nAnd as I said, I use bare IPv6 in a lot of database tables that I query with sqlops or do HTTP API requests to external systems that expect standard IPv6 format."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310499942"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|

Re: [kamailio/kamailio] IPv6 parse_uri error (#1136)

Sebastian Denz
In reply to this post by Sebastian Denz

Ok, if you are saying your configuration fix would correctly work to check the address type at run-time, then I guess it would work. Otherwise, it would be all IPv6 or all IPv4.

The fix you added that adds the brackets automatically at run-time for $siz is the best way actually, as then you do not need cryptic configuration files.

So, in any case, thanks very much for adding the new function that automatically adds the brackets when needed.

If I have permission from Verizon, I might like to contribute in the future. I can see a need to immediately parse the incoming messages and immediately reject any message with any part not formed correctly, rather than passing bad things through the code and crashing later. Also, would be good to switch to not use the old depricated system calls for networking (avoids dangerous mucking with the IP address structures and also avoid case switches for IPv4 vs IPv6). The new calls reduce the specific code for IPv4 vs IPv6 to an absolute minimum. I would also use the system calls to convert IP address to string instead of the hand written ones, etc.

Don.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@doncarr in #1136: Ok, if you are saying your configuration fix would correctly work to check the address type at run-time, then I guess it would work. Otherwise, it would be all IPv6 or all IPv4. \r\n\r\nThe fix you added that adds the brackets automatically at run-time for $siz is the best way actually, as then you do not need cryptic configuration files.\r\n\r\nSo, in any case, thanks very much for adding the new function that automatically adds the brackets when needed.\r\n\r\nIf I have permission from Verizon, I might like to contribute in the future. I can see a need to immediately parse the incoming messages and immediately reject any message with any part not formed correctly, rather than passing bad things through the code and crashing later. Also, would be good to switch to not use the old depricated system calls for networking (avoids dangerous mucking with the IP address structures and also avoid case switches for IPv4 vs IPv6). The new calls reduce the specific code for IPv4 vs IPv6 to an absolute minimum. I would also use the system calls to convert IP address to string instead of the hand written ones, etc. \r\n\r\nDon."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1136#issuecomment-310512913"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev