]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: Allow streaming multiple announcement files
authorNaveen Albert <asterisk@phreaknet.org>
Sun, 25 Jul 2021 21:53:38 +0000 (21:53 +0000)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Tue, 3 Aug 2021 19:19:09 +0000 (14:19 -0500)
Allows multiple files comprising an agent announcement
to be played by separating on the ampersand, similar
to the multi-file support in other Asterisk applications.

ASTERISK-29528

Change-Id: Iec600d8cd5ba14aa1e4e37f906accb356cd7891a

apps/app_queue.c
doc/CHANGES-staging/app_queue.txt [new file with mode: 0644]

index d3e04713b65b6e5d44bf4bf1a10a5fb35ec5a79c..fdc5211255dbdfe12416c751e228292a382f1090 100644 (file)
                        <parameter name="URL">
                                <para><replaceable>URL</replaceable> will be sent to the called party if the channel supports it.</para>
                        </parameter>
-                       <parameter name="announceoverride" />
+                       <parameter name="announceoverride" argsep="&amp;">
+                               <argument name="filename" required="true">
+                                       <para>Announcement file(s) to play to agent before bridging call, overriding the announcement(s)
+                                       configured in <filename>queues.conf</filename>, if any.</para>
+                               </argument>
+                               <argument name="filename2" multiple="true" />
+                       </parameter>
                        <parameter name="timeout">
                                <para>Will cause the queue to fail out after a specified number of
                                seconds, checked between each <filename>queues.conf</filename> <replaceable>timeout</replaceable> and
@@ -6953,8 +6959,12 @@ static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_a
                                        res2 = ast_safe_sleep(peer, qe->parent->memberdelay * 1000);
                                }
                                if (!res2 && announce) {
-                                       if (play_file(peer, announce) < 0) {
-                                               ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", announce, ast_channel_name(peer));
+                                       char *front;
+                                       char *announcefiles = ast_strdupa(announce);
+                                       while ((front = strsep(&announcefiles, "&"))) {
+                                               if (play_file(peer, front) < 0) {
+                                                       ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", front, ast_channel_name(peer));
+                                               }
                                        }
                                }
                                if (!res2 && qe->parent->reportholdtime) {
diff --git a/doc/CHANGES-staging/app_queue.txt b/doc/CHANGES-staging/app_queue.txt
new file mode 100644 (file)
index 0000000..5d677b5
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: app_queue.c
+
+Allow multiple files to be streamed for agent announcement.
+