OnDataChannel is not fired as expected. Why?

659 views
Skip to first unread message

Martin

unread,
May 20, 2016, 8:35:23 AM5/20/16
to discuss-webrtc
I am trying to use data channels in one native application for Linux. There are no problems with creating data channels and offering them.

However, when the remote peer offers a data channel, the OnDataChannel() is NOT triggered. The log says:

"Data is not supported in the answer", which comes from here .

Do you know why?

Taylor Brandstetter

unread,
May 20, 2016, 1:14:50 PM5/20/16
to discuss...@googlegroups.com
This means that the media description is being rejected. This could be because it's rejected in the offer (port on m= line is 0). Or it could be that the protocol on the m= line (should be "DTLS/SCTP") is invalid. This could happen if you're trying to use RTP data channels, which are no longer being supported.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/0f24a5ba-4b47-410e-8cfe-d849488d66ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin

unread,
May 20, 2016, 2:34:56 PM5/20/16
to discuss-webrtc
Hi Taylor,

thanks for you answer.

I am not enabling rtp data channels in the answer constraints.
(Note also that calling  webrtc::MediaConstraintsInterface::SetAllowDtlsSctpDataChannels() fails with "invalid constraint" error, while the same does work during the offer)

There are the  DTLS/SCTP lines.

Do you see anything strange? This is the offer:

v=0
no=- 1463764587615141 1463764587615143 IN IP4 192.168.1.16
ns=demo
t=0 0
a=group:BUNDLE video data
a=msid-semantic: WMS remotepeer
m=video 1 RTP/SAVPF 100
c=IN IP4 192.168.1.16
a=mid:video
a=sendonly
a=rtcp-mux
a=ice-ufrag:UPOU
a=ice-pwd:YKZg73pYARotEC3XHAf7xm
a=ice-options:trickle
a=fingerprint:sha-256 D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
a=setup:actpass
a=connection:new
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=ssrc:304057486 cname:remotepeervideo
a=ssrc:304057486 msid:remotepeer remotepeerv0
a=ssrc:304057486 mslabel:remotepeer
a=ssrc:304057486 label:remotepeerv0
a=candidate:1 1 udp 2013266431 192.168.1.16 51948 typ host
a=candidate:1 2 udp 2013266430 192.168.1.16 46257 typ host
m=application 1 DTLS/SCTP 5000
c=IN IP4 192.168.1.16
a=mid:data
a=sctpmap:5000 webrtc-datachannel 16
a=ice-ufrag:SqYn
a=ice-pwd:vzeDqAJKh5/UnDYPdkCXkv
a=ice-options:trickle
a=fingerprint:sha-256 D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
a=setup:actpass
a=connection:new
a=candidate:2 1 udp 2013266431 192.168.1.16 51610 typ host

This is  the relevant log produced by the native webrtc:

(webrtcsdp.cc:2604): Ignored line: c=IN IP4 192.168.1.16
(webrtcsdp.cc:2604): Ignored line: c=IN IP4 192.168.1.16
(webrtcsdp.cc:2728): Ignored line: a=sctpmap:5000 webrtc-datachannel 16
(webrtcsdp.cc:2728): Ignored line: a=connection:new
(webrtcsdp.cc:1662): AddSctpDataCodec: Got SCTP Port Number 5000
...
(mediasession.cc:1895): Data is not supported in the answer.

And finally, this is the local description generated after the createAnswer(), no OnDataChannel is triggered (see below, there is no data in the BUNDLE).

v=0
o=- 5491662008082994390 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS
m=video 56151 RTP/SAVPF 100
c=IN IP4 192.168.1.16
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:3596738868 1 udp 2122260223 192.168.1.16 56151 typ host generation 0 network-id 3
a=ice-ufrag:S91NgXxWes5uu4LU
a=ice-pwd:stZJ3xqCrAsRn7zi/lFMONks
a=fingerprint:sha-256 C2:FD:3E:65:2A:6A:A7:53:F1:42:8F:C4:85:6E:33:F2:6A:98:B6:7F:54:1C:63:C3:BD:0B:34:6F:FF:A9:AC:67
a=setup:active
a=mid:video
a=recvonly
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
m=application 0 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024

Taylor Brandstetter

unread,
May 20, 2016, 4:35:08 PM5/20/16
to discuss...@googlegroups.com
Nothing unusual in the offer or answer (other than that data is rejected in the answer). The only things I can think that would cause this are:
  • DTLS or DTLS-SRTP is disabled
  • SCTP data channels are disabled
  • RTP data channels are enabled
I'd suggest taking another close look at the RTCConfiguration passed into the PeerConnection, and the constraints passed into CreateAnswer. The defaults should work just fine.

If you still have problems, you can create a bug report and CC me and we can debug it further.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Martin

unread,
May 21, 2016, 9:16:37 AM5/21/16
to discuss-webrtc
Thanks.

I spent many hours trying to understand what's wrong but could not figure it out. I used the defaults and eventually explicitly set DTLS and/or SCTP but nothing worked with the answer. I am using the mos recent source code from master.

I think I will open a bug report. Will you need other informations apart from what I gave here?

Martin

unread,
May 21, 2016, 9:29:30 AM5/21/16
to discuss-webrtc
Reply all
Reply to author
Forward
0 new messages