Search code examples
uwpwebrtcsdp

Webrtc and UWP without trickle ice


I'm trying to establish a webrtc call using this nuget package https://www.nuget.org/packages/WebRtc/. I am not able to use trickle ice in my implementation so I try to add ice candidates to my sdp as they are gathered. This worked in an earlier version of the package, however when using the latest version this fails when I try to create a session description with a modified sdp. The latest version of the package is based on webrtc version m71 as I understand it. My offer sdp looks like this after adding ice candidates:

"v=0
o=- 984872923505738618 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS bf18a69a-7b0e-46d0-8972-dd8995b1d839 e0014ee3-b7dc-46ae-8ebb-89669bd33f7c
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:yHgM
a=ice-pwd:So+kgi6mFjYkB0uLEOC+cskS
a=ice-options:trickle
a=fingerprint:sha-256 55:56:B8:61:65:54:51:1B:D6:88:E7:50:BB:06:80:7D:D1:65:E5:3F:C5:D0:E5:4D:B2:9F:B9:88:84:20:FC:C2
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:3424879744 cname:q8MJSfLi5w/UPF2u
a=ssrc:3424879744 msid:bf18a69a-7b0e-46d0-8972-dd8995b1d839 SELF_AUDIO
a=ssrc:3424879744 mslabel:bf18a69a-7b0e-46d0-8972-dd8995b1d839
a=ssrc:3424879744 label:SELF_AUDIO
a=candidate:1862263974 1 udp 2122260223 xxx.xxx.x.xx 53631 typ host generation 0 ufrag yHgM network-id 1 network-cost 10|audio|0
a=candidate:545003606 1 tcp 1518280447 xxx.xxx.x.xx 63166 typ host tcptype passive generation 0 ufrag yHgM network-id 1 network-cost 10|audio|0
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127 124 125
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:yHgM
a=ice-pwd:So+kgi6mFjYkB0uLEOC+cskS
a=ice-options:trickle
a=fingerprint:sha-256 55:56:B8:61:65:54:51:1B:D6:88:E7:50:BB:06:80:7D:D1:65:E5:3F:C5:D0:E5:4D:B2:9F:B9:88:84:20:FC:C2
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=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 x-google-profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 H264/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 packetization-mode=1
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:127 red/90000
a=rtpmap:124 rtx/90000
a=fmtp:124 apt=127
a=rtpmap:125 ulpfec/90000
a=ssrc-group:FID 2634832858 1498331816
a=ssrc:2634832858 cname:q8MJSfLi5w/UPF2u
a=ssrc:2634832858 msid:e0014ee3-b7dc-46ae-8ebb-89669bd33f7c SELF_VIDEO
a=ssrc:2634832858 mslabel:e0014ee3-b7dc-46ae-8ebb-89669bd33f7c
a=ssrc:2634832858 label:SELF_VIDEO
a=ssrc:1498331816 cname:q8MJSfLi5w/UPF2u
a=ssrc:1498331816 msid:e0014ee3-b7dc-46ae-8ebb-89669bd33f7c SELF_VIDEO
a=ssrc:1498331816 mslabel:e0014ee3-b7dc-46ae-8ebb-89669bd33f7c
a=ssrc:1498331816 label:SELF_VIDEO
a=candidate:1862263974 1 udp 2122260223 xxx.xxx.x.xx 53632 typ host generation 0 ufrag yHgM network-id 1 network-cost 10|video|1
a=candidate:545003606 1 tcp 1518280447 xxx.xxx.x.xx 63167 typ host tcptype passive generation 0 ufrag yHgM network-id 1 network-cost 10|video|1
"```

Solution

  • network-cost 10|audio|0 in the candidate line looks wrong and probably results in a parse error.

    Most likely you concatenated the sdpMid and sdpMLineIndex with the candidate when appending to the SDP.

    Note that typically the peerconnections localDescription.sdp will be updated by the library without the need to add candidates yourself.