无法使用从 Chrome 网络应用程序到 Android 应用程序的 DataChannel 进行 webrtc 调用

Failed to make webrtc call with DataChannel from Chrome web app to Android app

我写了一个 webrtc webapp(带视频+音频+dataChannel):
https://github.com/wennycooper/wsProject

我也写了一个 Android webrtc 应用:
https://github.com/wennycooper/webrtcClient

webapp 到 webapp 的调用工作正常。 没有数据通道的 androidapp-to-androidapp 也可以正常工作。

我尝试将数据通道代码添加到 androidapp 中,并从 webapp 调用 androidapp。被叫方收到Offer后,报如下错误:

04-10 15:48:32.410: W/libjingle(10639): Warning(rtpdataengine.cc:149): Failed to SetSendCodecs because there is no known codec.
04-10 15:48:32.410: W/libjingle(10639): Warning(channel.cc:2375): Failed to set remote data description
04-10 15:48:32.420: E/libjingle(10639): Error(channel.cc:730): Failure in SetRemoteContent with action 0
04-10 15:48:32.420: E/libjingle(10639): Error(webrtcsession.cc:272): Failed to set remote offer sdp: Session error code: ERROR_CONTENT. Session error description: Failed to set data send codecs..
04-10 15:48:32.420: D/MainActivity(10639): Creating ANSWER...
04-10 15:48:32.420: E/libjingle(10639): Error(webrtcsessiondescriptionfactory.cc:245): CreateAnswer can't be called before SetRemoteDescription.
04-10 15:48:32.420: E/libjingle(10639): Error(webrtcsessiondescriptionfactory.cc:408): Create SDP failed: CreateAnswer can't be called before SetRemoteDescription.

完整的 adb 日志在这里:
https://s3-us-west-2.amazonaws.com/kkwebrtc/webrtcAndroid_callee.txt

我不知道发生了什么事??
任何人都可以提供数据通道的工作示例将不胜感激。

终于,我得到了一个工作示例。

我所做的是注释掉以下行并使用 SCTPDataChannel。

//pcConstraints.optional.add(new KeyValuePair("RtpDataChannels", "false")); 

工作示例在这里:
https://github.com/wennycooper/webrtcClient