Handling Network Change, failure, slow internet connection. Improving Connection speed.

948 views
Skip to first unread message

abdul basit

unread,
Jul 2, 2019, 2:06:16 PM7/2/19
to meetecho-janus
Hi

First of all, thanks a lot for this awesome webrtc gateway. I have used it in multiple apps and it really saves time in developing webrtc apps. 

Right now, I have developed a video calling app with it by using audio bridge API and video room api together. They are working perfectly together, the only issue I am having is on a slow internet connection and when network changes. I need to re-establish the connection but I am not sure which event should I use to initiate the reconnection request and how should I handle each.


1: Audiobridge ice state failed
2: Video room ice state failed
3: Screenshare ice state failed (another publisher)
4: Screenshare state failed for invidiual subscriber
5: Error callback in Janus.init ( here I am trying to reclaim session)


Also, these are the exact same sequence in which these events are normally called. The problem is Janus error callback is called after a long time (maybe due to reclaim_session_timeout flag) or is never called if other ice states fail and network connection is restored before Janus error callback is called. 

What would be the best approach to handle reconnection in this case?  Also, how should I handle slow_link events for each of these? Any tips for optimizing the overall experience of call as right now it appears to be quite slow. 

Settings I am using right now:

bitrate in video rooms: 256000
Screenshare framerate: 30 ( is it optimal or should I decrease it?) 

 Are you using any other technique to improve webrtc connection speed with Janus gateway? Maybe by publishing audio first only and publishing video stream after audio gets connected etc.? Any help would be highly appreciated.


Thanks

abdul basit

unread,
Jul 3, 2019, 7:19:51 AM7/3/19
to meetecho-janus
Further, If I try to reconnect on janus error event and then try to republish audio, I get this error "Can't configure (not in a room)". 

Lorenzo Miniero

unread,
Jul 4, 2019, 6:01:40 AM7/4/19
to meetecho-janus
For ICE failures, you can try recovering with ICE restarts: you'll find more info in the documentation for each plugin.

Lorenzo

abdul basit

unread,
Jul 4, 2019, 8:31:10 AM7/4/19
to meetecho-janus
Thanks a lot for your response. I am following the documentation in janus. js for ice restart and the restart occurs but ice fails in new restart. I have debugged this issue and what's happening is that I am not getting any relay candidates during ice restart although they are gathered during the call setup. I have tried using twilio turn servers as well as our own deployed coturn server, but it fails for both (on ice restart only) due to the same reason. 

Any clue why that might be the case. ? Your help would be highly appreciated.

Thanks. 
Reply all
Reply to author
Forward
0 new messages