mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Add option to invoke the extensions.conf stdexten using the legacy macro method.
ASTERISK-18809 eliminated the legacy macro invocation of the stdexten in favor of the Gosub method without a means of backwards compatibility. (issue ASTERISK-18809) (closes issue ASTERISK-19457) Reported by: Matt Jordan Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/1855/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -92,7 +92,8 @@ chan_unistim
|
||||
users.conf:
|
||||
- A defined user with hasvoicemail=yes now finally uses a Gosub to stdexten
|
||||
as documented in extensions.conf.sample since v1.6.0 instead of a Macro as
|
||||
documented in v1.4.
|
||||
documented in v1.4. Set the asterisk.conf stdexten=macro parameter to
|
||||
invoke the stdexten the old way.
|
||||
|
||||
From 1.8 to 10:
|
||||
|
||||
|
@@ -74,6 +74,12 @@ documentation_language = en_US ; Set the language you want documentation
|
||||
;lockconfdir = no ; Protect the directory containing the
|
||||
; configuration files (/etc/asterisk) with a
|
||||
; lock.
|
||||
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
|
||||
; macro - Invoke the stdexten using a macro as
|
||||
; done by legacy Asterisk versions.
|
||||
; gosub - Invoke the stdexten using a gosub as
|
||||
; documented in extensions.conf.sample.
|
||||
; Default gosub.
|
||||
|
||||
; Changing the following lines may compromise your security.
|
||||
;[files]
|
||||
|
@@ -58,6 +58,8 @@ enum ast_option_flags {
|
||||
AST_OPT_FLAG_FULLY_BOOTED = (1 << 9),
|
||||
/*! Trascode via signed linear */
|
||||
AST_OPT_FLAG_TRANSCODE_VIA_SLIN = (1 << 10),
|
||||
/*! Invoke the stdexten using the legacy macro method. */
|
||||
AST_OPT_FLAG_STDEXTEN_MACRO = (1 << 11),
|
||||
/*! Dump core on a seg fault */
|
||||
AST_OPT_FLAG_DUMP_CORE = (1 << 12),
|
||||
/*! Cache sound files */
|
||||
@@ -116,6 +118,8 @@ enum ast_option_flags {
|
||||
#define ast_opt_no_color ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR)
|
||||
#define ast_fully_booted ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)
|
||||
#define ast_opt_transcode_via_slin ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN)
|
||||
/*! Invoke the stdexten using the legacy macro method. */
|
||||
#define ast_opt_stdexten_macro ast_test_flag(&ast_options, AST_OPT_FLAG_STDEXTEN_MACRO)
|
||||
#define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE)
|
||||
#define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES)
|
||||
#define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP)
|
||||
|
@@ -3230,6 +3230,18 @@ static void ast_readconfig(void)
|
||||
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_HIDE_CONSOLE_CONNECT);
|
||||
} else if (!strcasecmp(v->name, "lockconfdir")) {
|
||||
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_LOCK_CONFIG_DIR);
|
||||
} else if (!strcasecmp(v->name, "stdexten")) {
|
||||
/* Choose how to invoke the extensions.conf stdexten */
|
||||
if (!strcasecmp(v->value, "gosub")) {
|
||||
ast_clear_flag(&ast_options, AST_OPT_FLAG_STDEXTEN_MACRO);
|
||||
} else if (!strcasecmp(v->value, "macro")) {
|
||||
ast_set_flag(&ast_options, AST_OPT_FLAG_STDEXTEN_MACRO);
|
||||
} else {
|
||||
ast_log(LOG_WARNING,
|
||||
"'%s' is not a valid setting for the stdexten option, defaulting to 'gosub'\n",
|
||||
v->value);
|
||||
ast_clear_flag(&ast_options, AST_OPT_FLAG_STDEXTEN_MACRO);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (v = ast_variable_browse(cfg, "compat"); v; v = v->next) {
|
||||
|
@@ -1753,8 +1753,14 @@ static void pbx_load_users(void)
|
||||
ast_add_extension2(con, 0, cat, -1, NULL, NULL, iface, NULL, NULL, registrar);
|
||||
/* If voicemail, use "stdexten" else use plain old dial */
|
||||
if (hasvoicemail) {
|
||||
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);
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
} else {
|
||||
ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", ast_strdup("${HINT}"), ast_free_ptr, registrar);
|
||||
}
|
||||
|
Reference in New Issue
Block a user