return;
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\"";
nua_stack_bye(nh->nh_nua, nh, nua_r_bye, NULL);
return;
t->timer_set = 1;
}
else if (t->refresher == nua_remote_refresher) {
- /* if the side not performing refreshes does not receive a
- session refresh request before the session expiration, it SHOULD send
- a BYE to terminate the session, slightly before the session
- expiration. The minimum of 32 seconds and one third of the session
- interval is RECOMMENDED. */
+ /* RFC 4028 10.3 and 10.4: Send BYE before the session expires.
+ Increased interval from 2/3 to 9/10 of session expiration delay
+ because some endpoints won't UPDATE early enough with very short
+ sessions (e.g. 120). */
+
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);
t->timer_set = 1;