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

Mark Petersen asteriskteam at digium.com
Wed Jan 12 10:55:49 CST 2022


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


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/45/17845/1

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/+/17845
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ic7e51dcde526b23f1cd8d24e1d1e2d81e10f9d2c
Gerrit-Change-Number: 17845
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/20220112/b496cb85/attachment.html>


More information about the asterisk-code-review mailing list