IPv6 Transport Results In ICE With Only IPv6 Candidates

Home » Asterisk Users » IPv6 Transport Results In ICE With Only IPv6 Candidates
Asterisk Users 3 Comments

Hi,

I’m using Asterisk 13.x and have defined a pjsip TCP IPv6 transport:

[transport-tcp-ipv6]
type=transport protocol=tcp bind=[2001:1234:5678:abcd::2]:5060

I also have an IPv4 version of that:

[transport-tcp-ipv4]
type=transport protocol=tcp bind=10.75.22.8:5060

I’ve then configured an endpoint to use it:

[outgoing]
type = endpoint context = default dtmf_mode = none disallow = all allow = all rtp_symmetric = yes force_rport = yes rewrite_contact = yes direct_media = no language = en aors = outgoing t38_udptl = yes t38_udptl_ec = none ice_support=yes transport=transport-tcp-ipv6

But this seems to result in SDP payloads with ICE not offering any IPv4
candidates:

v=0
o=- 508048280 508048280 IN IP6 2001:1234:5678:abcd::2
s=Asterisk c=IN IP6 2001:1234:5678:abcd::2
t=0 0
m=audio 14384 RTP/AVP 4 0 8 3 111 112 5 10 118 7 18 110 117 119 97 9 102 115 116 107
a=ice-ufrag:6eea7b135aa990d714a67931034ac864
a=ice-pwd:0494fccd28b93f8a2b544b4741203e4f a=candidate:H67c355d6 1 UDP 2130706431 fd31:aeb1:48df::2 14384 typ host a=candidate:Hc1e19c54 1 UDP 2130706431 2607:abcd:9876:5432::247 14384 typ host a=candidate:Hf5a91683 1 UDP 2130706431 2001:1234:5678:abcd::2 14384 typ host a=candidate:Hdccea0f2 1 UDP 2130706431 2001:123:ab:123::2 14384 typ host a=candidate:Hcbb5ed22 1 UDP 2130706431 fe80::21f:c6ff:fec4:926a 14384 typ host a=candidate:H67c355d6 2 UDP 2130706430 fd31:aeb1:48df::2 14385 typ host a=candidate:Hc1e19c54 2 UDP 2130706430 2607:abcd:9876:5432::247 14385 typ host a=candidate:Hf5a91683 2 UDP 2130706430 2001:1234:5678:abcd::2 14385 typ host a=candidate:Hdccea0f2 2 UDP 2130706430 2001:123:ab:123::2 14385 typ host a=candidate:Hcbb5ed22 2 UDP 2130706430 fe80::21f:c6ff:fec4:926a 14385 typ host a=rtpmap:4 G723/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:112 AAL2-G726-32/8000
a=rtpmap:5 DVI4/8000
a=rtpmap:10 L16/8000
a=rtpmap:118 L16/16000
a=rtpmap:7 LPC/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no a=rtpmap:110 speex/8000
a=rtpmap:117 speex/16000
a=rtpmap:119 speex/32000
a=rtpmap:97 iLBC/8000
a=rtpmap:9 G722/8000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:116 G719/48000
a=rtpmap:107 opus/48000/2
a=ptime:20
a=maxptime:20
a=sendrecv m=video 11188 RTP/AVP 31 34 103 99 104 100 108
a=ice-ufrag:28e29ae16a4cc8d54ebf03cf56010f1a a=ice-pwd:57ec01cf24ac689d2fb459bd0411d2b6
a=candidate:H67c355d6 1 UDP 2130706431 fd31:aeb1:48df::2 11188 typ host a=candidate:Hc1e19c54 1 UDP 2130706431 2607:abcd:9876:5432::247 11188 typ host a=candidate:Hf5a91683 1 UDP 2130706431 2001:1234:5678:abcd::2 11188 typ host a=candidate:Hdccea0f2 1 UDP 2130706431 2001:123:ab:123::2 11188 typ host a=candidate:Hcbb5ed22 1 UDP 2130706431 fe80::21f:c6ff:fec4:926a 11188 typ host a=candidate:H67c355d6 2 UDP 2130706430 fd31:aeb1:48df::2 11189 typ host a=candidate:Hc1e19c54 2 UDP 2130706430 2607:abcd:9876:5432::247 11189 typ host a=candidate:Hf5a91683 2 UDP 2130706430 2001:1234:5678:abcd::2 11189 typ host a=candidate:Hdccea0f2 2 UDP 2130706430 2001:123:ab:123::2 11189 typ host a=candidate:Hcbb5ed22 2 UDP 2130706430 fe80::21f:c6ff:fec4:926a 11189 typ host a=rtpmap:31 H261/90000
a=rtpmap:34 H263/90000
a=rtpmap:103 h263-1998/90000
a=rtpmap:99 H264/90000
a=rtpmap:104 MP4V-ES/90000
a=rtpmap:100 VP8/90000
a=rtpmap:108 VP9/90000
a=sendrecv

But other endpoints where I don’t specify a transport, I get both IPv4
and IPv6 candidates in the ICE SDP.

Presumably the problem with the [outgoing] endpoint is the specification of an IPv6-TCP transport. But I need to force the use of TCP, so how can I do that without limiting it to a particular IP
protocol?

I can’t seem to define a generic TCP transport:

[transport-tcp]
type=transport protocol=tcp

in addition to the ones I have already defined above but I do need to define the IPv4 and IPv6 transports as I need to bind them to specific addresses.

Any ideas?

Cheers, b.

3 thoughts on - IPv6 Transport Results In ICE With Only IPv6 Candidates

  • Hrm. This is probably going to be pretty basic, but some googling didn’t seem to come up with anything. How do you do this when you are assigning to a variable in extensions.conf such as:

    FRED=PJSIP/outgoing/sip:fred@sip.example.com;transport=tcp

    The ; is taken as a comment starting character, isn’t it?

    Even in AEL:

    FRED=”PJSIP/outgoing/sip:fred@sip.example.com;transport=tcp”;

    The ;transport=tcp doesn’t seem to survive.

    I can add it onto the end of the variable in the Dial() command:

    Dial(${FRED};transport=tcp,${timeout},TtWw);

    and it has the desired effect, but of course specifying at the point where the Dial command is sets the transport policy much too broadly.

    Cheers, b.

  • [ the part you trimmed ]:

    and it has the desired effect, but of course specifying at the point where the Dial command is sets the transport policy much too broadly.

    So per the above (“has the desired effect”) one doesn’t even have to escape the ; in the Dial() command.

    But I don’t want the “;transport=tcp” hard-coded into the Dial()
    command argument where the Dial() command is executed. That is making a transport policy (i.e. not every destination that gets to that Dial()
    command should use tcp) decision for far too many destinations.

    The “;transport=tcp” needs to be added where the destination is defined into a variable:

    FRED=PJSIP/outgoing/sip:fred@sip.example.com;transport=tcp

    in extensions.conf or:

    FRED=”PJSIP/outgoing/sip:fred@sip.example.com;transport=tcp”;

    in extensions.ael.

    Cheers, b.

  • How very odd. It is working now. I am sure I did nothing different than the first time.

    Cheers, b.