]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_musiconhold: Start playlist after initial announcement
authorSean Bright <sean.bright@gmail.com>
Thu, 14 Dec 2017 18:14:10 +0000 (13:14 -0500)
committerSean Bright <sean.bright@gmail.com>
Thu, 14 Dec 2017 18:17:18 +0000 (13:17 -0500)
Reset the samples counter to zero when we are done playing an
announcement so that we don't skip into the middle of the first file in
the playlist.

Also add the selected annoucement to the output of 'moh show classes.'

ASTERISK-24329 #close
Reported by: Thomas Frederiksen

Change-Id: I2a5f986a31279c981592f49391409ebf38d6f6d0

res/res_musiconhold.c

index dee9c2da8edcd6b35ada5a06a29d9dab556270b9..57d12789e6ec669d1b5880a8abf17cd22b2c2375 100644 (file)
@@ -331,6 +331,7 @@ static int ast_moh_files_next(struct ast_channel *chan)
                }
        } else {
                state->announcement = 0;
+               state->samples = 0;
        }
 
        if (!state->class->total_files) {
@@ -1922,6 +1923,9 @@ static char *handle_cli_moh_show_classes(struct ast_cli_entry *e, int cmd, struc
                ast_cli(a->fd, "Class: %s\n", class->name);
                ast_cli(a->fd, "\tMode: %s\n", S_OR(class->mode, "<none>"));
                ast_cli(a->fd, "\tDirectory: %s\n", S_OR(class->dir, "<none>"));
+               if (ast_test_flag(class, MOH_ANNOUNCEMENT)) {
+                       ast_cli(a->fd, "\tAnnouncement: %s\n", S_OR(class->announcement, "<none>"));
+               }
                if (ast_test_flag(class, MOH_CUSTOM)) {
                        ast_cli(a->fd, "\tApplication: %s\n", S_OR(class->args, "<none>"));
                        ast_cli(a->fd, "\tKill Escalation Delay: %zu ms\n", class->kill_delay / 1000);