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

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

我最近在使用 JsSIP。我们试图通过一种方式(传入)音频流连接会议,但 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

P.S。在 Chrome 上,此配置运行良好

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

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