asterisksip

sip.js connects to asterisk service, long connection problem


When I use sip.js 0.20.0 to connect to asterisk, when I leave the browser tab for a long time, I cannot receive incoming calls, but I can make calls. How can I keep connected?

I think it should be possible to reconnect once when returning to the current tab, but what I want to know is whether it is possible to keep connected


Solution

  • What are you searching called SIP Ping.

    However, in most of modern browsers you can do nothing because your page is frozen and unloaded from memory to save resources.

    You can try ping other side in onFocus event and reconnect if ping fail.