]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue.c: Queue don't play "thank-you" when here is no hold time announcements
authorMark Petersen <bugs.digium.com@zombie.dk>
Tue, 4 Jan 2022 09:11:41 +0000 (10:11 +0100)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Thu, 20 Jan 2022 17:25:31 +0000 (11:25 -0600)
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

apps/app_queue.c
doc/CHANGES-staging/app_queue_say_thanks.txt [new file with mode: 0644]

index b862184119e39e2baa3471b48f7e344fa6789d15..df5dba2deae07010f920b5174a1d54381910ad80 100644 (file)
@@ -4127,9 +4127,8 @@ static int valid_exit(struct queue_ent *qe, char digit)
 
 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 */
@@ -4158,11 +4157,7 @@ static int say_position(struct queue_ent *qe, int ringing)
                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);
@@ -4206,6 +4201,7 @@ static int say_position(struct queue_ent *qe, int ringing)
        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;
@@ -4240,8 +4236,6 @@ static int say_position(struct queue_ent *qe, int ringing)
                                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 (file)
index 0000000..7bf7b7b
--- /dev/null
@@ -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"