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
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
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;