chan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval when not the refresher

RFC 4028 Section 10
	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.

Prior to this asterisk would refresh at 1/2 the Session-Expires interval,
or if the remote device was the refresher, asterisk would timeout at interval end.

Now, when not refresher, timeout as per RFC noted above.

(closes issue ASTERISK-21742)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2488/
........

Merged revisions 387344 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387345 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Alec L Davis
2013-05-02 08:24:31 +00:00
parent 7f0f53958b
commit f7f58b7bc2
2 changed files with 36 additions and 27 deletions

View File

@@ -968,7 +968,6 @@ struct sip_st_dlg {
int st_interval; /*!< Session-Timers negotiated session refresh interval */
enum st_refresher st_ref; /*!< Session-Timers cached refresher */
int st_schedid; /*!< Session-Timers ast_sched scheduler id */
int st_expirys; /*!< Session-Timers number of expirys */
int st_active_peer_ua; /*!< Session-Timers on/off in peer UA */
int st_cached_min_se; /*!< Session-Timers cached Min-SE */
int st_cached_max_se; /*!< Session-Timers cached Session-Expires */