javascriptreactjsdjangowebrtcmesibo

WebRTC: ICE failed error in browser with Mesibo Video/Audio chat


I am working on a video/audio chat application in React and Django using Mesibo Javascript SDK.

It is working locally on the same network but when trying to connect through different networks, Firefox browser gives me this error

WebRTC: ICE failed, add a TURN server and see about:webrtc for more details.

In Chrome, this error doesn't show up but still the video/audio chat is not working and gives me

Mesibo_OnCallStatus: 50.

I noticed that Mesibo uses stun:stun.l.google.com:19302 as the STUN server and tried changing it to stun:stun.l.google.com:19305 but of no use. I even created a numb.viagenie.ca account to add a TURN server which worked for a few minutes and then gave this error

webrtc: ice failed, your turn server appears to be broken.

When checked on https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/, chrome is giving error code:701 for all the above turn/stun servers whereas firefox doesn't.

As suggested by Mesibo Documentation, my website is fully secure with https and the Rest APIs are called from Django backend. I'm invoking https://api.mesibo.com/mesibo.js as a script tag in the index.html file in react. I'm also able to successfully get

Mesibo_OnConnectionStatus=1

and the incoming call notification is also working. Upon answering the call, the call status changes from 3 to 5 and gives this webrtc error after sometime without any video/audio rendered.

Please suggest any hint/solution.


Solution

  • To Enable webrtc for remote calling you need your own trun server.

    Google don't provide free trun server.

    Free Turn Servers are will not work well in production. Well Fell Free to try Your Luck on Them. Not All Are borken

    You Need to create Your Own on Cloud like DigitalOcean,AWS. Or For Tetsing purpose I have a Trick

    Soloution.

    1. If Your Doing the testing

      Probably you can try to use some Google TURN servers that they use here https://test.webrtc.org/, I just checked for browser console and found this:

    enter image description here

    Not Sure About LifeTime. But you will get that.

    1. For Production I will suggest to used DigitalOcean 5$ plan which is very chip.

      And you install your own TURN server using coturn on it

    If you want You can also use Node-turn which is great for node backend.

    There is also heroku option of setup

    I don't know is there any django or python option.

    (tip: try your to build turn server on hosting server. Make sure the port on which server is running is open)