Skip to content

New media stream does not contain ICE candidates in SDP #631

Closed

Description

@alexandrkozlov

Describe the bug
There is no ICE candidates when I try to escalate audio only call to video call.

            session.reinvite({
                sessionDescriptionHandlerOptions: {
                    RTCOfferOptions: {
                        iceRestart: true
                    },
                    constraints: {
                        audio: true,
                        video: { aspectRatio: 1.77 }
                    }
                }
            });

Looks like this happens because waitForIceGatheringComplete() does not wait because isIceGatheringComplete() is true because it's re-INVITE and ICE was completed for the first/initial INVITE.

 createOfferOrAnswer: {writable: true, value: function createOfferOrAnswer (RTCOfferOptions, modifiers) {
............
      .then(function onSetLocalDescriptionSuccess() {
        return self.waitForIceGatheringComplete();
      })

Logs
1.txt

To Reproduce (if possible)
Steps to reproduce the behavior:

  1. Make audio only call
  2. Escalate to video call

Expected behavior
SDP should contains ICE candidates.

Observed behavior
New stream does not have ICE candidates.

Environment Information
"sip.js": "0.11.3"
Chrome 70 and FireFox 63 on windows.

Activity

  1. egreenmachine commented on Nov 21, 2018

    @egreenmachine
    Collaborator

    Your logs indicate that you are using a 0.7.X version of SIP.js with a custom media handler. Can you provide logs with a more recent version and no custom hacks?

    0.11.3 has code that resets ICE gathering state

          .then(function(sdp) {
            self.resetIceGatheringComplete();
            return pc.setLocalDescription(sdp);
          })
          .catch(function localDescError(e) {
            self.emit('peerConnection-SetLocalDescriptionFailed', e);
            throw e;
          })
          .then(function onSetLocalDescriptionSuccess() {
            return self.waitForIceGatheringComplete();
          })
    
  2. alexandrkozlov commented on Nov 21, 2018

    @alexandrkozlov
    Author

    It's a log for case #2 when I try to escalate a audio call to video, but there is no ICE candidates and server rejected video stream.
    1.txt

  3. egreenmachine commented on Nov 21, 2018

    @egreenmachine
    Collaborator

    Ok. I see the issue.

      isIceGatheringComplete: {writable: true, value: function isIceGatheringComplete() {
        return this.peerConnection.iceGatheringState === 'complete' || this.iceGatheringTimeout;
      }},
    

    The iceGatheringState on the peer connection is not changing to gathering until after this line is hit. I will try and get a fix in.

  4. alexandrkozlov commented on Nov 21, 2018

    @alexandrkozlov
    Author

    I removed case #1. Looks like issue was in old library, but I cannot reproduce any more. So, issue only with outgoing re-Invite.

  5. john-e-riordan commented on May 27, 2020

    @john-e-riordan
    Collaborator

    Hi,

    #815 is a new implementation which I believe/hope addresses this issue.

    Dealing with ICE gathering starting again after it has once completed is now handled.

    And ...

                        RTCOfferOptions: {
                            iceRestart: true
                        },
    

    ... is now supported.

  6. james-criscuolo commented on Jul 6, 2020

    @james-criscuolo
    Collaborator

    As there was no response and we believe this is fixed, we are going to close the issue. Please test with 0.17.0 and re-open if there is still an issue there.

  7. alexandrkozlov commented on Sep 18, 2020

    @alexandrkozlov
    Author

    Hi,

    Thanks for fixes, I just verified and now Google Chrome works fine.

  8. alexandrkozlov commented on Sep 18, 2020

    @alexandrkozlov
    Author

    But I still have problems with FireFox. When reinvite is called to add video stream FireFox adds one more audio stream and video stream with "c=IN IP4 0.0.0.0".

    Does anyone know why ? any ideas ? (maybe it's know issue)

    v=0
    o=mozilla...THIS_IS_SDPARTA-80.0.1 4674244901715418658 1 IN IP4 0.0.0.0
    s=-
    t=0 0
    a=sendrecv
    a=fingerprint:sha-256 44:24:EA:83:3D:D1:14:AC:25:AA:94:F7:BE:B6:87:B5:96:B0:24:2E:BE:8B:E5:62:37:E5:6C:E5:D5:CC:43:CF
    a=group:BUNDLE 0 1 2
    a=ice-options:trickle
    a=msid-semantic:WMS *
    m=audio 13801 UDP/TLS/RTP/SAVPF 109 9 0 8 101
    c=IN IP4 18.195.48.241
    a=candidate:0 1 UDP 2122252543 192.168.0.114 55560 typ host
    a=candidate:4 1 TCP 2105524479 192.168.0.114 9 typ host tcptype active
    a=candidate:1 1 UDP 1686052863 46.53.181.206 2658 typ srflx raddr 192.168.0.114 rport 55560
    a=candidate:3 1 UDP 92217087 18.195.48.241 13801 typ relay raddr 18.195.48.241 rport 13801
    a=candidate:5 1 UDP 8331263 18.195.48.241 55518 typ relay raddr 18.195.48.241 rport 55518
    a=candidate:6 1 UDP 8331263 18.195.48.241 46049 typ relay raddr 18.195.48.241 rport 46049
    a=recvonly
    a=end-of-candidates
    a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
    a=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level
    a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
    a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1
    a=fmtp:101 0-15
    a=ice-pwd:6a99fab394f0e2d890efc2cac5ebf22a
    a=ice-ufrag:fc327d9b
    a=mid:0
    a=rtcp-mux
    a=rtpmap:109 opus/48000/2
    a=rtpmap:9 G722/8000/1
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=rtpmap:101 telephone-event/8000
    a=setup:actpass
    a=ssrc:2579738626 cname:{a21b8ab8-c1f1-45e5-94e8-6df9b3d85bf3}
    m=audio 0 UDP/TLS/RTP/SAVPF 109 9 0 8 101
    c=IN IP4 0.0.0.0
    a=bundle-only
    a=sendrecv
    a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
    a=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level
    a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
    a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1
    a=fmtp:101 0-15
    a=ice-pwd:6a99fab394f0e2d890efc2cac5ebf22a
    a=ice-ufrag:fc327d9b
    a=mid:1
    a=msid:{619b74de-9a0c-458c-b366-c610e76f1c99} {d0806bd3-9f8c-4d91-abac-ff64565d2201}
    a=rtcp-mux
    a=rtpmap:109 opus/48000/2
    a=rtpmap:9 G722/8000/1
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=rtpmap:101 telephone-event/8000
    a=setup:actpass
    a=ssrc:2467300283 cname:{a21b8ab8-c1f1-45e5-94e8-6df9b3d85bf3}
    m=video 9 UDP/TLS/RTP/SAVPF 120 124 121 125 126 127 97 98
    c=IN IP4 0.0.0.0
    a=sendrecv
    a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
    a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
    a=extmap:5 urn:ietf:params:rtp-hdrext:toffset
    a=extmap:6/recvonly http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
    a=extmap:7 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
    a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
    a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1
    a=fmtp:120 max-fs=12288;max-fr=60
    a=fmtp:124 apt=120
    a=fmtp:121 max-fs=12288;max-fr=60
    a=fmtp:125 apt=121
    a=fmtp:127 apt=126
    a=fmtp:98 apt=97
    a=ice-pwd:6a99fab394f0e2d890efc2cac5ebf22a
    a=ice-ufrag:fc327d9b
    a=mid:2
    a=msid:{619b74de-9a0c-458c-b366-c610e76f1c99} {236c1de8-6e78-460e-ad87-75e7f85292c7}
    a=rtcp-fb:120 nack
    a=rtcp-fb:120 nack pli
    a=rtcp-fb:120 ccm fir
    a=rtcp-fb:120 goog-remb
    a=rtcp-fb:120 transport-cc
    a=rtcp-fb:121 nack
    a=rtcp-fb:121 nack pli
    a=rtcp-fb:121 ccm fir
    a=rtcp-fb:121 goog-remb
    a=rtcp-fb:121 transport-cc
    a=rtcp-fb:126 nack
    a=rtcp-fb:126 nack pli
    a=rtcp-fb:126 ccm fir
    a=rtcp-fb:126 goog-remb
    a=rtcp-fb:126 transport-cc
    a=rtcp-fb:97 nack
    a=rtcp-fb:97 nack pli
    a=rtcp-fb:97 ccm fir
    a=rtcp-fb:97 goog-remb
    a=rtcp-fb:97 transport-cc
    a=rtcp-mux
    a=rtpmap:120 VP8/90000
    a=rtpmap:124 rtx/90000
    a=rtpmap:121 VP9/90000
    a=rtpmap:125 rtx/90000
    a=rtpmap:126 H264/90000
    a=rtpmap:127 rtx/90000
    a=rtpmap:97 H264/90000
    a=rtpmap:98 rtx/90000
    a=setup:actpass
    a=ssrc:2084981250 cname:{a21b8ab8-c1f1-45e5-94e8-6df9b3d85bf3}
    a=ssrc:1580721345 cname:{a21b8ab8-c1f1-45e5-94e8-6df9b3d85bf3}
    a=ssrc-group:FID 2084981250 1580721345
    
    
  9. alexandrkozlov commented on Dec 9, 2020

    @alexandrkozlov
    Author

    Unfortunately the latest Chrome do the same.

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