sofia-sip: extend timeout for session expires on short timeouts to be 90% of timeout instead of 1/3 to handle devices that do not refresh in time such as polycom (SFSIP-212)

This commit is contained in:
Michael Jerris 2010-05-31 09:50:44 -04:00
parent 52cd8cdd64
commit a7f4892887
2 changed files with 8 additions and 7 deletions

View File

@ -1 +1 @@
Mon May 31 08:54:37 EDT 2010 Mon May 31 09:47:08 EDT 2010

View File

@ -1552,6 +1552,7 @@ static void nua_session_usage_refresh(nua_handle_t *nh,
return; return;
if (ss->ss_timer->refresher == nua_remote_refresher) { if (ss->ss_timer->refresher == nua_remote_refresher) {
SU_DEBUG_3(("nua(%p): session almost expired, sending BYE before timeout.\n", (void *)nh));
ss->ss_reason = "SIP;cause=408;text=\"Session timeout\""; ss->ss_reason = "SIP;cause=408;text=\"Session timeout\"";
nua_stack_bye(nh->nh_nua, nh, nua_r_bye, NULL); nua_stack_bye(nh->nh_nua, nh, nua_r_bye, NULL);
return; return;
@ -4493,14 +4494,14 @@ session_timer_set(nua_session_usage_t *ss, int uas)
t->timer_set = 1; t->timer_set = 1;
} }
else if (t->refresher == nua_remote_refresher) { else if (t->refresher == nua_remote_refresher) {
/* if the side not performing refreshes does not receive a /* RFC 4028 10.3 and 10.4: Send BYE before the session expires.
session refresh request before the session expiration, it SHOULD send Increased interval from 2/3 to 9/10 of session expiration delay
a BYE to terminate the session, slightly before the session because some endpoints won't UPDATE early enough with very short
expiration. The minimum of 32 seconds and one third of the session sessions (e.g. 120). */
interval is RECOMMENDED. */
unsigned interval = t->interval; unsigned interval = t->interval;
interval -= 32 > interval / 3 ? interval / 3 : 32; interval -= 32 > interval / 10 ? interval / 10 : 32;
nua_dialog_usage_set_refresh_range(du, interval, interval); nua_dialog_usage_set_refresh_range(du, interval, interval);
t->timer_set = 1; t->timer_set = 1;