Skip to content

Two m=aduio lines when trying to switch audio input during active call (Chrome 72). #664

Closed

Description

@domnich

Describe the bug

  1. Person A starting outgoing call from Chrome v 72. Person B accept call
  2. During a call person A changes audio input
  3. Person B hears on hold music and there are 2 m=audio lines in reinvite request

Logs

INVITE sip:[email protected]:5060;transport=udp SIP/2.0
Route: sip:109.68.97.116:443;transport=wss;r2=on;lr;ftag=oc3eiu58lt
Route: sip:10.111.222.216;r2=on;lr;ftag=oc3eiu58lt
Via: SIP/2.0/WSS ud0kgdnl37jr.invalid;branch=z9hG4bK9489265
Max-Forwards: 70
To: sip:[email protected]:5060;transport=udp;tag=sip+5+2faf0000+84f02204
From: sip:[email protected];tag=oc3eiu58lt
Call-ID: 9pgj1gmmh2kovjb4p8pt
CSeq: 3718 INVITE
Contact: sip:[email protected];transport=wss;ob
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound
User-Agent: SIP.js/0.13.6
Content-Type: application/sdp
Content-Length: 4232

v=0
o=- 3992930103427058862 5 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS R4bAJlwh1c2UWVdFEpufCUVMFU7SqqNoJO2P
m=audio 64839 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 192.168.133.65
a=rtcp:59981 IN IP4 192.168.133.65
a=candidate:2313619336 1 udp 2122260223 192.168.133.65 64839 typ host generation 0 network-id 3 network-cost 50
a=candidate:1373417400 1 udp 2122194687 192.168.121.7 55100 typ host generation 0 network-id 1
a=candidate:2801540366 1 udp 2122129151 169.254.35.13 51302 typ host generation 0 network-id 2
a=candidate:2313619336 2 udp 2122260222 192.168.133.65 59981 typ host generation 0 network-id 3 network-cost 50
a=candidate:1373417400 2 udp 2122194686 192.168.121.7 51817 typ host generation 0 network-id 1
a=candidate:2801540366 2 udp 2122129150 169.254.35.13 58903 typ host generation 0 network-id 2
a=candidate:3345283960 1 tcp 1518280447 192.168.133.65 9 typ host tcptype active generation 0 network-id 3 network-cost 50
a=candidate:526340936 1 tcp 1518214911 192.168.121.7 9 typ host tcptype active generation 0 network-id 1
a=candidate:3900695038 1 tcp 1518149375 169.254.35.13 9 typ host tcptype active generation 0 network-id 2
a=candidate:3345283960 2 tcp 1518280446 192.168.133.65 9 typ host tcptype active generation 0 network-id 3 network-cost 50
a=candidate:526340936 2 tcp 1518214910 192.168.121.7 9 typ host tcptype active generation 0 network-id 1
a=candidate:3900695038 2 tcp 1518149374 169.254.35.13 9 typ host tcptype active generation 0 network-id 2
a=ice-ufrag:3BzS
a=ice-pwd:08TPt9ns97qEFV0HZGy0ne9Q
a=ice-options:trickle
a=fingerprint:sha-256 4C:00:E5:70:65:5D:BD:2C:11:51:E8:AE:FE:5D:A8:7C:0B:A4:F4:55:1C:62:C9:30:57:B3:D4:EE:5F:8A:35:1A
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=msid:R4bAJlwh1c2UWVdFEpufCUVMFU7SqqNoJO2P 60e15976-105a-44a2-9e07-36c03558f3a1
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: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:1964520228 cname:x9tJ8ZSLmODQRvWd
a=ssrc:1964520228 msid:R4bAJlwh1c2UWVdFEpufCUVMFU7SqqNoJO2P 60e15976-105a-44a2-9e07-36c03558f3a1
a=ssrc:1964520228 mslabel:R4bAJlwh1c2UWVdFEpufCUVMFU7SqqNoJO2P
a=ssrc:1964520228 label:60e15976-105a-44a2-9e07-36c03558f3a1
m=audio 53697 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 192.168.133.65
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2313619336 1 udp 2122260223 192.168.133.65 53697 typ host generation 0 network-id 3 network-cost 50
a=candidate:1373417400 1 udp 2122194687 192.168.121.7 51020 typ host generation 0 network-id 1
a=candidate:2801540366 1 udp 2122129151 169.254.35.13 63682 typ host generation 0 network-id 2
a=ice-ufrag:3BzS
a=ice-pwd:08TPt9ns97qEFV0HZGy0ne9Q
a=ice-options:trickle
a=fingerprint:sha-256 4C:00:E5:70:65:5D:BD:2C:11:51:E8:AE:FE:5D:A8:7C:0B:A4:F4:55:1C:62:C9:30:57:B3:D4:EE:5F:8A:35:1A
a=setup:actpass
a=mid:1
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
a=sendrecv
a=msid:5wnaIImVp2oS1xodGCSWDorJBbKEuaTkvMeG bf08e5a6-7ba0-41c9-92ba-6c8e4a461260
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: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:1142610092 cname:x9tJ8ZSLmODQRvWd
a=ssrc:1142610092 msid:5wnaIImVp2oS1xodGCSWDorJBbKEuaTkvMeG bf08e5a6-7ba0-41c9-92ba-6c8e4a461260
a=ssrc:1142610092 mslabel:5wnaIImVp2oS1xodGCSWDorJBbKEuaTkvMeG
a=ssrc:1142610092 label:bf08e5a6-7ba0-41c9-92ba-6c8e4a461260

As you can see I have 2 m=audio lines here...Changing audio input works correctly in Opera for example and I also tried to test it in Chrome < 70 and its works fine...

What I do to change audio input:

navigator.mediaDevices
.getUserMedia({
audio: { deviceId: { exact: device.deviceId } }
video: false
})
.then((stream: MediaStream) => {
sipSession.reinvite({
sessionDescriptionHandlerOptions: {
constraints: {
audio: true,
video: false
}
}
});
});

During the re invite -> sip tries to remove old tracks from peerConnection, from sip.js source:

try {
// Remove old tracks
if (_this.peerConnection.removeTrack) {
_this.peerConnection.getSenders().forEach(function (sender) {
_this.peerConnection.removeTrack(sender);
});
}
return streams;
}
catch (e) {
return Promise.reject(e);
}

If add console.log log(_this.peerConnection.getSenders()) after removeTrack() I will see next:

  1. Opera ---> just empty array []
  2. Chrome
    sender

If after removeTrack() add delay for 2 seconds --> i will see 2 senders...old one and new one... I think because of this 2 senders Im getting 2 m=audio lines

sender2

To Reproduce (if possible)
na

Expected behavior
na

Observed behavior
na

Environment Information

  • SIP v 0.13.5
  • Chrome v 72

Additional context
na

Activity

  1. domnich commented on Mar 27, 2019

    @domnich
    Author

    Fixed it.

    1. I do not call session.reinvite on audio input change
    2. On audio input change I just replace previous track with new one
  2. domnich commented on Mar 27, 2019

    @domnich
    Author

    So it could be closed as no relevant anymore.

  3. egreenmachine commented on Mar 27, 2019

    @egreenmachine
    Collaborator

    Makes sense. Thanks

  4. zhezhang91 commented on Aug 24, 2022

    @zhezhang91
    1. i

    Fixed it.

    1. I do not call session.reinvite on audio input change
    2. On audio input change I just replace previous track with new one

    @domnich would mind share the code to replace previous track with new one? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions