webrtc - JsSIP Firefox - InvalidSessionDescriptionError : Answer tried to set recv when offer did not set send

标签 webrtc jssip

我最近在使用 JsSIP。我们试图通过一种方式(传入)音频流连接 session ,但 Firefox 无法正常工作。

Firefox 错误信息:

InvalidSessionDescriptionError: Answer tried to set recv when offer did not set send

所以我们的JsSIP配置是:

mediaConstraints: {'audio': false, 'video': false},
rtcOfferConstraints: {
    offerToReceiveAudio: true,
    offerToReceiveVideo: false
},
sessionTimersExpires: 120,
pcConfig: {
    iceServers: [{'url': 'stun:stun.services.mozilla.com'}, {'url': 'stun:stun.l.google.com:19302'}]
}

这是报价正文

v=0
o=mozilla...THIS_IS_SDPARTA-39.0 1234582256825317267 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 78:FF:54:2C:9A:B0:DC:2B:FC:31:83:89:17:AA:33:AF:FC:EC:C5:9E:0C:8B:E4:AA:23:47:15:09:71:DD:4D:A0
a=group:BUNDLE sdparta_0
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 44686 RTP/SAVPF 109 9 0 8
c=IN IP4 x.x.x.x
a=candidate:0 1 UDP 2122252543 x.x.x.x 44686 typ host
a=candidate:0 2 UDP 2122252542 x.x.x.x 52130 typ host
a=candidate:2 1 UDP 1686110207 x.x.x.x 44686 typ srflx raddr x.x.x.x rport 44686
a=candidate:2 2 UDP 1686110206 x.x.x.x 52130 typ srflx raddr x.x.x.x rport 52130
a=recvonly
a=end-of-candidates
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=ice-pwd:06bf8e8ece7e22f262546b874e13010e
a=ice-ufrag:d0d3aae0
a=mid:sdparta_0
a=rtcp-mux
a=rtpmap:109 opus/48000/2
a=rtpmap:9 G722/8000/1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=setup:actpass

这是答案正文:

v=0
o=matrix 1454436711 1454436712 IN IP4 x.x.x.x
s=matrix
c=IN IP4 x.x.x.x
t=0 0
a=msid-semantic: WMS PrZnRR78adkqAdzI3cJ4tKDYF1CojinZ
m=audio 22178 RTP/SAVPF 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=fingerprint:sha-256 56:34:DC:1D:D5:94:2B:F5:F0:BA:13:45:FD:A7:54:78:A0:BF:D0:BB:45:DD:FC:E9:D0:33:0B:88:12:DC:84:30
a=rtcp-mux
a=rtcp:22178 IN IP4 x.x.x.x
a=ssrc:4206958201 cname:zddhVagVdrcDuBco
a=ssrc:4206958201 msid:PrZnRR78adkqAdzI3cJ4tKDYF1CojinZ a0
a=ssrc:4206958201 mslabel:PrZnRR78adkqAdzI3cJ4tKDYF1CojinZ
a=ssrc:4206958201 label:PrZnRR78adkqAdzI3cJ4tKDYF1CojinZa0
a=ice-ufrag:DMiXmMLSDe7NmkDM
a=ice-pwd:nGT8GZUKgWdBogPSSXG5AiO4
a=candidate:9067675717 1 udp 659136 x.x.x.x 22178 typ host generation 0

附言在 Chrome 上,此配置运行良好

最佳答案

解决方法: a=recvonly 的有效答案是 a=sendonly 和 a=inactive。

RFC 3264:“如果媒体流是 在报价中列为 recvonly,答案必须标记为 sendonly 或 inactive 在答案中。 "

关于webrtc - JsSIP Firefox - InvalidSessionDescriptionError : Answer tried to set recv when offer did not set send,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35166456/

相关文章:

webrtc - TURN 服务器中的 'realm' 是什么?

javascript - 当前不支持使用 applyConstraints 切换 facesMode(媒体流 Api)

javascript - 通过 JsSIP 支持 WebRTC 互联网浏览器

javascript - 使用 Jssip 的 Webrtc 客户端 - 使用 Free switch 和 chrome 两种方式都没有音频

html - Chrome MediaRecorder API 无法录制来自 FreeSwitch 的远程视频,但可以录制本地媒体

javascript - 当我在 Chrome 中单击 "Allow"时,为什么 getUserMedia 会抛出 [object NavigatorUserMediaError]?

java - 事件未到达 kurento java 服务器

android - 在没有平台的情况下使用 Restcomm SIP & Webrtc

webrtc - 如何减少回声消除使语音正常化所需的时间