WebRTC android implementation not working when one of the device is connected to WiFi

1.1k views Asked by At

I have developed a video streaming app that streams video from one android device to another (and not the other way around). When both devices are on their individual LTE network the app works fine. But when one of the devices is connected to WiFi the app fails in the handshaking (exchange of offer and answer) and shows this in logs

D/null localPeerCreation:
onIceConnectionChange() called with:
iceConnectionState = [CLOSED]

(in some cases there is FAILED in place of CLOSED)

I don't know why this is happening that in case of individual LTE it works but with WIFI it doesn't. I have been trying to debug this problem for quite some time but I can't point my finger at anything because there are also very fewer references for android implementation of WebRTC. Please Help.

Edit: I was starting to send the Ice candidates before Xirsys responded with the candidates so the TURN server was never used. So I changed my app such that any handshaking will only happen after the candidates have been received from Xirsys. I know it was pretty dumb.

1

There are 1 answers

1
Sean DuBois On BEST ANSWER

I am not familiar with Xirsys' TURN servers, but it might not cover all cases need to connect an LTE both clients.

I would check into the following.

  • What transport types are supported (UDP, TCP and TLS)
  • Does the TURN server generate listeners for IPv4 and IPv6?
  • What is the network look like on both devices (IPv4/IPv6, behind a NAT?)

If you can share the candidates on both sides and your RTCConfiguration that would help a lot. Make sure to anonymize your URLs and IPs!