I’m pretty sure some people are rolling their eyes on seeing this post… but i just cant seem to come right here. I have now read loads of articles dating back 3 or 4 years with the same issue - so it makes it difficult to debug since all the articles are so old.
Scenario:
- I’m NOT repeat, NOT using WebRTC over the general Internet at all - this is 100% LAN based, in fact internet may be disabled in some cases.
- I’m trying to use SipJS. (have tried 0.8X 0.11.X and 0.12.X)
- I’m using Asterisk 13 (tried 13.21-certified and 13.24.1)
- I’m NOT using PJSIP (im unlikely to change this)
- I have uuid / uuid-dev installed
- I have stunaddr:19302=stun.l.google.com set in rtp.conf
No matter what, I still get the same result
Setup:
[Browser User A] <= {LOCAL LAN} => https://[Asterisk]:443/ws <= {LOCAL LAN} => [Browser User A]
What’s working:
- WebRTC: WSS, Register, Chat, Subscribe/Presence
- SIP: Everything: TLS/TCP/UDP, Register, Audio calls, Video calls, Chat, Subscribe/Presence
Problem:
- When establishing a call, SipJS / GoogleChrome errors with:
DOMException: Failed to execute ‘setRemoteDescription’ on ‘RTCPeerConnection’: Failed to set remote answer sdp: Called with SDP without ice-ufrag and ice-pwd.
- If i take a look at the reply SDP, its clear it doesn’t:
SIP/2.0 200 OK
Via: SIP/2.0/WSS 6fh6cl3ics0h.invalid;branch=z9hG4bK4550538;received=192.168.88.88
From: "User A" <sip:webrtc@192.168.88.98>;tag=2vaifpjnv4
To: <sip:*1@192.168.88.98>;tag=as1b451b6a
Call-ID: gni6fkcsdefl0ibeqc9r
CSeq: 277 INVITE
Server: Asterisk BPX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:*1@192.168.88.98:5060;transport=ws>
Content-Type: application/sdp
Content-Length: 723
v=0
o=root 1408129947 1408129947 IN IP4 192.168.88.98
s=Asterisk PBX 13.24.1
c=IN IP4 192.168.88.98
b=CT:5000
t=0 0
m=audio 16684 RTP/SAVPF 111 0 8 126
a=rtpmap:111 opus/48000/2
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=maxptime:60
a=connection:new
a=setup:active
a=fingerprint:SHA-256 01:AF:2E:AD:BD:53:20:3C:BC:EF:3A:E6:A0:CB:8A:90:CC:E6:38:1F:2D:51:35:3C:76:42:C3:5F:11:64:4E:C9
a=rtcp-mux
a=sendrecv
m=video 15838 RTP/SAVPF 96
a=connection:new
a=setup:active
a=fingerprint:SHA-256 01:AF:2E:AD:BD:53:20:3C:BC:EF:3A:E6:A0:CB:8A:90:CC:E6:38:1F:2D:51:35:3C:76:42:C3:5F:11:64:4E:C9
a=rtpmap:96 VP8/90000
a=rtcp-fb:* ccm fir
a=rtcp-mux
a=sendrecv
- You can see that the origional INVITE had the ICE candidates (and yes it offered the wrong/live IP)
INVITE sip:*1@192.168.88.98 SIP/2.0
Via: SIP/2.0/WSS 6fh6cl3ics0h.invalid;branch=z9hG4bK82330
Max-Forwards: 70
To: <sip:*1@192.168.88.98>
From: "User A" <sip:webrtc@192.168.88.98>;tag=2vaifpjnv4
Call-ID: gni6fkcsdefl0ibeqc9r
CSeq: 276 INVITE
Contact: <sip:svv74auo@6fh6cl3ics0h.invalid;transport=wss;ob>
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound
User-Agent: SIPjs via WebRTC
Content-Type: application/sdp
Content-Length: 6318
v=0
o=- 4588150804381803861 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS z5p3sME8D09gDGuCL3PrqBgYBuJ3K2cEXCD1
m=audio 51124 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 155.93.188.227
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2946509287 1 udp 2122260223 192.168.88.88 51124 typ host generation 0 network-id 2
a=candidate:4156766641 1 udp 2122194687 192.168.88.87 63032 typ host generation 0 network-id 1 network-cost 10
a=candidate:3777221911 1 tcp 1518280447 192.168.88.88 9 typ host tcptype active generation 0 network-id 2
a=candidate:3108029761 1 tcp 1518214911 192.168.88.87 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=candidate:786968403 1 udp 1686052607 155.93.188.227 51124 typ srflx raddr 192.168.88.88 rport 51124 generation 0 network-id 2
a=candidate:1988837125 1 udp 1685987071 155.93.188.227 63032 typ srflx raddr 192.168.88.87 rport 63032 generation 0 network-id 1 network-cost 10
a=ice-ufrag:6fX6
a=ice-pwd:ETNNNbDhRknxadu52C3ozD++
a=ice-options:trickle
a=fingerprint:sha-256 73:DF:11:8C:3B:87:1B:9E:FB:68:31:64:43:AF:2E:8A:2B:1D:38:9E:4A:99:3A:CD:E6:B9:87:EF:19:DB:B3:C3
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
.............
More codec descriptors here...
- If I debug the INVITE, it clearly ready the ICE information but says it unsupported or fail:
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=candidate:2946509287 1 udp 2122260223 192.168.88.88 51124 typ host generation 0 network-id 2... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=candidate:4156766641 1 udp 2122194687 192.168.88.87 63032 typ host generation 0 network-id 1 network-cost 10... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=candidate:3777221911 1 tcp 1518280447 192.168.88.88 9 typ host tcptype active generation 0 network-id 2... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=candidate:3108029761 1 tcp 1518214911 192.168.88.87 9 typ host tcptype active generation 0 network-id 1 network-cost 10... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=candidate:786968403 1 udp 1686052607 155.93.188.227 51124 typ srflx raddr 192.168.88.88 rport 51124 generation 0 network-id 2... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=candidate:1988837125 1 udp 1685987071 155.93.188.227 63032 typ srflx raddr 192.168.88.87 rport 63032 generation 0 network-id 1 network-cost 10... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=ice-ufrag:6fX6... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=ice-pwd:ETNNNbDhRknxadu52C3ozD++... UNSUPPORTED OR FAILED.
chan_sip.c:10799 process_sdp: Processing media-level (audio) SDP a=ice-options:trickle... UNSUPPORTED OR FAILED.
Any Ideas??
Closing thoughts… A few years ago, i had a working solution (not sure of the versions etc) and don’t remember it being so difficult. I’m not sure if this is a SIPJS issue or an Asterisk issue. If SIPJS offered the correct (local) IP address, then media would work, and it should not close the call. (SIPJS is sending a BYE in reaction to the failed SDP). Then again… why wouldn’t Asterisk just respond with the ice-ufrag and ice-pwd???