WebRTC - ICE failed issue : Almost all calls has been connected, but few times ICE failed issue happening.

236 views
Skip to first unread message

Vishnu R Nair

unread,
Jul 23, 2019, 2:47:18 AM7/23/19
to discuss-webrtc
Hi,

iam facing ICE failed issue in my application for few times, otherwise all calls has been connected successfully. I am trying to connect the web from the mobile sdk. 

Browser : Chrome 75.0
Mobile : Android, iOS

All signalling methods are successfully completed and the ICE getting failed. This is my issue.

I am using coturn as my turn server.
stun.l.google.com:19302 as my stun server.


Anyone please help me to understand this issue. I used to try the webrtc-internals, but i couldn't recognise the issue.

Please guide me to debug this issue.


Any help will be great full.




Tom Greenwood

unread,
Jul 24, 2019, 4:12:39 AM7/24/19
to discuss-webrtc
In my experience ICE failures are often network related issues. I'd suggest wireshark packet captures to understand what happens on STUN packets better and it might give you a clue.

Neil Young

unread,
Jul 24, 2019, 4:19:12 AM7/24/19
to discuss...@googlegroups.com
You could check, if one or more of the exchanged ICE candidates is of "typ relay". In this case you would need a TURN server. The same is the case, if you would be behind a symmetric NAT at one end.

Symmetric NAT detection sample code (found on the net and re-arranged a bit, https://webrtchacks.com/symmetric-nat/):

class NATCheck {
constructor() {

}

async check() {
return new Promise((resolve) => {
var candidates = {};
var pc = new RTCPeerConnection({
iceServers: [
{ urls: 'stun:stun1.l.google.com:19302' },
{ urls: 'stun:stun2.l.google.com:19302' }
]
});
pc.createDataChannel("foo");
pc.onicecandidate = (e) => {

if (e.candidate && e.candidate.candidate.indexOf('srflx') !== -1) {
var cand = this.parseCandidate(e.candidate.candidate);
if (!candidates[cand.relatedPort])
candidates[cand.relatedPort] = [];
candidates[cand.relatedPort].push(cand.port);
} else if (!e.candidate) {
if (Object.keys(candidates).length === 1) {
var ports = candidates[Object.keys(candidates)[0]];
pc.close()
if (ports.length == 1)
resolve(0) // Ordinary NAT
else {

if (ports.every(v => v == ports[0])) {
resolve(0) // Firefox again.... Multiple results, same port
}
else {
resolve(1) // Symmetric NAT
}
}
}
else
pc.close()
}
}
pc.createOffer().then(offer => pc.setLocalDescription(offer))
})

}


// parseCandidate from https://github.com/fippo/sdp
parseCandidate(line) {
let parts
// Parse both variants.
if (line.indexOf('a=candidate:') === 0) {
parts = line.substring(12).split(' ')
} else {
parts = line.substring(10).split(' ')
}

let candidate = {
foundation: parts[0],
component: parts[1],
protocol: parts[2].toLowerCase(),
priority: parseInt(parts[3], 10),
ip: parts[4],
port: parseInt(parts[5], 10),
// skip parts[6] == 'typ'
type: parts[7]
};

for (var i = 8; i < parts.length; i += 2) {
switch (parts[i]) {
case 'raddr':
candidate.relatedAddress = parts[i + 1];
break;
case 'rport':
candidate.relatedPort = parseInt(parts[i + 1], 10);
break;
case 'tcptype':
candidate.tcpType = parts[i + 1];
break;
default: // Unknown extensions are silently ignored.
break;
}
}
return candidate;
}
}

let natCheck = new NATCheck()
export default natCheck



The information contained in this transmission may contain privileged and  confidential information, including patient information protected by federal and state privacy laws. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution, or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/2d27af26-f2f9-4aa1-bbbf-0e097d8c1820%40googlegroups.com.

BIBEESH E BABU

unread,
Jul 24, 2019, 6:27:18 AM7/24/19
to discuss-webrtc
I also facing the same issue. Please give any updates regarding this issue.
+1

BIBEESH E BABU

unread,
Jul 24, 2019, 6:27:18 AM7/24/19
to discuss-webrtc
I also facing the same issue..


On Tuesday, July 23, 2019 at 12:17:18 PM UTC+5:30, Vishnu R Nair wrote:
Reply all
Reply to author
Forward
0 new messages