Commit 5841ae7248 for asterisk.org
commit 5841ae7248b2c1b0abd09c55395b9f4bd26f5bc3
Author: Sean Bright <sean@seanbright.com>
Date: Wed Sep 23 19:58:41 2026 +0000
file.c: Remove long-deprecated `languageprefix` option
This was deprecated in afbfafa4 on 2006-12-27.
UpgradeNote: The `languageprefix` configuration parameter in
`asterisk.conf`, deprecated in 2006, as been removed. The sounds path
will now always include the language prefix.
diff --git a/configs/samples/asterisk.conf.sample b/configs/samples/asterisk.conf.sample
index 1ce0d10787..77352bcb6b 100644
--- a/configs/samples/asterisk.conf.sample
+++ b/configs/samples/asterisk.conf.sample
@@ -34,7 +34,6 @@ astsbindir => /usr/sbin
;nocolor = yes ; Disable console colors.
;dontwarn = yes ; Disable some warnings.
;dumpcore = yes ; Dump core on crash (same as -g at startup).
-;languageprefix = yes ; Use the new sound prefix path syntax.
;systemname = my_system_name ; Prefix uniqueid with a system name for
; Global uniqueness issues.
;autosystemname = yes ; Automatically set systemname to hostname,
diff --git a/include/asterisk/options.h b/include/asterisk/options.h
index 1512a86348..eda758519c 100644
--- a/include/asterisk/options.h
+++ b/include/asterisk/options.h
@@ -213,8 +213,6 @@ extern pid_t ast_mainpid;
extern char record_cache_dir[AST_CACHE_DIR_LEN];
-extern int ast_language_is_prefix;
-
extern int ast_option_rtpusedynamic;
extern unsigned int ast_option_rtpptdynamic;
diff --git a/main/asterisk.c b/main/asterisk.c
index b398060afb..544b22fe9e 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -539,7 +539,6 @@ static char *handle_show_settings(struct ast_cli_entry *e, int cmd, struct ast_c
ast_cli(a->fd, " Entity ID: %s\n", eid_str);
ast_cli(a->fd, " PBX UUID: %s\n", pbx_uuid);
ast_cli(a->fd, " Default language: %s\n", ast_defaultlanguage);
- ast_cli(a->fd, " Language prefix: %s\n", ast_language_is_prefix ? "Enabled" : "Disabled");
ast_cli(a->fd, " User name and group: %s/%s\n", ast_config_AST_RUN_USER, ast_config_AST_RUN_GROUP);
#if defined(HAVE_EACCESS) || defined(HAVE_EUIDACCESS)
#if defined(HAVE_EUIDACCESS) && !defined(HAVE_EACCESS)
@@ -3878,10 +3877,6 @@ int main(int argc, char *argv[])
}
}
- if (!ast_language_is_prefix && !ast_opt_remote) {
- fprintf(stderr, "The 'languageprefix' option in asterisk.conf is deprecated; in a future release it will be removed, and your sound files will need to be organized in the 'new style' language layout.\n");
- }
-
if (ast_opt_always_fork && (ast_opt_remote || ast_opt_console)) {
fprintf(stderr, "'alwaysfork' is not compatible with console or remote console mode; ignored\n");
ast_clear_flag64(&ast_options, AST_OPT_FLAG_ALWAYS_FORK);
diff --git a/main/file.c b/main/file.c
index 92d19c7ce2..28923d64c6 100644
--- a/main/file.c
+++ b/main/file.c
@@ -55,18 +55,6 @@
#include "asterisk/stasis_system.h"
#include "asterisk/media_cache.h"
-/*! \brief
- * The following variable controls the layout of localized sound files.
- * If 0, use the historical layout with prefix just before the filename
- * (i.e. digits/en/1.gsm , digits/it/1.gsm or default to digits/1.gsm),
- * if 1 put the prefix at the beginning of the filename
- * (i.e. en/digits/1.gsm, it/digits/1.gsm or default to digits/1.gsm).
- * The latter permits a language to be entirely in one directory.
- *
- * This is settable in asterisk.conf.
- */
-int ast_language_is_prefix = 1;
-
static AST_RWLIST_HEAD_STATIC(formats, ast_format_def);
STASIS_MESSAGE_TYPE_DEFN(ast_format_register_type);
@@ -790,13 +778,13 @@ static int fileexists_test(const char *filename, const char *fmt, const char *la
return filehelper(buf, result_cap, NULL, ACTION_EXISTS);
}
- if (ast_language_is_prefix && !is_absolute_path(filename)) { /* new layout */
+ if (!is_absolute_path(filename)) {
if (lang) {
snprintf(buf, buflen, "%s/%s", lang, filename);
} else {
snprintf(buf, buflen, "%s", filename);
}
- } else { /* old layout */
+ } else {
strcpy(buf, filename); /* first copy the full string */
if (lang) {
/* insert the language and suffix if needed */
diff --git a/main/options.c b/main/options.c
index 2fdbcc7dcd..acd870cae6 100644
--- a/main/options.c
+++ b/main/options.c
@@ -421,8 +421,6 @@ void load_asterisk_conf(void)
ast_log(LOG_ERROR, "Cannot obtain hostname for this system. Using '%s' instead.\n", ast_config_AST_SYSTEM_NAME);
}
}
- } else if (!strcasecmp(v->name, "languageprefix")) {
- ast_language_is_prefix = ast_true(v->value);
} else if (!strcasecmp(v->name, "defaultlanguage")) {
ast_copy_string(ast_defaultlanguage, v->value, MAX_LANGUAGE);
} else if (!strcasecmp(v->name, "lockmode")) {
@@ -480,6 +478,12 @@ void load_asterisk_conf(void)
internal_channel_set_current_storage_driver(v->value);
} else if (!strcasecmp(v->name, "disable_remote_console_shell")) {
ast_option_disable_remote_console_shell = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "documentation_language")) {
+ /* This is handled in xmldoc.c, but we don't want to emit a warning */
+ } else {
+ ast_log(LOG_WARNING,
+ "Unrecognized setting '%s' in [options] section of %s",
+ v->name, ast_config_AST_CONFIG_FILE);
}
}
if (!ast_opt_remote) {
diff --git a/main/xmldoc.c b/main/xmldoc.c
index 5982dea408..bdd0e4c2b4 100644
--- a/main/xmldoc.c
+++ b/main/xmldoc.c
@@ -3102,7 +3102,7 @@ static int xmldoc_load_documentation(int first_time)
/* setup default XML documentation language */
snprintf(documentation_language, sizeof(documentation_language), default_documentation_language);
- if ((cfg = ast_config_load2("asterisk.conf", "" /* core can't reload */, cnfflags)) && cfg != CONFIG_STATUS_FILEINVALID) {
+ if ((cfg = ast_config_load2(ast_config_AST_CONFIG_FILE, "" /* core can't reload */, cnfflags)) && cfg != CONFIG_STATUS_FILEINVALID) {
for (var = ast_variable_browse(cfg, "options"); var; var = var->next) {
if (!strcasecmp(var->name, "documentation_language")) {
if (!ast_strlen_zero(var->value)) {
diff --git a/utils/extconf.c b/utils/extconf.c
index f2750b7e4f..31632bb4ac 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -1394,8 +1394,6 @@ extern pid_t ast_mainpid;
extern char record_cache_dir[AST_CACHE_DIR_LEN];
extern char debug_filename[AST_FILENAME_MAX];
-extern int ast_language_is_prefix;
-
/* linkedlists.h */