Webrtc:无法处理WebRTC答案

时间:2017-12-10 15:05:21

标签: node.js xmpp webrtc jingle stanza.io

我使用ejabberd + stanza io构建实时消息和音频呼叫网站。 我设法进行了第一次音频通话

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

当我尝试拨打电话时出现问题

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

正在显示Chrome浏览器日志 Could not process WebRTC answer

使用chrome://webrtc-internals调试工具我已经发现setremotedescription因错误而失败:

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

这就是我用来开始通话的内容:

var session = client.jingle.createMediaSession('full JID');
  session.addStream(localAudio_stream); // getUserMedia stream
  session.start();
我在做错了什么? firefox如何成功建立一个调用但是chrome cant(在opera上测试结果相同(失败))

Full JS code

1 个答案:

答案 0 :(得分:4)

我通过在client.js(stanza.io)中包含npm包sdpparser然后重新构建它来解决了这个问题,并且在stanza.io.bundle中调整了$xls->getActiveSheet()就像这样:

PeerConnection.prototype.handleAnswer

这可能不是最好的方法,但它肯定能解决问题。

github link of the tweaked stanza.io

Helpful github issue on jingle.js repo