Search code examples
androidwebrtcrtcdatachannel

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


I wrote a webrtc webapp (with video + audio + dataChannel) on:
https://github.com/wennycooper/wsProject

I wrote an Android webrtc app too on:
https://github.com/wennycooper/webrtcClient

The webapp-to-webapp call works fine. The androidapp-to-androidapp without data channel also works fine.

I tried to add data channel code into androidapp and make call from webapp to androidapp. When the callee received the Offer, it shown following error:

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.

The full adb log is over here:
https://s3-us-west-2.amazonaws.com/kkwebrtc/webrtcAndroid_callee.txt

I have no idea what's going on??
Anyone can provide a working example with data channel will be very appreciated.


Solution

  • Finally, I got a working example.

    What I did is comment out following line and use SCTPDataChannel.

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

    The working example is here:
    https://github.com/wennycooper/webrtcClient