mirror of
https://github.com/asterisk/asterisk.git
synced 2026-05-05 12:53:45 +00:00
app_macro: Remove deprecated module.
For most modules that interacted with app_macro, this change is limited to no longer looking for the current context from the macrocontext when set. Additionally, the following modules are impacted: app_dial - no longer supports M^ connected/redirecting macro app_minivm - samples written using macro will no longer work. The sample needs a re-write app_queue - can no longer a macro on the called party's channel. Use gosub which is currently supported ccss - no callback macro, gosub only app_voicemail - no macro support channel - remove macrocontext and priority, no connected line or redirection macro options options - stdexten is deprecated to gosub as the default and only pbx - removed macrolock pbx_dundi - no longer look for macro snmp - removed macro context, exten, and priority ASTERISK-30304 Change-Id: I830daab293117179b8d61bd4df0d971a1b3d07f6
This commit is contained in:
committed by
Friendly Automation
parent
6ecec51e6a
commit
e8f548c155
70
main/app.c
70
main/app.c
@@ -267,76 +267,6 @@ int ast_app_getdata_full(struct ast_channel *c, const char *prompt, char *s, int
|
||||
return res;
|
||||
}
|
||||
|
||||
int ast_app_exec_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_args)
|
||||
{
|
||||
struct ast_app *macro_app;
|
||||
int res;
|
||||
|
||||
macro_app = pbx_findapp("Macro");
|
||||
if (!macro_app) {
|
||||
ast_log(LOG_WARNING,
|
||||
"Cannot run 'Macro(%s)'. The application is not available.\n", macro_args);
|
||||
return -1;
|
||||
}
|
||||
if (autoservice_chan) {
|
||||
ast_autoservice_start(autoservice_chan);
|
||||
}
|
||||
|
||||
ast_debug(4, "%s Original location: %s,%s,%d\n", ast_channel_name(macro_chan),
|
||||
ast_channel_context(macro_chan), ast_channel_exten(macro_chan),
|
||||
ast_channel_priority(macro_chan));
|
||||
|
||||
res = pbx_exec(macro_chan, macro_app, macro_args);
|
||||
ast_debug(4, "Macro exited with status %d\n", res);
|
||||
|
||||
/*
|
||||
* Assume anything negative from Macro is an error.
|
||||
* Anything else is success.
|
||||
*/
|
||||
if (res < 0) {
|
||||
res = -1;
|
||||
} else {
|
||||
res = 0;
|
||||
}
|
||||
|
||||
ast_debug(4, "%s Ending location: %s,%s,%d\n", ast_channel_name(macro_chan),
|
||||
ast_channel_context(macro_chan), ast_channel_exten(macro_chan),
|
||||
ast_channel_priority(macro_chan));
|
||||
|
||||
if (autoservice_chan) {
|
||||
ast_autoservice_stop(autoservice_chan);
|
||||
}
|
||||
|
||||
if (ast_check_hangup_locked(macro_chan)) {
|
||||
ast_queue_hangup(macro_chan);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
int ast_app_run_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_name, const char *macro_args)
|
||||
{
|
||||
int res;
|
||||
char *args_str;
|
||||
size_t args_len;
|
||||
|
||||
if (ast_strlen_zero(macro_args)) {
|
||||
return ast_app_exec_macro(autoservice_chan, macro_chan, macro_name);
|
||||
}
|
||||
|
||||
/* Create the Macro application argument string. */
|
||||
args_len = strlen(macro_name) + strlen(macro_args) + 2;
|
||||
args_str = ast_malloc(args_len);
|
||||
if (!args_str) {
|
||||
return -1;
|
||||
}
|
||||
snprintf(args_str, args_len, "%s,%s", macro_name, macro_args);
|
||||
|
||||
res = ast_app_exec_macro(autoservice_chan, macro_chan, args_str);
|
||||
ast_free(args_str);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* BUGBUG this is not thread safe. */
|
||||
static const struct ast_app_stack_funcs *app_stack_callbacks;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user