summaryrefslogtreecommitdiff
path: root/main/bridge_channel.c
diff options
context:
space:
mode:
authorMichael L. Young <elgueromexicano@gmail.com>2014-07-22 20:22:36 +0000
committerMichael L. Young <elgueromexicano@gmail.com>2014-07-22 20:22:36 +0000
commitf613fc24fb441f7447894e3b437256736475d116 (patch)
tree6b33bec0d5d9f8e5b91ec3f73fcb4ddf841da2e7 /main/bridge_channel.c
parent20cb961b3ed3d5890a88a0cac6c9ba5dbda6570e (diff)
core/bridge_channel: Substitute Variables In Features Application Map
Say you wanted to include variables in an application map and have those variables substituted and passed along to the application being executed; currently this does not happen. This patch adds this ability to pass channel variable values to an application before being executed. ASTERISK-22608 #close Reported by: Michael L. Young patches: features_substitute_arguments_v2.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/3819/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419252 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/bridge_channel.c')
-rw-r--r--main/bridge_channel.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index ea9b3f868..5c2e56241 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -1020,7 +1020,16 @@ static int run_app_helper(struct ast_channel *chan, const char *app_name, const
if (!app) {
ast_log(LOG_WARNING, "Could not find application (%s)\n", app_name);
} else {
- res = pbx_exec(chan, app, app_args);
+ struct ast_str *substituted_args = ast_str_create(16);
+
+ if (substituted_args) {
+ ast_str_substitute_variables(&substituted_args, 0, chan, app_args);
+ res = pbx_exec(chan, app, ast_str_buffer(substituted_args));
+ ast_free(substituted_args);
+ } else {
+ ast_log(LOG_WARNING, "Could not substitute application argument variables for %s\n", app_name);
+ res = pbx_exec(chan, app, app_args);
+ }
}
}
return res;