mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	chan_pjsip: disallow PJSIP_SEND_SESSION_REFRESH pre-answer execution
This patch makes it so if the PJSIP_SEND_SESSION_REFRESH dialplan function is called on a channel prior to answering a warning is issued and the function returns unsuccessful. ASTERISK-28878 #close Change-Id: I053f767d10cf3b2b898fa9e3e7c35ff07e23c9bb
This commit is contained in:
		| @@ -1680,6 +1680,11 @@ int pjsip_acf_session_refresh_write(struct ast_channel *chan, const char *cmd, c | ||||
| 		return -1; | ||||
| 	} | ||||
|  | ||||
| 	if (ast_channel_state(chan) != AST_STATE_UP) { | ||||
| 		ast_log(LOG_WARNING, "'%s' not allowed on unanswered channel '%s'.\n", cmd, ast_channel_name(chan)); | ||||
| 		return -1; | ||||
| 	} | ||||
|  | ||||
| 	if (strcmp(ast_channel_tech(chan)->type, "PJSIP")) { | ||||
| 		ast_log(LOG_WARNING, "Cannot call %s on a non-PJSIP channel\n", cmd); | ||||
| 		return -1; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user