Dodekeract Dodekeract - 1 month ago 11
Javascript Question

WebRTC ondatachannel not triggered

I have a

RTCPeerConnection
, which is properly established and can forward video and audio.

The thing is - this connection should also have a RTCDataChannel, created by the server (jitsi-videobridge).




Here's the incoming SDP:

v=0
o=- 52c2f31d2e997e86 2 IN IP4 127.0.0.1
s=-
t=0 0
a=x-attach-conference-id:52c2f31d2e997e86
a=x-attach-new-participant-flag
a=group:BUNDLE audio video data
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 127 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:1 1 ssltcp 2130706431 192.168.0.5 4443 typ host generation 0
a=candidate:2 1 ssltcp 2130706431 2001:0:5ef5:79fb:309f:3941:bb9f:8a46 4443 typ host generation 0
a=candidate:4 1 udp 2113939711 2001:0:5ef5:79fb:309f:3941:bb9f:8a46 10000 typ host generation 0
a=candidate:3 1 udp 2113932031 192.168.0.5 10000 typ host generation 0
a=ice-ufrag:54ku71b09j1sc9
a=ice-pwd:6aajbrmegkmgl6g9aoc1p14m50
a=fingerprint:sha-1 DF:09:D9:FD:E0:D8:03:71:90:B4:CA:E9:A7:2E:FE:07:A2:B3:F8:4B
a=setup:actpass
a=mid:audio
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:127 red/8000
a=rtpmap:126 telephone-event/8000
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=x-attach-channel-id:90780b7ef750e3f0
a=ssrc:3478236559 cname:mcu
a=ssrc:3478236559 msid:mcu mcu-audio0
a=ssrc:3478236559 mslabel:mcu
a=ssrc:3478236559 label:mcu-audio0
m=video 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:1 1 ssltcp 2130706431 192.168.0.5 4443 typ host generation 0
a=candidate:2 1 ssltcp 2130706431 2001:0:5ef5:79fb:309f:3941:bb9f:8a46 4443 typ host generation 0
a=candidate:4 1 udp 2113939711 2001:0:5ef5:79fb:309f:3941:bb9f:8a46 10000 typ host generation 0
a=candidate:3 1 udp 2113932031 192.168.0.5 10000 typ host generation 0
a=ice-ufrag:54ku71b09j1sc9
a=ice-pwd:6aajbrmegkmgl6g9aoc1p14m50
a=fingerprint:sha-1 DF:09:D9:FD:E0:D8:03:71:90:B4:CA:E9:A7:2E:FE:07:A2:B3:F8:4B
a=setup:actpass
a=mid:video
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=fmtp:100 x-google-start-bitrate=550
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=x-google-flag:conference
a=imageattr:* recv [x=640,y=480] [x=160,y=120]
a=x-attach-channel-id:48fbbaf7ca9b1ed0
a=ssrc:4166867687 cname:mcu
a=ssrc:4166867687 msid:mcu mcu-video0
a=ssrc:4166867687 mslabel:mcu
a=ssrc:4166867687 label:mcu-video0
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=candidate:1 1 ssltcp 2130706431 192.168.0.5 4443 typ host generation 0
a=candidate:2 1 ssltcp 2130706431 2001:0:5ef5:79fb:309f:3941:bb9f:8a46 4443 typ host generation 0
a=candidate:4 1 udp 2113939711 2001:0:5ef5:79fb:309f:3941:bb9f:8a46 10000 typ host generation 0
a=candidate:3 1 udp 2113932031 192.168.0.5 10000 typ host generation 0
a=ice-ufrag:16hvt1b09hq7nv
a=ice-pwd:71ut14smqi4327i5m8b7p76unr
a=fingerprint:sha-1 DF:09:D9:FD:E0:D8:03:71:90:B4:CA:E9:A7:2E:FE:07:A2:B3:F8:4B
a=setup:actpass
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024
a=x-attach-sctpconnection-id:c1d38e64f921d720


As you can see, it has a DataChannel block
m=application 9 DTLS/SCTP 5000
.




I attached the
ondatachannel
event to the
RTCPeerConnection
. It never triggers for some reason.

Any ideas what I can look for? I'd have expected to see this event trigger, given that the SDP contains a dataChannel.




Versions:
Version 52.0.2743.116 (64-bit)
on
macOS El Capitan
, also tested on
Google Chrome Version 54.0.2840.71
on
Windows 8.1
.




I'm willing to provide additional information. However, due to the code being mostly proprietary, that unfortunately doesn't include huge chunks of source-code. So please excuse the lack of source. :(

If you have any idea/question, please feel free to comment.

Answer

Turns out the port was just blocked by a firewall in the server-side. As I'm only responsible for the client-side I didn't notice that. :(

Comments