summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--main/bridge_channel.c11
2 files changed, 13 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index c6957d3e0..788a1141c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -137,6 +137,9 @@ Features
features were provided exclusively by the caller of ast_bridge_join()
outside of "basic" type bridges.
+ * Channel variables are now substituted in arguments passed to applications
+ run by using dynamic features.
+
JACK_HOOK
------------------
* The JACK_HOOK function now supports audio with a sample rate higher than
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;