From 940f6c4a03a45b0cdbcbbae42394a194c4d5e185 Mon Sep 17 00:00:00 2001 From: Naveen Albert <asterisk@phreaknet.org> Date: Sun, 25 Jul 2021 21:53:38 +0000 Subject: [PATCH] app_queue: Allow streaming multiple announcement files 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 | 16 +++++++++++++--- doc/CHANGES-staging/app_queue.txt | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 doc/CHANGES-staging/app_queue.txt diff --git a/apps/app_queue.c b/apps/app_queue.c index d3e04713b6..fdc5211255 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -238,7 +238,13 @@ <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="&"> + <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 index 0000000000..5d677b56b9 --- /dev/null +++ b/doc/CHANGES-staging/app_queue.txt @@ -0,0 +1,4 @@ +Subject: app_queue.c + +Allow multiple files to be streamed for agent announcement. + -- GitLab