mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Fix crash due to trying to send a re-invite while in the incorrect state.
This crash would occur if a re-invite was queued while the initial INVITE transaction was still occurring and the response to the INVITE was not ACKed. This lack of ACK would cause the INVITE session state to never reach confirmed. Once the transaction terminated, however, the queued re-invite would occur and cause a crash due to this lack of state change. This fix checks the INVITE session state before performing the re-invite to ensure it is in the required confirmed state. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -716,11 +716,20 @@ int ast_sip_session_refresh(struct ast_sip_session *session, | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	if ((method == AST_SIP_SESSION_REFRESH_METHOD_INVITE) && inv_session->invite_tsx) { | ||||
| 		/* We can't send a reinvite yet, so delay it */ | ||||
| 		ast_debug(3, "Delaying sending reinvite to %s because of outstanding transaction...\n", | ||||
| 				ast_sorcery_object_get_id(session->endpoint)); | ||||
| 		return delay_request(session, on_request_creation, on_response, "INVITE", NULL); | ||||
| 	if (method == AST_SIP_SESSION_REFRESH_METHOD_INVITE) { | ||||
| 		if (inv_session->invite_tsx) { | ||||
| 			/* We can't send a reinvite yet, so delay it */ | ||||
| 			ast_debug(3, "Delaying sending reinvite to %s because of outstanding transaction...\n", | ||||
| 					ast_sorcery_object_get_id(session->endpoint)); | ||||
| 			return delay_request(session, on_request_creation, on_response, "INVITE", NULL); | ||||
| 		} else if (inv_session->state != PJSIP_INV_STATE_CONFIRMED) { | ||||
| 			/* Initial INVITE transaction failed to progress us to a confirmed state | ||||
| 			 * which means re-invites are not possible | ||||
| 			 */ | ||||
| 			ast_debug(3, "Not sending reinvite to %s because not in confirmed state...\n", | ||||
| 					ast_sorcery_object_get_id(session->endpoint)); | ||||
| 			return 0; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (generate_new_sdp) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user