Review Board 1.7.16


Asterisk doesn't honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk is the refresher.

Review Request #2463 - Created April 22, 2013 and submitted

Alec Davis
1.8 to trunk
ASTERISK-21664
Reviewers
asterisk-dev
Asterisk
Refer to:
RFC 4028 Section 7.2
 "UACs MUST be prepared to receive a Session-Expires header field in a
 response, even if none were present in the request." 

Senario's below have 'Supported: timer' header: value
Prior to since ASTERISK-20787
  Devices making an inbound call to asterisk that didn't include a Session-Expires header in the INVITE, wouldn't be refreshed, thus wouldn't clear down should the connection be broken.

After ASTERISK-20787
  Inbound calls to asterisk with no Session-Expires in the INVITE are now are offered a Session-Expires (1800 asterisk default) in the response, with asterisk being the refresher.
  The issue is after the first RE-INVITE from asterisk (900 seconds), the device may respond with a much lower Session-Expires (180 in our case) value that it is now using.
  Asterisk ignores this response, as it's deemed both an INBOUND CALL, and a RE-INVITE.
  The result, after 180 more seconds the device is going to time out and hangup, asterisk is still working with the refresher period of 1800 as it ignored the 'Session Expires: 180' in the previous 200OK response.
 

 

Diff revision 1 (Latest)

  1. branches/1.8/channels/chan_sip.c: Loading...
branches/1.8/channels/chan_sip.c
Revision 386047 New Change
[20] 20948 lines
[+20] [+] static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, uint32_t seqno)
20949
			if (!req->ignore)
20949
			if (!req->ignore)
20950
				ast_set_flag(&p->flags[0], SIP_PENDINGBYE);	
20950
				ast_set_flag(&p->flags[0], SIP_PENDINGBYE);	
20951
		}
20951
		}
20952

    
   
20952

   
20953
		/* Check for Session-Timers related headers */
20953
		/* Check for Session-Timers related headers */
20954
		if (st_get_mode(p, 0) != SESSION_TIMER_MODE_REFUSE && p->outgoing_call == TRUE && !reinvite) {
20954
		if (st_get_mode(p, 0) != SESSION_TIMER_MODE_REFUSE) {
20955
			p_hdrval = (char*)get_header(req, "Session-Expires");
20955
			p_hdrval = (char*)get_header(req, "Session-Expires");
20956
			if (!ast_strlen_zero(p_hdrval)) {
20956
			if (!ast_strlen_zero(p_hdrval)) {
20957
				/* UAS supports Session-Timers */
20957
				/* UAS supports Session-Timers */
20958
				enum st_refresher_param st_ref_param;
20958
				enum st_refresher_param st_ref_param;
20959
				int tmp_st_interval = 0;
20959
				int tmp_st_interval = 0;
[+20] [20] 11066 lines
  1. branches/1.8/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.