mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	AST-2021-007 - res_pjsip_session: Don't offer if no channel exists.
If a re-INVITE is received after we have sent a BYE request then it
is possible for no channel to be present on the session. If this
occurs we allow PJSIP to produce the offer instead. Since the call
is being hung up if it produces an incorrect offer it doesn't
actually matter. This also ensures that code which produces SDP
does not need to handle if a channel is not present.
ASTERISK-29381
Change-Id: I673cb88c432f38f69b2e0851d55cc57a62236042
(cherry picked from commit 523a795289)
			
			
This commit is contained in:
		
				
					committed by
					
						 Friendly Automation
						Friendly Automation
					
				
			
			
				
	
			
			
			
						parent
						
							151bdbc658
						
					
				
				
					commit
					45af7e9984
				
			| @@ -5263,6 +5263,16 @@ static void session_inv_on_create_offer(pjsip_inv_session *inv, pjmedia_sdp_sess | ||||
| 	pjmedia_sdp_session *offer; | ||||
| 	int i; | ||||
|  | ||||
| 	/* We allow PJSIP to produce an SDP if no channel is present. This may result | ||||
| 	 * in an incorrect SDP occurring, but if no channel is present then we are in | ||||
| 	 * the midst of a BYE and are hanging up. This ensures that all the code to | ||||
| 	 * produce an SDP doesn't need to worry about a channel being present or not, | ||||
| 	 * just in case. | ||||
| 	 */ | ||||
| 	if (!session->channel) { | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	if (inv->neg) { | ||||
| 		if (pjmedia_sdp_neg_was_answer_remote(inv->neg)) { | ||||
| 			pjmedia_sdp_neg_get_active_remote(inv->neg, &previous_sdp); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user