mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Allow non-normal execution routines to be able to run on hungup channels.
* Make non-normal dialplan execution routines be able to run on a hung up channel. This is preparation work for hangup handler routines. * Fixed ability to support relative non-normal dialplan execution routines. (i.e., The context and exten are optional for the specified dialplan location.) Predial routines are the only non-normal routines that it makes sense to optionally omit the context and exten. Setting a hangup handler also needs this ability. * Fix Return application being able to restore a dialplan location exactly. Channels without a PBX may not have context or exten set. * Fixes non-normal execution routines like connected line interception and predial leaving the dialplan execution stack unbalanced. Errors like missing Return statements, popping too many stack frames using StackPop, or an application returning non-zero could leave the dialplan stack unbalanced. * Fixed the AGI gosub application so it cleans up the dialplan execution stack and handles the autoloop priority increments correctly. * Eliminated the need for the gosub_virtual_context return location. Review: https://reviewboard.asterisk.org/r/1984/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -2280,7 +2280,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast | ||||
| 	if (ast_test_flag64(&opts, OPT_PREDIAL_CALLER) | ||||
| 		&& !ast_strlen_zero(opt_args[OPT_ARG_PREDIAL_CALLER])) { | ||||
| 		ast_replace_subargument_delimiter(opt_args[OPT_ARG_PREDIAL_CALLER]); | ||||
| 		ast_app_exec_sub(NULL, chan, opt_args[OPT_ARG_PREDIAL_CALLER]); | ||||
| 		ast_app_exec_sub(NULL, chan, opt_args[OPT_ARG_PREDIAL_CALLER], 0); | ||||
| 	} | ||||
|  | ||||
| 	/* loop through the list of dial destinations */ | ||||
| @@ -2550,12 +2550,18 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast | ||||
| 	if (ast_test_flag64(&opts, OPT_PREDIAL_CALLEE) | ||||
| 		&& !ast_strlen_zero(opt_args[OPT_ARG_PREDIAL_CALLEE]) | ||||
| 		&& !AST_LIST_EMPTY(&out_chans)) { | ||||
| 		ast_autoservice_start(chan); | ||||
| 		const char *predial_callee; | ||||
|  | ||||
| 		ast_replace_subargument_delimiter(opt_args[OPT_ARG_PREDIAL_CALLEE]); | ||||
| 		AST_LIST_TRAVERSE(&out_chans, tmp, node) { | ||||
| 			ast_pre_call(tmp->chan, opt_args[OPT_ARG_PREDIAL_CALLEE]); | ||||
| 		predial_callee = ast_app_expand_sub_args(chan, opt_args[OPT_ARG_PREDIAL_CALLEE]); | ||||
| 		if (predial_callee) { | ||||
| 			ast_autoservice_start(chan); | ||||
| 			AST_LIST_TRAVERSE(&out_chans, tmp, node) { | ||||
| 				ast_pre_call(tmp->chan, predial_callee); | ||||
| 			} | ||||
| 			ast_autoservice_stop(chan); | ||||
| 			ast_free((char *) predial_callee); | ||||
| 		} | ||||
| 		ast_autoservice_stop(chan); | ||||
| 	} | ||||
|  | ||||
| 	/* Start all outgoing calls */ | ||||
| @@ -2884,7 +2890,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast | ||||
| 				} | ||||
| 			} | ||||
| 			if (gosub_args) { | ||||
| 				res9 = ast_app_exec_sub(chan, peer, gosub_args); | ||||
| 				res9 = ast_app_exec_sub(chan, peer, gosub_args, 0); | ||||
| 				ast_free(gosub_args); | ||||
| 			} else { | ||||
| 				ast_log(LOG_ERROR, "Could not Allocate string for Gosub arguments -- Gosub Call Aborted!\n"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user