pbx: Add helper function to execute applications.

Finding an application and executing it if found is
a common task throughout Asterisk. This adds a helper
function around pbx_exec to do this, to eliminate
redundant code and make it easier for modules to
substitute variables and execute applications by name.

ASTERISK-30061 #close

Change-Id: Ifee4d2825df7545fb515d763d393065675140c84
This commit is contained in:
Naveen Albert
2022-05-15 12:41:06 +00:00
committed by Kevin Harwell
parent d052418b94
commit 4a11ae7ecf
8 changed files with 51 additions and 49 deletions

View File

@@ -504,12 +504,7 @@ static void bridge_check_monitor(struct ast_channel *chan, struct ast_channel *p
ast_channel_unlock(peer);
}
if (monitor_chan) {
struct ast_app *monitor_app;
monitor_app = pbx_findapp("Monitor");
if (monitor_app) {
pbx_exec(monitor_chan, monitor_app, monitor_args);
}
ast_pbx_exec_application(monitor_chan, "Monitor", monitor_args);
}
}