Intermittent reachability, browser execution

27 views
Skip to first unread message

Alex Balashov

unread,
Aug 16, 2022, 10:51:48 PM8/16/22
to js...@googlegroups.com
Hi,

I have been trying for some time to nail down the root cause of why some JsSIP endpoints sometimes become unreachable. This is despite low (30s) re-registration intervals, use of frequent (~5-10s) WebSocket keepalive mechanisms from the server side, etc. Various network/NAT type causes have also been ruled out; incoming packets always make it to the host, but the browser endpoint does not always respond. The browser endpoint does not consistently remain in this regime; it passes in and out of a state of reachability.

The browser (Chrome) is a surely fickle execution environment, and I don’t pretend to understand the interaction between the JsSIP event loop, WebRTC APIs, and the modalities of how browsers run background JavaScript in tabs. I am given to understand that Chrome has a mechanism by which background JavaScript in inactive tabs is either suspended or substantially “re-niced” downward in execution priority, but supposedly WebRTC APIs are exempt from this.

In theory, this means that if the user of the JsSIP endpoint remains consistently active on their PC, then JsSIP should remain reachable. This is not what happens. I suspect there is much I do not understand about the core JsSIP event loop and the things that can interrupt or block it.

Other, related questions that surface mostly revolve around how execution behaves when the PC enters suspend/hibernate mode. When browser execution is resumed, does JsSIP execution resume? Does JsSIP immediately notice that the previous WebSocket connection has gone stale, promptly establish a new one and re-register?

Any insight is appreciated!

— Alex

--
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

José Luis Millán

unread,
Aug 29, 2022, 6:12:24 AM8/29/22
to js...@googlegroups.com
Hi,

> Other, related questions that surface mostly revolve around how execution behaves when the PC enters suspend/hibernate mode. When browser execution is resumed, does JsSIP execution resume? Does JsSIP immediately notice that the previous WebSocket connection has gone stale, promptly establish a new one and re-register?

JsSIP does not handle that, and I don't think there is a proven way to handle this from the browser sadly.

--
You received this message because you are subscribed to the Google Groups "JsSIP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jssip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jssip/0FD07FB2-213A-4805-8DDB-C6E04E3D50F2%40evaristesys.com.


--
José Luis Millán

Alex Balashov

unread,
Aug 29, 2022, 6:13:11 AM8/29/22
to js...@googlegroups.com

> On Aug 29, 2022, at 6:12 AM, 'José Luis Millán' via JsSIP <js...@googlegroups.com> wrote:
>
> JsSIP does not handle that, and I don't think there is a proven way to handle this from the browser sadly.

Thank you for your response. No, I’m sure there are not, but perhaps there are some best practices or general tips to follow?
Reply all
Reply to author
Forward
0 new messages