mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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:
committed by
Kevin Harwell
parent
d052418b94
commit
4a11ae7ecf
@@ -263,14 +263,8 @@ static struct ast_channel_tech snoop_tech = {
|
||||
static void *snoop_stasis_thread(void *obj)
|
||||
{
|
||||
RAII_VAR(struct stasis_app_snoop *, snoop, obj, ao2_cleanup);
|
||||
struct ast_app *stasis = pbx_findapp("Stasis");
|
||||
|
||||
if (!stasis) {
|
||||
ast_hangup(snoop->chan);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pbx_exec(snoop->chan, stasis, ast_str_buffer(snoop->app));
|
||||
ast_pbx_exec_application(snoop->chan, "Stasis", ast_str_buffer(snoop->app));
|
||||
|
||||
ast_hangup(snoop->chan);
|
||||
|
||||
|
Reference in New Issue
Block a user