ICE not working on Asterisk 18.8.0

Hi All.

Recently I am working on upgrading our system from Asterisk 15.2.2 to 18.8.0 and I realize the ICE is no longer working. I hope anyone can kindly give me some directions so that I can fix the issue.

We are using CentOS 8.5, Asterisk 18, PJSIP (chan_sip disabled).

This system is use as a WebRTC endpoint which connecting our web client to Asterisk. It is working (using Asterisk 15.2.2) for couple years without problem, but after upgraded to 18.8.0, when the web client tried to connect, it return the error (from chrome console):

RTC Connection - SetRemoteDescription (SDP) Error: (InvalidAccessError: Failed to execute ‘setRemoteDescription’ on ‘RTCPeerConnection’: Failed to set remote answer sdp: Called with SDP without ice-ufrag and ice-pwd.)

When I check the with the SIP response from Asterisk, the SDP message ICE attribute are missing (no ice-ufrag / ice-pwd / candidates exist). I uses the exact Asterisk config when in Asterisk 15.

In pjsip.conf:

[clientaccess]
type=endpoint
aors=client_aor
auth=client_auth
use_avpf=yes
media_encryption=dtls
dtls_ca_file=/etc/pki/tls/certs/ca_bundle.crt
dtls_cert_file=/etc/pki/tls/certs/sslcert.pem
dtls_verify=fingerprint
dtls_setup=passive
ice_support=yes
media_use_received_transport=yes
rtcp_mux=yes
context=default
rtp_timeout_hold=300
rtp_timeout=60
rtp_keepalive=20
disallow=all
allow=ulaw
allow=h264

in rtp.conf

[general]
rtpstart=10000
rtpend=20000
icesupport=true

I don’t even know is the current Asterisk 18 has ice support or not, but when I do “pjsip show endpoint clientaccess” in cli, it does give me the “ice_support : true”. I am not sure is it proves the current system has ICE support or not.

The system has libuuid and libuuid-devel installed, and if I use the same system to recompile back to Asterisk 15, everything works just fine again.

I read online talks about when compile with PJSIP bundle, it should automatically enable ICE, When compile, I use:
./configure --with-externals-cache=/usr/src/instcache --with-jansson-bundled --with-pjproject-bundled;
make; make install;

But just won’t work. I am quite hopeless here.

Enabled debugging doesn’t show anything un-normal, no message showing anything about ICE.

If anyone could give me something, it will be a great help.

Thanks very much in advance.

Have you tried shutting off direct media with:
direct_media=no

1 Like

Thanks for reply. I tried, but no change. Same thing happen.

You’d need to provide the SIP trace.

Thanks for reply.

I have attached the SIP Trace from Asterisk.

Once Asterisk response the first SDP with on ICE info, the client side WebRTC then response the set remote SDP fail (with no ICE info) and stop the connection.

tester-web1*CLI> 
  == WebSocket connection from '66.12.84.199:59521' for protocol 'sip' accepted using version '13'
<--- Received SIP request (2269 bytes) from WSS:66.12.84.199:59521 --->
INVITE sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain SIP/2.0
Via: SIP/2.0/WSS 66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ20;rport
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain
CSeq: 20 INVITE
Call-ID: 29p3k164018383121119800LTKhdQ
Max-Forwards: 70
Contact: <sip:WebPhone@66.12.84.199;transport=WSS>
User-Agent: Web-SipPhone/1.0.0
Supported: outbound
Allow: INVITE, ACK, CANCEL, BYE, INFO
Content-Type: application/sdp
Content-Length: 1646

v=0
o=- 4469777513285318940 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:pwLG
a=ice-pwd:5TXuaOWk10pu2NQzjeL87lFS
a=ice-options:trickle
a=fingerprint:sha-256 B0:48:A2:87:9E:8E:D2:79:3C:6E:04:FB:23:CC:71:B6:04:AE:10:FB:B5:E1:30:B7:A7:90:08:09:5C:21:32:1D
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP 5aa8e9e5-b7c1-4029-ade3-d228467bc6cb
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:3139803484 cname:zkmomKwSUxgZrfYL
a=ssrc:3139803484 msid:aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP 5aa8e9e5-b7c1-4029-ade3-d228467bc6cb
a=ssrc:3139803484 mslabel:aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP
a=ssrc:3139803484 label:5aa8e9e5-b7c1-4029-ade3-d228467bc6cb


<--- Transmitting SIP response (618 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ20
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ20
CSeq: 20 INVITE
WWW-Authenticate: Digest realm="tester-web1.localdomain",nonce="1640183832/74d9d3660d9f1f9693dee9ff331d55ba",opaque="4dbac2d87b3608b6",algorithm=md5,qop="auth"
Server: TESTING PBX
Content-Length:  0


<--- Received SIP request (538 bytes) from WSS:66.12.84.199:59521 --->
ACK sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain SIP/2.0
Via: SIP/2.0/WSS 66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ20;rport
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ20
CSeq: 20 ACK
Call-ID: 29p3k164018383121119800LTKhdQ
Max-Forwards: 70
Contact: <sip:WebPhone@66.12.84.199;transport=WSS>
Content-Length: 0


<--- Received SIP request (2647 bytes) from WSS:66.12.84.199:59521 --->
INVITE sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain SIP/2.0
Via: SIP/2.0/WSS 66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21;rport
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain
CSeq: 21 INVITE
Call-ID: 29p3k164018383121119800LTKhdQ
Max-Forwards: 70
Contact: <sip:WebPhone@66.12.84.199;transport=WSS>
User-Agent: Web-SipPhone/1.0.0
Authorization: Digest username="tester-uname",realm="tester-web1.localdomain",nonce="1640183832/74d9d3660d9f1f9693dee9ff331d55ba",uri="sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain",response="adcd57d8bc26d61b7411efc829649594",qop="auth",cnonce="29164018383214843900/6F71B79654365EC867D41A75B136925C",nc="1",algorithm=md5,opaque="4dbac2d87b3608b6"
Supported: outbound
Allow: INVITE, ACK, CANCEL, BYE, INFO
Content-Type: application/sdp
Content-Length: 1646

v=0
o=- 4469777513285318940 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:pwLG
a=ice-pwd:5TXuaOWk10pu2NQzjeL87lFS
a=ice-options:trickle
a=fingerprint:sha-256 B0:48:A2:87:9E:8E:D2:79:3C:6E:04:FB:23:CC:71:B6:04:AE:10:FB:B5:E1:30:B7:A7:90:08:09:5C:21:32:1D
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP 5aa8e9e5-b7c1-4029-ade3-d228467bc6cb
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:3139803484 cname:zkmomKwSUxgZrfYL
a=ssrc:3139803484 msid:aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP 5aa8e9e5-b7c1-4029-ade3-d228467bc6cb
a=ssrc:3139803484 mslabel:aF55PdkyN51tOzuxR3zXtQHuBfNo8sU4sFcP
a=ssrc:3139803484 label:5aa8e9e5-b7c1-4029-ade3-d228467bc6cb


<--- Transmitting SIP response (404 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 100 Trying
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>
CSeq: 21 INVITE
Server: TESTING PBX
Content-Length:  0


    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:1] NoOp("PJSIP/clientaccess-00000000", ""Entered WebRTC VSR Proxy"") in new stack
    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:2] Set("PJSIP/clientaccess-00000000", "CALLCODE=29p3k164018383121119800LTKhdQ.1") in new stack
    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:3] Set("PJSIP/clientaccess-00000000", "IPADDR=192.168.1.204") in new stack
    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:4] Answer("PJSIP/clientaccess-00000000", "") in new stack
       > 0x7f1afc020ce0 -- Strict RTP learning after remote address set to: 0.0.0.0:9
<--- Transmitting SIP response (1091 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=14d42e75-4f6e-47fd-9429-4c263374cf7d
CSeq: 21 INVITE
Server: TESTING PBX
Contact: <sip:24.1.2.3:3366;transport=ws>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   408

v=0
o=- 1751546140 4 IN IP4 24.1.2.3
s=Asterisk
c=IN IP4 24.1.2.3
t=0 0
m=audio 17438 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:passive
a=fingerprint:SHA-256 AA:B4:B4:26:3F:F5:F3:EA:A2:FF:BD:13:5E:10:67:81:B9:10:CF:A3:18:33:01:DC:CA:58:A4:13:BF:F7:10:15
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=recvonly
a=rtcp-mux

<--- Transmitting SIP response (1091 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=14d42e75-4f6e-47fd-9429-4c263374cf7d
CSeq: 21 INVITE
Server: TESTING PBX
Contact: <sip:24.1.2.3:3366;transport=ws>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   408

v=0
o=- 1751546140 4 IN IP4 24.1.2.3
s=Asterisk
c=IN IP4 24.1.2.3
t=0 0
m=audio 17438 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:passive
a=fingerprint:SHA-256 AA:B4:B4:26:3F:F5:F3:EA:A2:FF:BD:13:5E:10:67:81:B9:10:CF:A3:18:33:01:DC:CA:58:A4:13:BF:F7:10:15
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=recvonly
a=rtcp-mux

    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:5] GotoIf("PJSIP/clientaccess-00000000", "0?2HANGUP,29p3k164018383121119800LTKhdQ.1+192.168.1.204,1") in new stack
    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:6] GotoIf("PJSIP/clientaccess-00000000", "0?2HANGUP,29p3k164018383121119800LTKhdQ.1+192.168.1.204,1") in new stack
    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:7] Dial("PJSIP/clientaccess-00000000", "PJSIP/Hangup_Endpoint/sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204:5060") in new stack
    -- Called PJSIP/Hangup_Endpoint/sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204:5060
    -- Call on PJSIP/Hangup_Endpoint-00000001 placed on hold
    -- Music class default requested but no musiconhold loaded.
<--- Transmitting SIP request (955 bytes) to UDP:192.168.1.204:5060 --->
INVITE sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.215:5060;rport;branch=z9hG4bKPja362c60e-87c0-400f-898c-594a69d6c0b3
From: <sip:clientaccess@24.1.2.3>;tag=f3d56f71-9912-464d-967a-69145fe0c37d
To: <sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204>
Contact: <sip:Web@192.168.1.215:5060>
Call-ID: bc3674a8-3062-4c24-8a64-dd651d521802
CSeq: 12188 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: TESTING PBX
Content-Type: application/sdp
Content-Length:   239

v=0
o=- 1651714549 1651714549 IN IP4 192.168.1.215
s=Asterisk
c=IN IP4 192.168.1.215
t=0 0
m=audio 12464 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP response (550 bytes) from UDP:192.168.1.204:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.215:5060;branch=z9hG4bKPja362c60e-87c0-400f-898c-594a69d6c0b3;received=192.168.1.215;rport=5060
From: <sip:clientaccess@24.1.2.3>;tag=f3d56f71-9912-464d-967a-69145fe0c37d
To: <sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204>
Call-ID: bc3674a8-3062-4c24-8a64-dd651d521802
CSeq: 12188 INVITE
User-Agent: TESTING PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Contact: <sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204>
Content-Length: 0


<--- Received SIP response (505 bytes) from UDP:192.168.1.204:5060 --->
SIP/2.0 603 Declined
Via: SIP/2.0/UDP 192.168.1.215:5060;branch=z9hG4bKPja362c60e-87c0-400f-898c-594a69d6c0b3;received=192.168.1.215;rport=5060
From: <sip:clientaccess@24.1.2.3>;tag=f3d56f71-9912-464d-967a-69145fe0c37d
To: <sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204>;tag=as6de7065c
Call-ID: bc3674a8-3062-4c24-8a64-dd651d521802
CSeq: 12188 INVITE
User-Agent: TESTING PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0


<--- Transmitting SIP request (444 bytes) to UDP:192.168.1.204:5060 --->
ACK sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.215:5060;rport;branch=z9hG4bKPja362c60e-87c0-400f-898c-594a69d6c0b3
From: <sip:clientaccess@24.1.2.3>;tag=f3d56f71-9912-464d-967a-69145fe0c37d
To: <sip:29p3k164018383121119800LTKhdQ.1@192.168.1.204>;tag=as6de7065c
Call-ID: bc3674a8-3062-4c24-8a64-dd651d521802
CSeq: 12188 ACK
Max-Forwards: 70
User-Agent: TESTING PBX
Content-Length:  0


  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [29p3k164018383121119800LTKhdQ.1+192.168.1.204@2VSRPROXY:8] Congestion("PJSIP/clientaccess-00000000", "10") in new stack
<--- Transmitting SIP response (1091 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=14d42e75-4f6e-47fd-9429-4c263374cf7d
CSeq: 21 INVITE
Server: TESTING PBX
Contact: <sip:24.1.2.3:3366;transport=ws>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   408

v=0
o=- 1751546140 4 IN IP4 24.1.2.3
s=Asterisk
c=IN IP4 24.1.2.3
t=0 0
m=audio 17438 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:passive
a=fingerprint:SHA-256 AA:B4:B4:26:3F:F5:F3:EA:A2:FF:BD:13:5E:10:67:81:B9:10:CF:A3:18:33:01:DC:CA:58:A4:13:BF:F7:10:15
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=recvonly
a=rtcp-mux

<--- Transmitting SIP response (1091 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=14d42e75-4f6e-47fd-9429-4c263374cf7d
CSeq: 21 INVITE
Server: TESTING PBX
Contact: <sip:24.1.2.3:3366;transport=ws>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   408

v=0
o=- 1751546140 4 IN IP4 24.1.2.3
s=Asterisk
c=IN IP4 24.1.2.3
t=0 0
m=audio 17438 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:passive
a=fingerprint:SHA-256 AA:B4:B4:26:3F:F5:F3:EA:A2:FF:BD:13:5E:10:67:81:B9:10:CF:A3:18:33:01:DC:CA:58:A4:13:BF:F7:10:15
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=recvonly
a=rtcp-mux

<--- Transmitting SIP response (1091 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=14d42e75-4f6e-47fd-9429-4c263374cf7d
CSeq: 21 INVITE
Server: TESTING PBX
Contact: <sip:24.1.2.3:3366;transport=ws>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   408

v=0
o=- 1751546140 4 IN IP4 24.1.2.3
s=Asterisk
c=IN IP4 24.1.2.3
t=0 0
m=audio 17438 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:passive
a=fingerprint:SHA-256 AA:B4:B4:26:3F:F5:F3:EA:A2:FF:BD:13:5E:10:67:81:B9:10:CF:A3:18:33:01:DC:CA:58:A4:13:BF:F7:10:15
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=recvonly
a=rtcp-mux

  == Spawn extension (2VSRPROXY, 29p3k164018383121119800LTKhdQ.1+192.168.1.204, 8) exited non-zero on 'PJSIP/clientaccess-00000000'
    -- Executing [h@2VSRPROXY:1] Hangup("PJSIP/clientaccess-00000000", "") in new stack
  == Spawn extension (2VSRPROXY, h, 1) exited non-zero on 'PJSIP/clientaccess-00000000'
<--- Transmitting SIP response (1091 bytes) to WSS:66.12.84.199:59521 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS 66.12.84.199;rport=59521;received=66.12.84.199;branch=z9hG4bK.Hu1bK29p3k164018383121119800LTKhdQ21
Call-ID: 29p3k164018383121119800LTKhdQ
From: <sip:clientaccess@tester-web1.localdomain>;tag=jMC29p3k164018383121119800LTKhdQbgb1GB
To: <sip:29p3k164018383121119800LTKhdQ.1+192.168.1.204@tester-web1.localdomain>;tag=14d42e75-4f6e-47fd-9429-4c263374cf7d
CSeq: 21 INVITE
Server: TESTING PBX
Contact: <sip:24.1.2.3:3366;transport=ws>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   408

v=0
o=- 1751546140 4 IN IP4 24.1.2.3
s=Asterisk
c=IN IP4 24.1.2.3
t=0 0
m=audio 17438 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:passive
a=fingerprint:SHA-256 AA:B4:B4:26:3F:F5:F3:EA:A2:FF:BD:13:5E:10:67:81:B9:10:CF:A3:18:33:01:DC:CA:58:A4:13:BF:F7:10:15
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=recvonly
a=rtcp-mux

[Dec 22 09:37:23] WARNING[721649]: pjproject: <?>: 	     tsx0x7f1afc01cb08 .Error sending Response msg 200/INVITE/cseq=21 (tdta0x7f1afc03c348): Unknown Error (PJ_EUNKNOWN)
  == WebSocket connection from '66.12.84.199:59521' closed
tester-web1*CLI> 
type or paste code here

The reason is due to the fact that there are no ICE candidates[1]. A change[2] went in which disabled ICE if no ICE candidates are present, presumably because it thought that without ICE candidates there is no need to do it. I don’t know which is technically correct.

[1] asterisk/res_pjsip_sdp_rtp.c at master ¡ asterisk/asterisk ¡ GitHub
[2] [ASTERISK-27957] PJSIP proposes ICE candidates on answer even if not in offer - Digium/Asterisk JIRA

So is there a way I can manually add ice candidate? There are 2 interface in the asterisk, one is public IP which allow WebRTC Client to direct access it. Previously, it is being use as the ice candidate (in the client side code, we manually filter out all internal IP address so that even the Asterisk 15 also provide private IP address as candidate, it will never be use.

But now, I don’t see a place I can manually add ice candidate. I tried stunaddr option in rtp.conf, but it doesn’t work.

No, you can’t do such a thing without modifying the code to remove what was added in the linked issue.

Understood, thanks for your help.

Sorry, I tried to put the following:

rtp.conf:
stunaddr:19302=stun.l.google.com

But still got the same result. The google stun server should provide the ICE candidate for the Asterisk and shouldn’t it add into the SDP?

I also try to add a dummy address into stunaddr and it gives me an error (create a number of timeout at the time to generate the SDP, and eventually give up). So that means it actually performing the work, but why ICE candidate not showing?

Thanks very much again for your help.

No. There are no ICE candidates from the WebRTC client, thus the code doesn’t add any ICE candidates on the Asterisk side to the answer because it doesn’t think ICE is in use. Configuration in Asterisk won’t change this.

1 Like

Oh, I misunderstand. I will give it a try.

Thanks.

Hi Jcolp, after I added the ICE candidate into the INVITE, it works now.

Thanks for your help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.