res_musiconhold: Remove options that were deprecated in Asterisk 14.

Commit 9c1f34c7e9 added dedicated options
for random sorting functionality and deprecated older options that
now duplicated these capabilities. Remove these deprecated options.

Resolves: #1296

UpgradeNote: The deprecated random and application=r options have
been removed; use sort=random instead.
This commit is contained in:
Naveen Albert
2025-07-09 15:57:13 -04:00
committed by github-actions[bot]
parent c12f4a886d
commit 5de45323c7

View File

@@ -1204,13 +1204,6 @@ static void moh_parse_options(struct ast_variable *var, struct mohclass *mohclas
ast_set_flag(mohclass, MOH_ANNOUNCEMENT);
} else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) {
mohclass->digit = *var->value;
} else if (!strcasecmp(var->name, "random")) {
static int deprecation_warning = 0;
if (!deprecation_warning) {
ast_log(LOG_WARNING, "Music on hold 'random' setting is deprecated in 14. Please use 'sort=random' instead.\n");
deprecation_warning = 1;
}
ast_set2_flag(mohclass, ast_true(var->value), MOH_RANDOMIZE);
} else if (!strcasecmp(var->name, "sort")) {
if (!strcasecmp(var->value, "random")) {
ast_set_flag(mohclass, MOH_RANDOMIZE);
@@ -1828,14 +1821,6 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
mohclass = mohclass_unref(mohclass, "unreffing potential mohclass (moh_scan_files failed)");
return -1;
}
if (strchr(mohclass->args, 'r')) {
static int deprecation_warning = 0;
if (!deprecation_warning) {
ast_log(LOG_WARNING, "Music on hold 'application=r' setting is deprecated in 14. Please use 'sort=random' instead.\n");
deprecation_warning = 1;
}
ast_set_flag(mohclass, MOH_RANDOMIZE);
}
} else if (!strcasecmp(mohclass->mode, "playlist")) {
size_t file_count;