node.jsmobilewebrtcpeer

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


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

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


Solution

  • 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.