Author: mikej Date: Wed Feb 11 11:20:59 2009 New Revision: 11861 Log: Wed Jan 28 12:32:01 CST 2009 Mikhail Zabaluev <mikhail.zabaluev@nokia.com> * nua/outbound.c: calculate the keepalive timer interval with regard to the maximum defer interval The point is not to miss the keepalive deadlines. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Wed Feb 11 11:20:59 2009 @@ -1 +1 @@ -Wed Feb 11 11:19:42 CST 2009 +Wed Feb 11 11:20:46 CST 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c Wed Feb 11 11:20:59 2009 @@ -685,8 +685,16 @@ su_timer_destroy(ob->ob_keepalive.timer), ob->ob_keepalive.timer = NULL; if (interval) { + su_duration_t max_defer; + + max_defer = su_root_get_max_defer(ob->ob_root); + if ((su_duration_t)interval >= max_defer) { + interval -= max_defer - 100; + } + ob->ob_keepalive.timer = su_timer_create(su_root_task(ob->ob_root), interval); + su_timer_deferrable(ob->ob_keepalive.timer, 1); }