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:
Mike Bradeen
2022-12-12 10:12:57 -07:00
committed by Friendly Automation
parent 6ecec51e6a
commit e8f548c155
52 changed files with 143 additions and 1615 deletions

View File

@@ -98,10 +98,8 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals);
void check_switch_expr(pval *item, struct argapp *apps);
void ast_expr_register_extra_error_info(char *errmsg);
void ast_expr_clear_extra_error_info(void);
struct pval *find_macro(char *name);
struct pval *find_context(char *name);
struct pval *find_context(char *name);
struct pval *find_macro(char *name);
struct ael_priority *new_prio(void);
struct ael_extension *new_exten(void);
void destroy_extensions(struct ael_extension *exten);
@@ -199,10 +197,10 @@ static char *handle_cli_ael_set_debug(struct ast_cli_entry *e, int cmd, struct a
{
switch (cmd) {
case CLI_INIT:
e->command = "ael set debug {read|tokens|macros|contexts|off}";
e->command = "ael set debug {read|tokens|contexts|off}";
e->usage =
"Usage: ael set debug {read|tokens|macros|contexts|off}\n"
" Enable AEL read, token, macro, or context debugging,\n"
"Usage: ael set debug {read|tokens|contexts|off}\n"
" Enable AEL read, token, or context debugging,\n"
" or disable all AEL debugging messages. Note: this\n"
" currently does nothing.\n";
return NULL;
@@ -217,8 +215,6 @@ static char *handle_cli_ael_set_debug(struct ast_cli_entry *e, int cmd, struct a
aeldebug |= DEBUG_READ;
else if (!strcasecmp(a->argv[3], "tokens"))
aeldebug |= DEBUG_TOKENS;
else if (!strcasecmp(a->argv[3], "macros"))
aeldebug |= DEBUG_MACROS;
else if (!strcasecmp(a->argv[3], "contexts"))
aeldebug |= DEBUG_CONTEXTS;
else if (!strcasecmp(a->argv[3], "off"))

View File

@@ -2053,14 +2053,8 @@ static void pbx_load_users(void)
ast_add_extension2(con, 0, cat, -1, NULL, NULL, iface, NULL, NULL, registrar, NULL, 0);
/* If voicemail, use "stdexten" else use plain old dial */
if (hasvoicemail) {
if (ast_opt_stdexten_macro) {
/* Use legacy stdexten macro method. */
snprintf(tmp, sizeof(tmp), "stdexten,%s,${HINT}", cat);
ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Macro", ast_strdup(tmp), ast_free_ptr, registrar, NULL, 0);
} else {
snprintf(tmp, sizeof(tmp), "%s,stdexten(${HINT})", cat);
ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Gosub", ast_strdup(tmp), ast_free_ptr, registrar, NULL, 0);
}
snprintf(tmp, sizeof(tmp), "%s,stdexten(${HINT})", cat);
ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Gosub", ast_strdup(tmp), ast_free_ptr, registrar, NULL, 0);
} else {
ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", ast_strdup("${HINT}"), ast_free_ptr, registrar, NULL, 0);
}

View File

@@ -4786,29 +4786,9 @@ static int dundi_helper(struct ast_channel *chan, const char *context, const cha
int res;
int x;
int found = 0;
if (!strncasecmp(context, "macro-", 6)) {
if (!chan) {
ast_log(LOG_NOTICE, "Can't use macro mode without a channel!\n");
return -1;
}
/* If done as a macro, use macro extension */
if (!strcasecmp(exten, "s")) {
exten = pbx_builtin_getvar_helper(chan, "ARG1");
if (ast_strlen_zero(exten))
exten = ast_channel_macroexten(chan);
if (ast_strlen_zero(exten))
exten = ast_channel_exten(chan);
if (ast_strlen_zero(exten)) {
ast_log(LOG_WARNING, "Called in Macro mode with no ARG1 or MACRO_EXTEN?\n");
return -1;
}
}
if (ast_strlen_zero(data))
data = "e164";
} else {
if (ast_strlen_zero(data))
data = context;
}
if (ast_strlen_zero(data))
data = context;
res = dundi_lookup(results, MAX_RESULTS, chan, data, exten, 0);
for (x=0;x<res;x++) {
if (ast_test_flag(results + x, flag))
@@ -4838,29 +4818,9 @@ static int dundi_exec(struct ast_channel *chan, const char *context, const char
const char *dundiargs;
struct ast_app *dial;
if (!strncasecmp(context, "macro-", 6)) {
if (!chan) {
ast_log(LOG_NOTICE, "Can't use macro mode without a channel!\n");
return -1;
}
/* If done as a macro, use macro extension */
if (!strcasecmp(exten, "s")) {
exten = pbx_builtin_getvar_helper(chan, "ARG1");
if (ast_strlen_zero(exten))
exten = ast_channel_macroexten(chan);
if (ast_strlen_zero(exten))
exten = ast_channel_exten(chan);
if (ast_strlen_zero(exten)) {
ast_log(LOG_WARNING, "Called in Macro mode with no ARG1 or MACRO_EXTEN?\n");
return -1;
}
}
if (ast_strlen_zero(data))
data = "e164";
} else {
if (ast_strlen_zero(data))
data = context;
}
if (ast_strlen_zero(data))
data = context;
res = dundi_lookup(results, MAX_RESULTS, chan, data, exten, 0);
if (res > 0) {
sort_results(results, res);