[Asterisk-code-review] app_queue: Allow streaming multiple announcement files (asterisk[18])

N A asteriskteam at digium.com
Tue Aug 3 09:03:06 CDT 2021


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/16255 )


Change subject: app_queue: Allow streaming multiple announcement files
......................................................................

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
---
M apps/app_queue.c
A doc/CHANGES-staging/app_queue.txt
2 files changed, 17 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/55/16255/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index d3e0471..fdc5211 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 @@
 					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 0000000..5d677b5
--- /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.
+

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16255
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Iec600d8cd5ba14aa1e4e37f906accb356cd7891a
Gerrit-Change-Number: 16255
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210803/f9248ecb/attachment.html>


More information about the asterisk-code-review mailing list