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 cd85f4a2a7
commit b1359bdfcf
8 changed files with 51 additions and 49 deletions

View File

@@ -268,6 +268,23 @@ struct ast_app *pbx_findapp(const char *app);
*/
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data);
/*!
* \brief Execute an application
*
* \param c channel to execute on
* \param app name of app to execute
* \param data the data passed into the app
*
* This application executes an application by name on a given channel.
* It is a wrapper around pbx_exec that will perform variable substitution
* and then execute the application if it exists.
* If the application is not found, a warning is logged.
*
* \retval 0 success
* \retval -1 failure (including application not found)
*/
int ast_pbx_exec_application(struct ast_channel *chan, const char *app_name, const char *app_args);
/*!
* \brief Register a new context or find an existing one
*