RTCMultiConnection
RTCMultiConnection copied to clipboard
Ice connection fails, how can I know what is wrong?
Hi!
I have an application using the latest version RTCMultiConnection and it works well with most person I test it with.
But with some people, the Ice negotiation just fails, giving me the RTCMultiConnection error "ICE connectivity check is failed. Renegotiating peer connection."
Is there a way to know what is wrong?
Thanks.
EDIT: I have tested some online demo of webrtc with these persons and it works without problem. ;(
I've faced similar issues whilst testing on the same network. However, onfailed
event is fired only when, either both ICE-Agent and ICE-server missed to prioritze valid addresses/ports or failed to perform connectivity checks (STUN-binding-requests) or skipped subsequent STUN servers when first URI is down or failed to fire end-of-candidates
gesture.
(Known Bug) Chrome seems taking first STUN-server for ice-trickling, and it skips all others (in the moment). So, XirSys' STUN server (ports 443/80) is skipped in current chrome builds; and hopefully it'll be fixed in M39.
I don't think it is an issue in RTCMultiConnection code, because second try always succeeds for such cases. Remember, getExternalIceServers
must be true, or at least you should be using your own xirsys account.
connection.onfailed = function(event) {
event.peer.getConnectionStats(function(result) {
// read more here, https://cdn.webrtc-experiment.com/getConnectionStats.js
// result.connectionType
// result.audio --- for audio tracks
// result.video ---- for video tracks
});
// use `redial` method
// it is same as: connection.peers[event.userid].redial();
event.peer.redial();
// you can even use `renegotiate`
// event.peer.renegotiate();
};
// or
// connection.autoReDialOnFailure = true;
P.S. Failure in ice-connectivity check isn't the only reason for onfailed
event to be fired, there can be delay in signaling to negotiate offers, and many other factors.
@muaz-khan Hi Muaz Khan i am facing similar problem and you are right , it success from second try ,till here i am able to find a solution but after some times some users are disconnected for some reason and the console show error i think there is a problem in signal server.
@muaz-khan this issue appear while you are on same network using wfi or on different network
@muaz-khan onfailed event is not fired also
@muaz-khan waiting your reply
Stop flooding.
did you solve the problem?