]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_musiconhold: Remove options that were deprecated in Asterisk 14.
authorNaveen Albert <asterisk@phreaknet.org>
Wed, 9 Jul 2025 19:57:13 +0000 (15:57 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 15 Jul 2025 15:12:17 +0000 (15:12 +0000)
Commit 9c1f34c7e904b26bb550f426020635894cb805ac 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.

res/res_musiconhold.c

index b53c7e29ae97dcbe0b2dfbc618c1c6c296170f3b..64bd2261906ec2b8a7dd5353c7e339aa5bf24f4e 100644 (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;