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

Joshua Colp asteriskteam at digium.com
Thu Jan 20 11:49:54 CST 2022


Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17847 )

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, 7 insertions(+), 9 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Kevin Harwell: Looks good to me, approved



diff --git a/apps/app_queue.c b/apps/app_queue.c
index 95eb05b..9bd0537 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4124,9 +4124,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 */
@@ -4155,11 +4154,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);
@@ -4203,6 +4198,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;
@@ -4237,8 +4233,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..7bf7b7b
--- /dev/null
+++ b/doc/CHANGES-staging/app_queue_say_thanks.txt
@@ -0,0 +1,4 @@
+Subject: app_queues
+
+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/+/17847
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ic7e51dcde526b23f1cd8d24e1d1e2d81e10f9d2c
Gerrit-Change-Number: 17847
Gerrit-PatchSet: 2
Gerrit-Owner: Mark Petersen <bugs.digium.com at zombie.dk>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220120/88d820f1/attachment.html>


More information about the asterisk-code-review mailing list