0

I am trying to connect audio call through sipML5 API in MS edge using webrtc and adapter.js, but it gives error Timeout for addremoteCandidate. Consider sending an end-of-candidates notification.

I already tried sending addIceCandidate(null) as mentioned here but it is not working or may be i am sending it wrong. I googled but there is not enough documentation on this.

My question is where and how can i send addIceCandidate(null) so adapter.js will consider it ?

My RTCPeerConnection code

this.o_pc = new window.RTCPeerConn(a && !a.length ? null : {
            iceServers: a, 
            rtcpMuxPolicy: "negotiate",
            iceTransportPolicy: "all",
            bundlePolicy: "balanced",
            iceCandidatePoolSize: 0
            //gatherPolicy: "all",

        }, this.o_media_constraints);
        this.o_pc.onicecandidate = tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onIceCandidate : function(e) {
            tmedia_session_jsep01.onIceCandidate(e, c);
        };
        this.o_pc.onnegotiationneeded = tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onNegotiationNeeded : function(e) {
            tmedia_session_jsep01.onNegotiationNeeded(e, c);
        };
        this.o_pc.onsignalingstatechange = tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onSignalingstateChange : function(e) {
            tmedia_session_jsep01.onSignalingstateChange(e, c);
        };
this.o_media_constraints = {
        audio: true
    };
    if (tsk_utils_get_navigator_friendly_name() == "firefox") {
        tmedia_session_jsep01.mozThis = this;
        this.o_media_constraints.mandatory.MozDontOfferDataChannel = true;
    }

Any help would be appreciated.

Thanks

Abeer Waseem
  • 72
  • 1
  • 9
  • You could refer to [this issue in GitHub](https://github.com/webrtcHacks/adapter/issues/852) about adding end-of-candidate. And in the [MDN doc](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addIceCandidate#Syntax), it says *If no candidate object is specified, or its value is null, an end-of-candidates signal is sent to the remote peer using the end-of-candidates a-line, formatted simply like this: `a=end-of-candidates`*. – Yu Zhou Aug 05 '19 at 02:59
  • Hi, i am unable to hear audio on safari [working demo](https://calling.hexzap.com/new/callme.html), do you think it is related to this issue ? – Abeer Waseem Aug 06 '19 at 21:37

1 Answers1

2

This warning indicates that you never call addIceCandidate(null). When the other end finishes with candidate gathering, i.e. pc.onicecandidate(event) is called event.candidate not set. Then you need to send a signaling message like e.g. {type: 'end-of-candidates'} which will cause addIceCandidate(null) to be called in Edge.

If you do not do that, adapter.js (or rather the Edge/ORTC shim) will do this for you after some time but this is far from optimal.

Philipp Hancke
  • 15,855
  • 2
  • 23
  • 31
  • Thanks for answer [here is the working demo](https://calling.hexzap.com/new/callme.html). If you open it on MS edge the call is connecting but there is no audio, it it something related with addIceCandidate(null) ? This is working on all browsers (not this version) except MS edge. – Abeer Waseem Aug 04 '19 at 22:26