keep-alive?

509 views
Skip to first unread message

SD

unread,
Oct 1, 2015, 9:46:34 AM10/1/15
to SIP.js
Hi
Does anyone have any recommendations on how to achieve a keep-alive mechanism?

The issue I am attempting to address is when USER1 calls USER2 through my network, and sometime mid call, USER1 looses network connection unexpectedly, or looses power... and USER2 is left in an in-call state that cannot be recovered and requires him to manually terminate the call.

I have been experimenting with periodically sending a custom keep-alive message every 20 seconds or so with the MESSAGING feature, and in the event of the remote party not receiving 3 or more of them,  then programatically terminating the call..

This mechanism has been mostly working, but I have seen some unexpected results and looking for recommendations on best way to really achieve this.

Thanks in advance

Joseph Frazier

unread,
Oct 1, 2015, 9:52:13 AM10/1/15
to sip...@googlegroups.com
Hi SD,

Version 0.7.1 includes partial support for sending keep-alives, as described here: https://github.com/onsip/SIP.js/pull/190

Support for detecting keep-alive timeout has been added to the master branch, but isn't yet in a tagged release: https://github.com/onsip/SIP.js/pull/195

Hope this helps,
Joseph

--
You received this message because you are subscribed to the Google Groups "SIP.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sip_js+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sip_js/40ccbac7-37f1-4e7b-b984-57a3c87f6696%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SD

unread,
Oct 1, 2015, 10:21:55 AM10/1/15
to SIP.js
Thanks Joseph!!

This looks very promising.  I would like to start testing this immediately.  If I build from MASTER branch ... What do I need to do to activate it and use it?

I assume I just set "keepAliveInterval" in the UA configuration and then listen for "keepAliveTimeout" on the Session object?

Do I need to do anything with the  sendKeepAlive, startSendingKeepAlives, and stopSendingKeepAlives on the  Transport or are these 'internal'?

thanks!

Joseph Frazier

unread,
Oct 1, 2015, 10:45:15 AM10/1/15
to sip...@googlegroups.com
After reading your original message again, I realized you're actually looking for an end-to-end keep-alive mechanism, whereas the solution I outlined previously is only between a single client and the server. It sounds like Session Timers would suit your needs. SIP.js doesn't yet have full support for those (see https://github.com/onsip/SIP.js/issues/18 and linked issues), but you might be able to make things work if you can configure your server to send the refreshes.

SD

unread,
Oct 1, 2015, 11:07:16 AM10/1/15
to SIP.js
Thanks Joseph,

As I am testing this I started to realize the same...

I was able to turn on your keep alive... which seems to be for the UA to the server.

I receive the following in the log

sip-0.7.1-devel.js?v=1443710339966:2853 Thu Oct 01 2015 10:41:00 GMT-0400 (EDT) | sip.transport | sending WebSocket message:





sip-0.7.1-devel.js?v=1443710339966:2853 Thu Oct 01 2015 10:41:00 GMT-0400 (EDT) | sip.transport | received WebSocket message with CRLF Keep Alive response
sip-0.7.1-devel.js?v=1443710339966:2853 Thu Oct 01 2015 10:41:09 GMT-0400 (EDT) | sip.transport | sending WebSocket message:





sip-0.7.1-devel.js?v=1443710339966:2853 Thu Oct 01 2015 10:41:09 GMT-0400 (EDT) | sip.transport | received WebSocket message with CRLF Keep Alive response
sip-0.7.1-devel.js?v=1443710339966:2853 Thu Oct 01 2015 10:41:18 GMT-0400 (EDT) | sip.transport | sending WebSocket message:





sip-0.7.1-devel.js?v=1443710339966:2853 Thu Oct 01 2015 10:41:18 GMT-0400 (EDT) | sip.transport | received WebSocket message with CRLF Keep Alive response
sip-0.7.1-devel.js?v=1443710339966:2853 Thu Oct 01 2015 10:41:26 GMT-0400 (EDT) | sip.transport | sending WebSocket message:

However, I am not able to get an event if there is actually a local disconnection.
I listened for the  "keepAliveTimeout" on both the UA and the session and they tried disconnecting local Ethernet connection.


YES, I am really looking for an END to END keep alive.   I am not sure how to leverage what you have with issue 18.

Thanks

SD

unread,
Oct 1, 2015, 11:12:50 AM10/1/15
to SIP.js
What do you think about listening for the 

objSession.mediaHandler.on('iceConnectionClosed', function ()  {});

and forcing a session termination on that?

thanks
Message has been deleted

chaitra...@gmail.com

unread,
Dec 10, 2015, 5:38:42 AM12/10/15
to SIP.js
I have been working on same issue and trying to find out the way out. Can anybody please provide any pointer in this regard.

-Chaitral

Reply all
Reply to author
Forward
0 new messages