Webrtc: Could not process WebRTC answer
Asked Answered
D

1

9

Im using ejabberd + stanza io to build a realtime messaging and audio calling website. ive managed to make my first audio call

from chrome(on PC) -> chrome(on mac) with no errors

the problem occurs when i try to make the call

from chrome(on mac) to firefox(on pc) or vice versa

the chrome browser log is showing Could not process WebRTC answer

by using the chrome://webrtc-internals debugger tool ive figured out that setremotedescription failed with the error:

`Failed to set remote answer sdp: Called with SDP without ice-ufrag and ice-pwd`

this is what im using to start a call:

var session = client.jingle.createMediaSession('full JID');
  session.addStream(localAudio_stream); // getUserMedia stream
  session.start();

what am i doing wrong? how can firefox successfully establish a call but chrome cant (tested on opera to with the same result (failure))

Full JS code

Dominique answered 10/12, 2017 at 15:5 Comment(0)
D
4

i've solved the problem by including the npm package sdpparser in the client.js (of stanza.io) then building it again, and in stanza.io.bundle ive tweaked the PeerConnection.prototype.handleAnswer like so:

var sdp = client.SdpParser.parse(answer.sdp);
sdp.media.forEach(function(media){
  if(media.type === 'video' && media.inactive ) {
    delete media.fingerprint;
    media.port = 0;
  }
});
answer.sdp = client.SdpParser.format(sdp);

this may not be the best way to do it , but it definitely solves the problem.

github link of the tweaked stanza.io

Helpful github issue on jingle.js repo

Dominique answered 18/12, 2017 at 22:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.