2016-08-10 20 views
1

我想为sdp报价生成sdp答案。我也在使用ICE,但是候选人正在与sdp offer一起发送。如何处理与候选人的SDP报价并生成合适的回复

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

这里是SDP提供我正在receving:

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:

v=0 
o=- 3679812671 3679812671 IN IP4 0.0.0.0 
s=Kurento Media Server 
c=IN IP4 0.0.0.0 
t=0 0 
m=audio 0 RTP/AVP 0 8 3 101 
a=inactive 
a=ssrc:1635381884 cname:[email protected] 
a=ice-ufrag:MdZD 
a=ice-pwd:+ZxngOqy+6x1MM+0lI+CGD 
a=fingerprint:sha-256 02:B7:04:92:F3:69:72:2C:15:E0:D5:FE:CE:20:63:75:B3:FD:77:DC:6E:88:FB:64:7B:B7:A6:DF:BE:A7:E7:DD 
a=mid:audio0 

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

+0

P.S:在谷歌群组发布此问题以及得到迅速回复。这里是[链接](https://groups.google.com/d/msg/kurento/JwQcbgwmMNE/PDn3qnK7BgAJ) –

回答

0

一旦生成答案,您可能需要设置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,一旦你已经产生的呢?

相关问题