Libjingle On Android Srtp Error On Createanswer
Solution 1:
Your sdp is incomplete. It should have several ice candidates which would be used for establishing connection. You should add ice candidates into your peerConnection object in such manner:
@OverridepublicvoidonIceCandidate(IceCandidate iceCandidate) {
peerConnection.addIceCandidate(iceCandidate);
}
and send your sdp to another client after when PeerConnection.IceGatheringState become COMPLETE in onIceGatheringChange method. This is not the only way, but it's working and very simple. The example of complete sdp is below:
offer=v=0o=- 80802950628340708552 IN IP4 127.0.0.1s=-
t=00a=group:BUNDLE audio video
a=msid-semantic: WMS ARDAMS
m=audio 13491 RTP/SAVPF 11110391020810610513127126c=IN IP4 54.77.231.253a=rtcp:18373 IN IP4 54.77.231.253a=candidate:18580011401 udp 212226022310.215.226.1640647 typ host generation 0a=candidate:18580011402 udp 212226022210.215.226.1651975 typ host generation 0a=candidate:5408778281 tcp 151828044710.215.226.1654789 typ host tcptype passive generation 0a=candidate:5408778282 tcp 151828044610.215.226.1660723 typ host tcptype passive generation 0a=candidate:40259333761 udp 1686052607217.118.93.13749688 typ srflx raddr 10.215.226.16 rport 40647 generation 0a=candidate:40259333762 udp 1686052606217.118.93.13749689 typ srflx raddr 10.215.226.16 rport 51975 generation 0a=candidate:40259333762 udp 1686052606217.118.93.13753707 typ srflx raddr 10.215.226.16 rport 51975 generation 0a=candidate:40259333761 udp 1686052607217.118.93.13753709 typ srflx raddr 10.215.226.16 rport 40647 generation 0a=candidate:17189963001 udp 4188543954.77.231.25313491 typ relay raddr 217.118.93.137 rport 53710 generation 0a=candidate:17189963002 udp 4188543854.77.231.25318373 typ relay raddr 217.118.93.137 rport 53711 generation 0a=ice-ufrag:vveSvzaR39lenaX1
a=ice-pwd:g7ouF2sZNGOh5Y7O42HaV+a2
a=fingerprint:sha-2567D:E2:C3:49:0E:33:81:E8:1A:24:44:A2:FB:D9:E0:D9:BA:2A:40:B0:9E:BA:B1:BE:ED:EF:22:E0:F6:54:39:F3
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2a=fmtp:111 minptime=10; useinbandfec=1a=rtpmap:103 ISAC/16000a=rtpmap:9 G722/8000a=rtpmap:102 ILBC/8000a=rtpmap:0 PCMU/8000a=rtpmap:8 PCMA/8000a=rtpmap:106 CN/32000a=rtpmap:105 CN/16000a=rtpmap:13 CN/8000a=rtpmap:127 red/8000a=rtpmap:126 telephone-event/8000a=maxptime:60a=ssrc:3583862867 cname:ily01dbTSMDARdSy
a=ssrc:3583862867 msid:ARDAMS ARDAMSa0
a=ssrc:3583862867 mslabel:ARDAMS
a=ssrc:3583862867 label:ARDAMSa0
m=video 16750 RTP/SAVPF 10011611796c=IN IP4 54.77.231.253a=rtcp:10591 IN IP4 54.77.231.253a=candidate:18580011401 udp 212226022310.215.226.1636169 typ host generation 0a=candidate:18580011402 udp 212226022210.215.226.1655549 typ host generation 0a=candidate:5408778281 tcp 151828044710.215.226.1633189 typ host tcptype passive generation 0a=candidate:5408778282 tcp 151828044610.215.226.1640769 typ host tcptype passive generation 0a=candidate:40259333761 udp 1686052607217.118.93.13749687 typ srflx raddr 10.215.226.16 rport 36169 generation 0a=candidate:40259333762 udp 1686052606217.118.93.13749690 typ srflx raddr 10.215.226.16 rport 55549 generation 0a=candidate:40259333761 udp 1686052607217.118.93.13753714 typ srflx raddr 10.215.226.16 rport 36169 generation 0a=candidate:40259333762 udp 1686052606217.118.93.13753708 typ srflx raddr 10.215.226.16 rport 55549 generation 0a=candidate:17189963001 udp 4188543954.77.231.25316750 typ relay raddr 217.118.93.137 rport 53713 generation 0a=candidate:17189963002 udp 4188543854.77.231.25310591 typ relay raddr 217.118.93.137 rport 53712 generation 0a=ice-ufrag:vveSvzaR39lenaX1
a=ice-pwd:g7ouF2sZNGOh5Y7O42HaV+a2
a=fingerprint:sha-2567D:E2:C3:49:0E:33:81:E8:1A:24:44:A2:FB:D9:E0:D9:BA:2A:40:B0:9E:BA:B1:BE:ED:EF:22:E0:F6:54:39:F3
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtpmap:116 red/90000a=rtpmap:117 ulpfec/90000a=rtpmap:96 rtx/90000a=fmtp:96 apt=100a=ssrc-group:FID 3823742641436972716a=ssrc:382374264 cname:ily01dbTSMDARdSy
a=ssrc:382374264 msid:ARDAMS ARDAMSv0
a=ssrc:382374264 mslabel:ARDAMS
a=ssrc:382374264 label:ARDAMSv0
a=ssrc:1436972716 cname:ily01dbTSMDARdSy
a=ssrc:1436972716 msid:ARDAMS ARDAMSv0
a=ssrc:1436972716 mslabel:ARDAMS
a=ssrc:1436972716 label:ARDAMSv0
Hope this helps!
Solution 2:
Try changing the constraints while creating the peerConnection to
MediaConstraints pcConstraints = new MediaConstraints();
pcConstraints.optional.add(new KeyValuePair("DtlsSrtpKeyAgreement", "true")); pcConstraints.optional.add(new KeyValuePair("RtpDataChannels", "true")); peerConnectionFactory.createPeerConnection(config, pcConstraints, new PcObserver());
Post a Comment for "Libjingle On Android Srtp Error On Createanswer"