Review Board 1.7.16


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

Review Request #2488 - Created May 1, 2013 and submitted

Alec Davis
1.8 to trunk
ASTERISK-21742
Reviewers
asterisk-dev
Asterisk
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.

asterisk to phone.
Phone's Session-Expires: 120

[Apr 30 22:49:20] NOTICE[12686][C-00000000]: chan_sip.c:29006 start_session_timer: Session timer started: 104 - 50a7397219b8f47e192f74e81f3b125e@192.168.x.y:5060 88000ms
<<<<<  pull ethernet on phone >>
<<<<<  88 seconds later       >>
[Apr 30 22:50:48] WARNING[12686]: chan_sip.c:29042 proc_session_timer: Session-Timer expired - 50a7397219b8f47e192f74e81f3b125e@192.168.x.y:5060


Phone to Asterisk, No Session-Expires
Asterisk's Session-Expires: 300
[Apr 30 23:47:02] NOTICE[12857][C-00000001]: chan_sip.c:29006 start_session_timer: Session timer started: 99 - 7160947918a9977c@192.168.124.73 150000ms

Changes between revision 1 and 2

1 2
1 2

  1. branches/11/channels/chan_sip.c: Loading...
branches/11/channels/chan_sip.c
Diff Revision 1 Diff Revision 2
[20] 29022 lines
[+20] [+] static int proc_session_timer(const void *vp)
29023
			transmit_reinvite_with_sdp(p, TRUE, TRUE);
29023
			transmit_reinvite_with_sdp(p, TRUE, TRUE);
29024
		} else {
29024
		} else {
29025
			transmit_reinvite_with_sdp(p, FALSE, TRUE);
29025
			transmit_reinvite_with_sdp(p, FALSE, TRUE);
29026
		}
29026
		}
29027
	} else {
29027
	} else {
29028
		ast_log(LOG_WARNING, "Session-Timer expired - %s\n", p->callid);

   
29029
		if (p->stimer->quit_flag) {
29028
		if (p->stimer->quit_flag) {
29030
			goto return_unref;
29029
			goto return_unref;
29031
		}
29030
		}

    
   
29031
		ast_log(LOG_WARNING, "Session-Timer expired - %s\n", p->callid);
29032
		sip_pvt_lock(p);
29032
		sip_pvt_lock(p);
29033
		while (p->owner && ast_channel_trylock(p->owner)) {
29033
		while (p->owner && ast_channel_trylock(p->owner)) {
29034
			sip_pvt_unlock(p);
29034
			sip_pvt_unlock(p);
29035
			usleep(1);
29035
			usleep(1);
29036
			if (p->stimer && p->stimer->quit_flag) {
29036
			if (p->stimer && p->stimer->quit_flag) {
[+20] [20] 5 lines
[+20] static int proc_session_timer(const void *vp)
29042
		manager_event(EVENT_FLAG_CALL, "SessionTimeout", "Source: SIPSessionTimer\r\n"
29042
		manager_event(EVENT_FLAG_CALL, "SessionTimeout", "Source: SIPSessionTimer\r\n"
29043
				"Channel: %s\r\nUniqueid: %s\r\n", ast_channel_name(p->owner), ast_channel_uniqueid(p->owner));
29043
				"Channel: %s\r\nUniqueid: %s\r\n", ast_channel_name(p->owner), ast_channel_uniqueid(p->owner));
29044
		ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
29044
		ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
29045
		ast_channel_unlock(p->owner);
29045
		ast_channel_unlock(p->owner);
29046
		sip_pvt_unlock(p);
29046
		sip_pvt_unlock(p);
29047
		res = 1;

   
29048
	}
29047
	}
29049

    
   
29048

   
29050
return_unref:
29049
return_unref:
29051
	if (!res) {
29050
	if (!res) {
29052
		/* An error occurred.  Stop session timer processing */
29051
		/* An error occurred.  Stop session timer processing */
[+20] [20] 5619 lines
  1. branches/11/channels/chan_sip.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.