PJ-SIP and IPv6 - No Go?

Thanks for the details on those options.

I’m using the Distro (SNG7) which does not appear to do any IPv6 out of the box.

Anyone using the Distro and willing to share their settings?

Does the responsive firewall work with IPv6? You said IPv6 was otherwise working for you to access your box by SSH and web. That would be the next thing I’d investigate.

I whitelisted the IPv6 prefixes that I was using to test SIP connectivity. Chan_SIP over TLS via IPv6 works just the RTP seems to be missing.

Have a look at the SIP debug and see what IP addresses are showing up in the SDP parts.

sip set debug peer 1001
SIP Debugging Enabled for IP: XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
Really destroying SIP dialog ‘148113_rel61YWM4NDRiYjVkOWI4ODJmYTFiMzM5ZmI0MGE5NjQzNmY’ Method: BYE

<— SIP read from TLS:[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 —>
INVITE sip:*[email protected]:5061 SIP/2.0
Via: SIP/2.0/TLS [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067;branch=z9hG4bK-524287-1—5703d2193dd24124;rport
Max-Forwards: 70
Contact: sip:1001@[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995;rinstance=4636a15547e7f0cb;transport=tls
To: sip:*[email protected]:5061
From: sip:[email protected]:5061;tag=6dc061da
Call-ID: 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, REFER, INFO, NOTIFY, OPTIONS, SUBSCRIBE, MESSAGE
Content-Type: application/sdp
Supported: replaces
User-Agent: Bria Mobile Android 5.1.2 build 101719
Content-Length: 620

v=0
o=- 8089415738 1 IN IP6 XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
s=Cpc session
c=IN IP6 XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
t=0 0
m=audio 62216 RTP/SAVP 9 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=crypto:1 AES_CM_256_HMAC_SHA1_80 inline:XQpu31CZ9ZAsRhlcuGmr5J8QZXAKy897juHAKvs2sZHdYDrQlpCuIUexHeEAVA==
a=crypto:2 AES_CM_256_HMAC_SHA1_32 inline:Y1K9urW3EvnFTqZYbiJ11hTLpJku9voOHpokio8LdlrTiZnD7mYNTs1sfjNVKg==
a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:3TCyrXBnasp16ZYRjzzv9er/I8QM+Siqs1hv6TFo
a=crypto:4 AES_CM_128_HMAC_SHA1_32 inline:afMJzpEfgmEnkT+G87Q1V4wbFx/YZG4yOKXV6MAw
a=sendrecv
<------------->
— (13 headers 13 lines) —
[2017-11-16 23:06:38] ERROR[5494]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo(“XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX”, “52067”, …): Address family for hostname not supported
[2017-11-16 23:06:38] WARNING[5494]: chan_sip.c:18987 check_via: Could not resolve socket address for '[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067’
Sending to [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 (no NAT)
[2017-11-16 23:06:38] ERROR[5494][C-0000000c]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo(“XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX”, “52067”, …): Address family for hostname not supported
[2017-11-16 23:06:38] WARNING[5494][C-0000000c]: chan_sip.c:18987 check_via: Could not resolve socket address for '[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067’
Sending to [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 (no NAT)
Using INVITE request as basis request - 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
Found peer ‘1001’ for ‘1001’ from [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995

<— Reliably Transmitting (NAT) to [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TLS [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067;branch=z9hG4bK-524287-1—5703d2193dd24124;received=XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX;rport=45995
From: sip:[email protected]:5061;tag=6dc061da
To: sip:*[email protected]:5061;tag=as4ee99574
Call-ID: 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
CSeq: 1 INVITE
Server: FPBX-14.0.1.20(13.18.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="030a6781"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg’ in 6400 ms (Method: INVITE)

<— SIP read from TLS:[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 —>
ACK sip:*[email protected]:5061 SIP/2.0
Via: SIP/2.0/TLS [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067;branch=z9hG4bK-524287-1—5703d2193dd24124;rport
Max-Forwards: 70
To: sip:*[email protected]:5061;tag=as4ee99574
From: sip:[email protected]:5061;tag=6dc061da
Call-ID: 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
CSeq: 1 ACK
Content-Length: 0

<------------->
— (8 headers 0 lines) —

<— SIP read from TLS:[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 —>
INVITE sip:*[email protected]:5061 SIP/2.0
Via: SIP/2.0/TLS [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067;branch=z9hG4bK-524287-1—6777c7e4bb81a7c5;rport
Max-Forwards: 70
Contact: sip:1001@[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995;rinstance=4636a15547e7f0cb;transport=tls
To: sip:*[email protected]:5061
From: sip:[email protected]:5061;tag=6dc061da
Call-ID: 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, BYE, REFER, INFO, NOTIFY, OPTIONS, SUBSCRIBE, MESSAGE
Content-Type: application/sdp
Supported: replaces
User-Agent: Bria Mobile Android 5.1.2 build 101719
Authorization: Digest username=“1001”,realm=“asterisk”,nonce=“030a6781”,uri=“sip:*[email protected]:5061”,response=“b9308e779cd95b76bdb82c8f7bd1ba49”,algorithm=MD5
Content-Length: 620

v=0
o=- 8089415738 1 IN IP6 XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
s=Cpc session
c=IN IP6 XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
t=0 0
m=audio 62216 RTP/SAVP 9 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=crypto:1 AES_CM_256_HMAC_SHA1_80 inline:XQpu31CZ9ZAsRhlcuGmr5J8QZXAKy897juHAKvs2sZHdYDrQlpCuIUexHeEAVA==
a=crypto:2 AES_CM_256_HMAC_SHA1_32 inline:Y1K9urW3EvnFTqZYbiJ11hTLpJku9voOHpokio8LdlrTiZnD7mYNTs1sfjNVKg==
a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:3TCyrXBnasp16ZYRjzzv9er/I8QM+Siqs1hv6TFo
a=crypto:4 AES_CM_128_HMAC_SHA1_32 inline:afMJzpEfgmEnkT+G87Q1V4wbFx/YZG4yOKXV6MAw
a=sendrecv
<------------->
— (14 headers 13 lines) —
[2017-11-16 23:06:38] ERROR[5494][C-0000000c]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo(“XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX”, “52067”, …): Address family for hostname not supported
[2017-11-16 23:06:38] WARNING[5494][C-0000000c]: chan_sip.c:18987 check_via: Could not resolve socket address for '[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067’
Sending to [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 (NAT)
Using INVITE request as basis request - 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
Found peer ‘1001’ for ‘1001’ from [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 9
Found RTP audio format 101
Found audio description format telephone-event for ID 101
[2017-11-16 23:06:38] WARNING[5494][C-0000000c]: sdp_srtp.c:261 ast_sdp_crypto_process: Unsupported crypto suite: AES_CM_256_HMAC_SHA1_80
[2017-11-16 23:06:38] WARNING[5494][C-0000000c]: sdp_srtp.c:261 ast_sdp_crypto_process: Unsupported crypto suite: AES_CM_256_HMAC_SHA1_32
Capabilities: us - (g722|h264|mpeg4|vp9|vp8|h261|h263p|h263), peer - audio=(g722)/video=(nothing)/text=(nothing), combined - (g722)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
> 0x7f1d880194c0 – Strict RTP learning after remote address set to: [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:62216
Peer audio RTP is at port [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:62216
Peer doesn’t provide video
Looking for *43 in from-internal (domain cloud4.example.com)
sip_route_dump: route/path hop: sip:1001@[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995;rinstance=4636a15547e7f0cb;transport=tls

<— Transmitting (NAT) to [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 —>
SIP/2.0 100 Trying
Via: SIP/2.0/TLS [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067;branch=z9hG4bK-524287-1—6777c7e4bb81a7c5;received=XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX;rport=45995
From: sip:[email protected]:5061;tag=6dc061da
To: sip:*[email protected]:5061
Call-ID: 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
CSeq: 2 INVITE
Server: FPBX-14.0.1.20(13.18.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:*43@[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:5061;transport=tls
Content-Length: 0

<------------>
– Executing [*43@from-internal:1] Set(“SIP/1001-00000011”, “CONNECTEDLINE(name-charset,i)=utf8”) in new stack
– Executing [*43@from-internal:2] Set(“SIP/1001-00000011”, “CONNECTEDLINE(name,i)=Echo Test”) in new stack
– Executing [*43@from-internal:3] Set(“SIP/1001-00000011”, “CONNECTEDLINE(num,i)=*43”) in new stack
– Executing [*43@from-internal:4] Answer(“SIP/1001-00000011”, “”) in new stack
Audio is at 13760
Adding codec g722 to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Reliably Transmitting (NAT) to [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 —>
SIP/2.0 200 OK
Via: SIP/2.0/TLS [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067;branch=z9hG4bK-524287-1—6777c7e4bb81a7c5;received=XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX;rport=45995
From: sip:[email protected]:5061;tag=6dc061da
To: sip:*[email protected]:5061;tag=as0dedd95e
Call-ID: 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
CSeq: 2 INVITE
Server: FPBX-14.0.1.20(13.18.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:*43@[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:5061;transport=tls
P-Asserted-Identity: “Echo Test” sip:*[email protected]
Content-Type: application/sdp
Content-Length: 375

v=0
o=root 877682263 877682263 IN IP6 XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
s=Asterisk PBX 13.18.1
c=IN IP6 XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
t=0 0
m=audio 13760 RTP/SAVP 9 101
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv
a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:le/7GjwTMg37xynfmmX6s8ewe+F6iXMmIRxZ1FLP

<------------>

<— SIP read from TLS:[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995 —>
ACK sip:*43@[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS [XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:52067;branch=z9hG4bK-524287-1—b7d9bc2adaaaa0bb;rport
Max-Forwards: 70
Contact: sip:1001@[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX]:45995;rinstance=4636a15547e7f0cb;transport=tls
To: sip:*[email protected]:5061;tag=as0dedd95e
From: sip:[email protected]:5061;tag=6dc061da
Call-ID: 148113_rel61ODAzM2YxNWIyYTYwMDcyYWFmMWU2NjljYmJmODNjODg
CSeq: 2 ACK
User-Agent: Bria Mobile Android 5.1.2 build 101719
Content-Length: 0

<------------->
— (10 headers 0 lines) —
– Executing [*43@from-internal:5] Macro(“SIP/1001-00000011”, “user-callerid,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/1001-00000011”, “TOUCH_MONITOR=1510891598.17”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/1001-00000011”, “AMPUSER=1001”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/1001-00000011”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/1001-00000011”, “1?Set(REALCALLERIDNUM=1001)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/1001-00000011”, “AMPUSER=1001”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/1001-00000011”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/1001-00000011”, “AMPUSERCIDNAME=USER NAME”) in new stack
– Executing [s@macro-user-callerid:8] ExecIf(“SIP/1001-00000011”, “1?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [s@macro-user-callerid:9] GotoIf(“SIP/1001-00000011”, “0?report”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/1001-00000011”, “AMPUSERCID=XXXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:11] Set(“SIP/1001-00000011”, “__DIAL_OPTIONS=HhTtr”) in new stack
– Executing [s@macro-user-callerid:12] Set(“SIP/1001-00000011”, "CALLERID(all)=“USER NAME” ") in new stack
– Executing [s@macro-user-callerid:13] GotoIf(“SIP/1001-00000011”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“SIP/1001-00000011”, “0?Set(GROUP(concurrency_limit)=1001)”) in new stack
– Executing [s@macro-user-callerid:15] ExecIf(“SIP/1001-00000011”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:16] NoOp(“SIP/1001-00000011”, “Macro Depth is 1”) in new stack
– Executing [s@macro-user-callerid:17] GotoIf(“SIP/1001-00000011”, “1?report2:macroerror”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] GotoIf(“SIP/1001-00000011”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:20] Set(“SIP/1001-00000011”, “__TTL=64”) in new stack
– Executing [s@macro-user-callerid:21] GotoIf(“SIP/1001-00000011”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,37)
– Executing [s@macro-user-callerid:37] Set(“SIP/1001-00000011”, “CALLERID(number)=XXXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:38] Set(“SIP/1001-00000011”, “CALLERID(name)=USER NAME”) in new stack
– Executing [s@macro-user-callerid:39] GotoIf(“SIP/1001-00000011”, “0?cnum”) in new stack
– Executing [s@macro-user-callerid:40] Set(“SIP/1001-00000011”, “CDR(cnam)=USER NAME”) in new stack
– Executing [s@macro-user-callerid:41] Set(“SIP/1001-00000011”, “CDR(cnum)=XXXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:42] Set(“SIP/1001-00000011”, “CHANNEL(language)=en”) in new stack
– Executing [*43@from-internal:6] Wait(“SIP/1001-00000011”, “1”) in new stack
– Executing [*43@from-internal:7] BackGround(“SIP/1001-00000011”, “demo-echotest,app-echo-test-echo”) in new stack
– <SIP/1001-00000011> Playing ‘demo-echotest.g722’ (language ‘en’)
Really destroying SIP dialog ‘148113_rel61MDBjOThmMjI4ODNkZWU3ZGNiZGViYTBkOGRjOWE0NDI’ Method: REGISTER

I’ve tried with NAT set to yes and then no at the extensions level as well as tried with rPort turned on and off at the endpoint itself. Turned firewall off completely as well.

Is this with the binding address set to :: or a full IP?

Bind address set to ::

Just curious, you didn’t put anything in the External Address field (in Asterisk SIP Settings) right? It looks like asterisk is trying to resolve the IPv6 address into something else.

Just the IPv4 address appears in external settings. Although, I’ve added the local IPv6 prefix to local networks because it wasn’t detected.

I wouldn’t… there’s no IPv6 NAT thus no need to define the local networks.

I’ve removed the IPv6 prefix from locals networks. I’ve also explicitly bound asterisk to a global IPv6 address on port 5061. I did this directly on the chan_sip section of the GUI without adding it as an extra option. Still no go.

Sorry, I’m out of ideas at this point. There must be something different about the distro and my manually-built FreePBX 13 box. I reviewed my settings and am certain there was nothing more I needed to do other than the few settings I mentioned above.

Any help from distro users?

Thanks for all of your help @billsimon . Just out of curiosity, what is your base OS?

Debian 8

That’s interesting. There must be something funky with the network stack in CentOS 7. I have a number of servers running Ubuntu and Windows and i don’t have any issues with processes binding to IPv6 addresses/ports.

The nice thing about Debian based Linux is that you can simply add keyword such as DHCP, or static, or auto and then everything is taken care of.

Can we get some comments from a Sangima dev about IPv6 on the distro?

It seems the installer does many things IPv4/V6 related during the setup process.

If it can’t find an IPv4 DHCP server it defaults to IPv6. But then, it doesn’t properly respond to a DHCPv6 server.

If the installer detects IPv4 connectivity, it attempts DHCPv6 during the install but then reverts to IPv4 only.

???

Anyone at sangoma have a chance to look at this?

Maybe with a setup that uses DHCPv6 vs. stateless autoconfig?

@xrobau

When you generically ask “can we get Sangoma dev to look at this” you can’t be sure anyone has looked at this thread at all.

I propose you try a manual setup on a plain CentOS 7. If you still have issues then that would unfortunately be an issue with CentOS 7

I realize it may be an issue with Centos 7. But it is the base OS Sangoma has chose to build their Distro off of.

Users in this thread have reported chan_sip working with IPv6 in Ubuntu.

Surely you must be able to confirm on one of your instances (bare metal or VM) internally?

I propose your try that while I try setting up asterisk on CentOS 7.