0

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.

Kevin Kuei
  • 193
  • 2
  • 17

1 Answers1

3

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

Kevin Kuei
  • 193
  • 2
  • 17
  • I haven't found in your repo "sendData" method, do you do that? – Incerteza Apr 10 '15 at 13:52
  • To @AlexanderSupertramp, You are right, I just added sendDataChannelMessage() & onDataChannelMessage() methods. I've test it with my web app and it works fine. – Kevin Kuei Apr 11 '15 at 02:51
  • Thanks, I'll try to integrate it to my project. – Incerteza Apr 11 '15 at 04:05
  • I didn't manage to work my app. Is your app working well with DataChannels? You're using your own signal server, right? I'm going to try out yours at it is.. – Incerteza Apr 13 '15 at 04:06
  • Yes, my app works fine with data channels. It's using my own signaling. Be aware that my signaling server is not guaranteed up. – Kevin Kuei Apr 13 '15 at 04:26
  • Are you sure it's working? `PeerConnectionClient#sendDataChannelMessage()` always returns false. – Incerteza Apr 13 '15 at 12:50
  • And `MainActivity#onDataChannelMessage() ---> Log.d(TAG, "onDataChannelMessage(): " + message);` never appears in the logs. – Incerteza Apr 13 '15 at 12:50
  • And the icon Call is always green, I click on it many times but it never turns to red one which means I can't connect. Only "sending offer, onIceCandidate()" - no established connection, right? Am I doing anything wrong? – Incerteza Apr 13 '15 at 13:05
  • Sorry for the late reply. The icon Call should be red when the call established. I just test it again and it works fine to me. – Kevin Kuei Apr 19 '15 at 08:26
  • Hi Alex, it's nice to see you on my server. :) Did you succeed with your android app?? – Kevin Kuei Apr 26 '15 at 14:45
  • By the way, have you built your signaling server by yourself? How? I want to build one also. – Incerteza Apr 28 '15 at 08:46