From: Richard Mudgett Date: Fri, 25 Jul 2014 23:13:48 +0000 (+0000) Subject: features.c: Allow appliationmap to use Gosub. X-Git-Tag: 11.12.0-rc1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c47641f0c7e1828ac7e384412e75f610e219898;p=thirdparty%2Fasterisk.git features.c: Allow appliationmap to use Gosub. Using DYNAMIC_FEATURES with a Gosub application as the mapped application does not work. It does not work because Gosub just pushes the current dialplan context, exten, and priority onto a stack and sets the specified Gosub location. Gosub does not have a dialplan execution loop to run dialplan like Macro. * Made the DYNAMIC_FEATURES application mapping feature call ast_app_exec_macro() and ast_app_exec_sub() for the Macro and Gosub applications respectively. * Backported ast_app_exec_macro() and ast_app_exec_sub() from v11 to execute dialplan routines from the DYNAMIC_FEATURES application mapping feature. NOTE: This issue does not affect v12+ because it already does what this patch implements. AST-1391 #close Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/3844/ ........ Merged revisions 419630 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@419631 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/features.c b/main/features.c index 6a044d9d2f..7473e20f3d 100644 --- a/main/features.c +++ b/main/features.c @@ -3526,7 +3526,13 @@ static int feature_exec_app(struct ast_channel *chan, struct ast_channel *peer, if (!ast_strlen_zero(feature->moh_class)) ast_moh_start(idle, feature->moh_class, NULL); - res = pbx_exec(work, app, feature->app_args); + if (!strcasecmp("Gosub", feature->app)) { + res = ast_app_exec_sub(NULL, work, feature->app_args, 0); + } else if (!strcasecmp("Macro", feature->app)) { + res = ast_app_exec_macro(NULL, work, feature->app_args); + } else { + res = pbx_exec(work, app, feature->app_args); + } if (!ast_strlen_zero(feature->moh_class)) ast_moh_stop(idle);