I am hoping that one of you WebRTC experts can point me in the right direction or tell me if what I am trying to do is feasible/supported in the current Chrome browser or even if Chrome will be supporting this use case in the future.
I have searched for an answer and tried many things in my code, but I can't get the following to work:
I am trying to do a call upgrade (adding video to existing audio only call), but without the Bundle lines in the SDP. My network does not support port bundling, so I need an SDP where the audio and video ports are different. I want to point out right away that I can successfully do this use case if I do NOT remove the Bundle lines (keep default SDP).
USE CASE:
- Setup an initial audio only call between user A and user B
- User A does a call upgrade (add video to audio only call with new getUserMedia)
- User B accepts the call upgrade
- Any user does call downgrade (remove video by setting the video port to 0)
- Any user does call upgrade (add video again with new getUserMedia)
- Repeat step 4-5 without the browser failing
NOTE: before doing any _pc.setLocalDescription, I remove the bundle lines from the SDP this way:
sessionDescription.sdp = sessionDescription.sdp.replace(/a=group:BUNDLE audio\r\n/g, "");
sessionDescription.sdp = sessionDescription.sdp.replace(/a=group:BUNDLE audio video\r\n/g, "");
This does work because I get different ports on "m=audio" and "m=video", which is the intended behavior.
Basically, the browser can only perform successfully an upgrade multiple times in a row if the call uses the same port for both "m=audio" and "m=video" lines. If the ports are different, passing from a downgraded call to once again a video call is not working.
v=0
o=- 4834140171951113916 5 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt
m=audio 52158 RTP/SAVPF 111 103 104 0 8 126
c=IN IP4 125.113.122.55
a=rtcp:52159 IN IP4 142.133.123.33
a=candidate:437151159 1 udp 2122260223 142.133.123.33 52158 typ host generation 0 a=candidate:437151159 2 udp 2122260222 142.133.123.33 52159 typ host generation 0 a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:1418565959 2 tcp 1518280446 142.133.123.33 0 typ host tcptype active generation 0
a=ice-ufrag:yTCE4QuOaRby5yJd
a=ice-pwd:KKHBT1dd/0NoScpt8Iiix8ub
a=ice-options:google-ice
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
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=fmtp:111 minptime=10
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:2250182501 cname:GVPQmpDpIZXlFcBr
a=ssrc:2250182501 msid:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt 4ef7d31c-eae4-4314-9732-6a100b53e42e
a=ssrc:2250182501 mslabel:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt
a=ssrc:2250182501 label:4ef7d31c-eae4-4314-9732-6a100b53e42e
m=video 52169 RTP/SAVPF 100 116 117 96
c=IN IP4 125.113.122.55
a=rtcp:52170 IN IP4 142.133.123.33
a=candidate:437151159 1 udp 2122260223 142.133.123.33 52169 typ host generation 0 a=candidate:437151159 2 udp 2122260222 142.133.123.33 52170 typ host generation 0 a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:1418565959 2 tcp 1518280446 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:437151159 1 udp 2122260223 142.133.123.33 61801 typ host generation 0 a=candidate:437151159 2 udp 2122260222 142.133.123.33 61802 typ host generation 0 a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:1418565959 2 tcp 1518280446 142.133.123.33 0 typ host tcptype active generation 0
a=ice-ufrag:yTCE4QuOaRby5yJd
a=ice-pwd:KKHBT1dd/0NoScpt8Iiix8ub
a=ice-options:google-ice
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=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/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=ssrc:454679926 cname:GVPQmpDpIZXlFcBr
a=ssrc:454679926 msid:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt 09c6faeb-b226-49b0-9ce4-40378af9558e
a=ssrc:454679926 mslabel:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt
a=ssrc:454679926 label:09c6faeb-b226-49b0-9ce4-40378af9558e
a=ssrc:4043911517 msid:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt 09c6faeb-b226-49b0-9ce4-40378af9558e a=ssrc:4043911517 mslabel:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt a=ssrc:4043911517 label:09c6faeb-b226-49b0-9ce4-40378af9558e
see browser ANSWER:
v=0
o=- 6057878882910049263 5 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1
m=audio 52163 RTP/SAVPF 111 103 104 0 8 126
c=IN IP4 125.113.122.55
a=rtcp:1 IN IP4 0.0.0.0
a=candidate:437151159 1 udp 2122260223 142.133.123.33 52163 typ host generation 0 a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=ice-ufrag:FjQgNw/qg0UA36ZH
a=ice-pwd:kHYooqwEWmTn7Pco1mh4Af+E
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
a=setup:active
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=fmtp:111 minptime=10
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:2432452571 cname:jbVMZw57KYOje031
a=ssrc:2432452571 msid:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1 147c3eaf-87cc-457f-bf9c-1610deff30b4
a=ssrc:2432452571 mslabel:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1
a=ssrc:2432452571 label:147c3eaf-87cc-457f-bf9c-1610deff30b4
m=video 1 RTP/SAVPF 100 116 117 96
c=IN IP4 0.0.0.0
a=rtcp:1 IN IP4 0.0.0.0
a=ice-ufrag:
a=ice-pwd:
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
a=setup:active
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=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/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=ssrc:3620434458 cname:jbVMZw57KYOje031
a=ssrc:3620434458 msid:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1 acb064af-1bc3-4d0e-80fe-9ed251bbc8ca
a=ssrc:3620434458 mslabel:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1
a=ssrc:3620434458 label:acb064af-1bc3-4d0e-80fe-9ed251bbc8ca
a=ssrc:3089122764 msid:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1 acb064af-1bc3-4d0e-80fe-9ed251bbc8ca a=ssrc:3089122764 mslabel:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1 a=ssrc:3089122764 label:acb064af-1bc3-4d0e-80fe-9ed251bbc8ca
WebRTC -> Failed to set session description: Failed to set local answer sdp: Called with SDP without ice-ufrag and ice-pwd.