[Asterisk-code-review] app_queue.c: Queue don't play "thank-you" when here is no hold time a... (asterisk[16])

Mark Petersen asteriskteam at digium.com
Tue Jan 4 03:12:33 CST 2022


Mark Petersen has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17781 )


Change subject: app_queue.c: Queue don't play "thank-you" when here is no hold time announcements
......................................................................

app_queue.c: Queue don't play "thank-you" when here is no hold time announcements

if holdtime is (0 min, 0 sec) there is no hold time announcements
we should then also not playing queue-thankyou

ASTERISK-29831

Change-Id: Ic7e51dcde526b23f1cd8d24e1d1e2d81e10f9d2c
---
M apps/app_queue.c
A doc/CHANGES-staging/app_queue_say_thanks.txt
2 files changed, 8 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/17781/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index dcd5aa8..399ee7b 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4053,9 +4053,8 @@
 
 static int say_position(struct queue_ent *qe, int ringing)
 {
-	int res = 0, announceposition = 0;
+	int res = 0, say_thanks = 0;
 	long avgholdmins, avgholdsecs;
-	int say_thanks = 1;
 	time_t now;
 
 	/* Let minannouncefrequency seconds pass between the start of each position announcement */
@@ -4084,11 +4083,7 @@
 		qe->parent->announceposition == ANNOUNCEPOSITION_MORE_THAN ||
 		(qe->parent->announceposition == ANNOUNCEPOSITION_LIMIT &&
 		qe->pos <= qe->parent->announcepositionlimit)) {
-			announceposition = 1;
-	}
-
-
-	if (announceposition == 1) {
+		say_thanks = 1;
 		/* Say we're next, if we are */
 		if (qe->pos == 1) {
 			res = play_file(qe->chan, qe->parent->sound_next);
@@ -4132,6 +4127,7 @@
 	if ((avgholdmins+avgholdsecs) > 0 && qe->parent->announceholdtime &&
 		((qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE && !qe->last_pos) ||
 		!(qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE))) {
+		say_thanks = 1;
 		res = play_file(qe->chan, qe->parent->sound_holdtime);
 		if (res) {
 			goto playout;
@@ -4166,8 +4162,6 @@
 				goto playout;
 			}
 		}
-	} else if (qe->parent->announceholdtime && !qe->parent->announceposition) {
-		say_thanks = 0;
 	}
 
 posout:
diff --git a/doc/CHANGES-staging/app_queue_say_thanks.txt b/doc/CHANGES-staging/app_queue_say_thanks.txt
new file mode 100644
index 0000000..b8c0724
--- /dev/null
+++ b/doc/CHANGES-staging/app_queue_say_thanks.txt
@@ -0,0 +1,5 @@
+Subject: app_queues
+Subject: Applications
+
+Don't play sound_thanks if there is no leading hold_time message
+When the only announcement is hold time, and there is no hold time (0 min, 0 sec), asterisk will say "thank you for your patience"

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ic7e51dcde526b23f1cd8d24e1d1e2d81e10f9d2c
Gerrit-Change-Number: 17781
Gerrit-PatchSet: 1
Gerrit-Owner: Mark Petersen <bugs.digium.com at zombie.dk>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220104/bdaef9b2/attachment.html>


More information about the asterisk-code-review mailing list