apps/app_selective.c
static int exec_app(struct ast_channel *chan, const char *app_name, const char *app_args)
{
	int res = 0;
	struct ast_app *app;

	app = pbx_findapp(app_name);
	if (!app) {
		ast_log(LOG_WARNING, "Could not find application (%s)\n", app_name);
	} else {
		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;
}
/*! \todo make this part of the core instead (move from bridge file into public API) */
\todo make this part of the core instead (move from bridge file into public API)
\ todo make this part of the core instead ( move from bridge file into public API )
static int exec_app(struct ast_channel *chan, const char *app_name, const char *app_args)
{
	int res = 0;
	struct ast_app *app;
	app = pbx_findapp(app_name);
	if (!app) {
		ast_log(LOG_WARNING, "Could not find application (%s)\n", app_name);
	} else {
		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;
}
static int exec_app ( struct ast_channel * chan , const char * app_name , const char * app_args ) { int res = 0 ; struct ast_app * app ; app = pbx_findapp ( app_name ) ; if ( ! app ) { ast_log ( LOG_WARNING , " \n " , app_name ) ; } else { 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 , " \n " , app_name ) ; res = pbx_exec ( chan , app , app_args ) ; } } return res ; }
\todo make this part of the core instead (move from bridge file into public API)
\ todo make this part of the core instead ( move from bridge file into public API )