]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
file.c: with "sounds_search_custom_dir = yes", search "custom" directory
authorAllan Nathanson <42244061+Allan-N@users.noreply.github.com>
Sun, 10 Aug 2025 17:21:53 +0000 (13:21 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Wed, 10 Sep 2025 19:52:59 +0000 (19:52 +0000)
With `sounds_search_custom_dir = yes`, we are supposed to search for sounds
in the `AST_DATA_DIR/sounds/custom` directory before searching the normal
directories.  Unfortunately, a recent change
(https://github.com/asterisk/asterisk/pull/1172) had a typo resulting in
the "custom" directory not being searched.  This change restores this
expected behavior.

Resolves: #1353
(cherry picked from commit 59d6d2addf04c7f71b63967edc560d65cbe2f76b)

main/file.c

index eb45911d54e7aa015c4457c0520907c1d0477c4c..6363387fd7d5606a88d2ea8fbd44103ed8b391bf 100644 (file)
@@ -1327,7 +1327,7 @@ int ast_streamfile(struct ast_channel *chan, const char *filename,
        if (ast_opt_sounds_search_custom && !is_absolute_path(filename)) {
                memset(custom_filename, 0, sizeof(custom_filename));
                snprintf(custom_filename, sizeof(custom_filename), "custom/%s", filename);
-               fs = openstream_internal(chan, filename, preflang, 0, 1); /* open stream, do not warn for missing files */
+               fs = openstream_internal(chan, custom_filename, preflang, 0, 1); /* open stream, do not warn for missing files */
                if (fs) {
                        tmp_filename = custom_filename;
                        ast_debug(3, "Found file %s in custom directory\n", filename);