Can't Connect to peer for some devices [WebRTC]

613 Views Asked by At

I'm working on a video call application using webRTC. I use this application only in the local network. In testing several connection devices that were made successfully connected very well. However, there are some devices that I don't know why they can't make calls to some devices. And it's behaviour was so strange. Here is a call simulation that I did :

*All devices connected to same local network/wifi,

** The problematic device in Bold

  • Windows[A] -> MacOs = Success
  • MacOs -> Windows[A] = Success
  • Windows[B] -> MacOs = Failed
  • MacOs -> Windows[B] = Success
  • Windows[A] -> Windows[B] = Success
  • Windows[B] -> Windows[A] = Failed
  • Windows[B] -> IOS = Success
  • IOS -> Windows[B] = Success
  • Windows[C] -> Normal Desktop Devices = Failed
  • Normal Desktop Devices -> Windows[C] = Success
  • Windows[C] -> IOS = Success
  • IOS -> Windows[C] = Success

Here's the screenshot that I get from chrome://webrtc-internals/

The connection state on problematic device

The state is still on new state, not changing

enter image description here

the callee connection state when receive call from problematic device

enter image description here

Example of succeed connection

enter image description here

I'm using Stun server from google, I have also tried without using iceServers. The result still same. I think if we are only in the local network we don't need a stun/turn server right?

strangely the problematic device cannot make outgoing calls to other desktops, but can make/receive calls with the mobile. And between problematic devices also cannot be connected because in my opinion the problem is that the problematic device cannot make outgoing calls.

What I am confused about is what causes some devices to be unable to make outgoing calls like the case above? I believe this is not a fault in the code, because the call runs flawlessly on other normal device. I have tried various ways, until I use Perfect Negotiation Logic at this time, but the result is still the same.

maybe someone has experienced something similar, can provide a solution in the case above. So much appriciate from me

2

There are 2 best solutions below

0
agam theos On BEST ANSWER

Finally I managed to find the problem. Yes, the problem is the firewall. It looks like the UDP port used by webRTC is being blocked by the firewall. The solution is to open a UDP port on the firewall, so you don't have to turn off the firewall. My case occurs maybe because I only used webRTC on one local network and didn't need a STUN/TURN server, so it needed a UDP port in terms of connection to the peer.

1
mahesh manu Manu On

in local network we don't need stun directly it will connect. We have to concentrate on if we try to make calls from public to private and private to public any firewall restrictions or any reacheability problems when gathering candidates or could be symmetric NAT issue.