Webrtc 如何与ice候选人一起处理sdp报价并生成合适的响应

Webrtc 如何与ice候选人一起处理sdp报价并生成合适的响应,webrtc,kurento,Webrtc,Kurento,我正在尝试为sdp报价生成sdp答案。我也在使用ICE,但ICE候选人将与sdp报价一起发送 如何生成适当的sdp答案以及这些ice候选对的响应 以下是我收到的sdp报价: v=0 o=root 1557075227 1557075227 IN IP4 172.24.9.236 s=*********** c=IN IP4 172.24.9.236 t=0 0 m=audio 19376 RTP/AVP 0 8 3 101 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA

我正在尝试为sdp报价生成sdp答案。我也在使用ICE,但ICE候选人将与sdp报价一起发送

如何生成适当的sdp答案以及这些ice候选对的响应

以下是我收到的sdp报价:

v=0
o=root 1557075227 1557075227 IN IP4 172.24.9.236
s=***********
c=IN IP4 172.24.9.236
t=0 0
m=audio 19376 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=ice-ufrag:37bcc460577fe3dc590be4916da2574e
a=ice-pwd:39bc5db21294c65840c4442943921476
a=candidate:Hac1809ec 1 UDP 2130706431 172.24.9.236 19376 typ host
a=candidate:S31f8f89e 1 UDP 1694498815 **.***.***.158 19376 typ srflx raddr 172.24.9.236 rport 19376
a=candidate:Hac1809ec 2 UDP 2130706430 172.24.9.236 19377 typ host
a=candidate:S31f8f89e 2 UDP 1694498814 **.***.***.158 19377 typ srflx raddr 172.24.9.236 rport 19377
a=sendrecv
以下是webrtcendpoint.processSdpOffer()生成的sdpanswer:

在处理报价之前/之后调用gatherCandidates()没有任何区别。
我无法建立音频呼叫的媒体流。我想原因是ice谈判没有完成。我哪里出错了。

生成答案后,您可能需要设置
localDescription

例如,在JavaScript中,可以执行以下操作:

var sdp = " ... "; // This is the SDP

remoterequest = new RTCSessionDescription({"type": "offer", "sdp": sdp});

peer.setRemoteDescription (remoterequest);

peer.createAnswer((sessionDesc) => {
   peer.setLocalDescription(sessionDesc);
}, (err) => { 
   console.log (err); 
}, {} );

看起来您有一个“SDP应答”,但一旦生成应答,您是否将该应答设置为
localDescription

一旦生成应答,您可能需要设置
localDescription

例如,在JavaScript中,可以执行以下操作:

var sdp = " ... "; // This is the SDP

remoterequest = new RTCSessionDescription({"type": "offer", "sdp": sdp});

peer.setRemoteDescription (remoterequest);

peer.createAnswer((sessionDesc) => {
   peer.setLocalDescription(sessionDesc);
}, (err) => { 
   console.log (err); 
}, {} );

看起来您有一个“SDP答案”,但一旦生成了该答案,您是否将该答案设置为
localDescription

p.S:您也已将该问题发布在谷歌群组上,以获得快速回复。以下是P.S:他们也在谷歌集团上发布了这个问题,以获得快速回复。这是你的电话号码