adapter icon indicating copy to clipboard operation
adapter copied to clipboard

Getting error in edge(c004e001) for new RTCIceGatherer(self.iceOptions);

Open santanubrahma opened this issue 9 years ago • 13 comments

Browsers and versions affected Microsoft Edge 38.14393.0.0

Description When we are trying to access new RTCPeerConnection in adpater.js. Possible reason is usages of new RTCIceGatherer(self.iceOptions) in window.RTCPeerConnection.prototype._createIceAndDtlsTransports = function(...) {...}

One important thing is that, If I use null instead of iceServers in new RTCPeerConnection() then I am not getting such error. That means it's coming if I use IceServers in ORTC!!

As per as I know that this issue already been reported in Microsoft developers community, https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6842709/

Steps to reproduce When we are using new RTCPeerConnection on Microsoft Edge on mentioned version.

Expected results Success or failure with exact debug information.

Actual results Getting console error on edge as 'Could not complete the operation due to error c004e001.'

santanubrahma avatar Feb 15 '17 19:02 santanubrahma

what is iceOptions before and after doing the iceServers.filter here?

fippo avatar Feb 15 '17 20:02 fippo

I have used iceservers only,

var rtcOptions = {
    iceServers: {
        url: 'stun:stun.l.google.com:19302',
        urls: 'stun:stun.l.google.com:19302'
    },
    {
        url: 'turn:turn.bistri.com:80',
        urls: 'turn:turn.bistri.com:80',
        credential: 'homeo',
        username: 'homeo'
    }
};
peerConection = new RTCPeerConnection(rtcOptions);

santanubrahma avatar Feb 15 '17 20:02 santanubrahma

TURN urls need to be fully qualified, i.e. turn:turn.bistri.com:80?transport=udp

But bistri has changed the credentials for that account a loooooooong time ago so these credentials won't work.

fippo avatar Feb 15 '17 20:02 fippo

As per your suggestion it's working and definitely something is not good for edge because stun:stun.iptel.org this STUN server also not working for Edge and getting the same error.

santanubrahma avatar Feb 19 '17 14:02 santanubrahma

Edge doesn't support stun: and will internally filter it.

fippo avatar Feb 22 '17 08:02 fippo

@fippo sorry, I can't understand very well what's happening here. what do you mean by 'Edge doesn't support stun: and will internally filter it.' ?

[EDIT] Trying myself and leaving only TURN urls id does effectively works. But at this point, shouldn't adapter filter out these urls instead of giving 'InvalidAccessError'??

Also, I'm using twilio TURN service which gives me [{urls: 'stun:stun.blablabla}, {urls: 'turn:turn.bablabla?transport=udp', credential: 'blablabla', username: 'blablabla'}]

Is there any pro/cons to filter out the stun url and leave only turn?

Thanks!!

kekkokk avatar Aug 25 '17 09:08 kekkokk

adapter shouldn't need to filter stun: since Edge does that itself. What is the full URL of the twilio stun server?

fippo avatar Aug 25 '17 10:08 fippo

this is the object:

[ { url: 'stun:global.stun.twilio.com:3478?transport=udp' }, { url: 'turn:global.turn.twilio.com:3478?transport=udp', username: 'xxx', credential: 'xxx' }, { url: 'turn:global.turn.twilio.com:3478?transport=tcp', username: 'xxx', credential: 'xxx' }, { url: 'turn:global.turn.twilio.com:443?transport=tcp', username: 'xxx', credential: 'xxx' } ]

passing this to Edge produce an InvalidAccessError

passing this:

[{ url: 'turn:global.turn.twilio.com:3478?transport=udp', username: 'xxx', credential: 'xxx' }, { url: 'turn:global.turn.twilio.com:3478?transport=tcp', username: 'xxx', credential: 'xxx' }, { url: 'turn:global.turn.twilio.com:443?transport=tcp', username: 'xxx', credential: 'xxx' } ]

everything's fine, so maybe Edge isn't doing the filtering

kekkokk avatar Aug 25 '17 14:08 kekkokk

after talking to @shijuns it looks like Edge doesn't filter stun: when ?transport is present. I have a fix in https://github.com/fippo/rtcpeerconnection-shim/pull/14 which should work after the next adapter release.

fippo avatar Aug 25 '17 18:08 fippo

@markandrus FYI -- somewhat surprised you folks didn't notice that

fippo avatar Aug 25 '17 18:08 fippo

@fippo thanks for the heads up

markandrus avatar Aug 26 '17 00:08 markandrus

I was able to replicate this. Weird bug with edge 15.

Removing ?transport=tcp and ?transport=udp from urls works.

iceServers = _.map(iceServers, function(iceServer){
    if(iceServer.urls){
        if(typeof iceServer.urls === 'string'){
            if(iceServer.urls.indexOf('?transport=tcp') > -1){
                iceServer.urls = iceServer.urls.replace('?transport=tcp', '');
            } else if(iceServer.urls.indexOf('?transport=udp') > -1){
                iceServer.urls = iceServer.urls.replace('?transport=udp', '');
            }
        }
    }
    return iceServer;
});

Not sure how MS did not catch this before releasing!

ghafran avatar Aug 27 '17 21:08 ghafran

I was having a similar issue, but it 'turns' out that on top of pulling out the tcp and udp transport designations from the turn server URL, our stun server also wasn't able to be parsed by Edge. Our stun URL begins with 'stun:turn..' instead of the usual 'stun:stun..' (I don't know why I didn't construct or configure our stun/turn server). I switched the stun to a public facing url, but have the turn still looking to our private URL, and it works. I don't know if this sensitivity to stun URLs is a known issue as well, but if not it might be useful to some poor hap (like me) before they go off and start desk flipping.

I think is related to #573

blkwtkns avatar Sep 27 '17 23:09 blkwtkns