]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue.c: Fix announcements when announce-to-first-user not enabled.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 28 Sep 2017 22:37:15 +0000 (17:37 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 28 Sep 2017 23:47:58 +0000 (18:47 -0500)
The previous patch for ASTERISK-27216 made it so you wouldn't get any
position or periodic announcements unless you had announce-to-first-user
enabled.  The announce-to-first-user feature was added by ASTERISK_21782
as a result of the patch which introduced the redundant announcements that
ASTERISK-27216 removes.

* By noting that the makeannouncement variable is used to suppresses the
first user announcement, we set its initial value to the
announce-to-first-user enable setting.

ASTERISK-27216

Change-Id: Ieaeb7dbea8ae7073086b775fbafe0625b000b10a

apps/app_queue.c

index 80a013c791ebba64f19ce6e338aacb888036c247..1eb8551b727c0e86a312c197c296b1f38aa5efbd 100644 (file)
@@ -8081,7 +8081,7 @@ check_turns:
                goto stop;
        }
 
-       makeannouncement = 0;
+       makeannouncement = qe.parent->announce_to_first_user;
 
        for (;;) {
                /* This is the wait loop for the head caller*/
@@ -8101,15 +8101,17 @@ check_turns:
 
                if (makeannouncement) {
                        /* Make a position announcement, if enabled */
-                       if (qe.parent->announcefrequency && qe.parent->announce_to_first_user)
-                               if ((res = say_position(&qe,ringing)))
+                       if (qe.parent->announcefrequency) {
+                               if ((res = say_position(&qe, ringing))) {
                                        goto stop;
+                               }
+                       }
                }
                makeannouncement = 1;
 
                /* Make a periodic announcement, if enabled */
-               if (qe.parent->periodicannouncefrequency && qe.parent->announce_to_first_user) {
-                       if ((res = say_periodic_announcement(&qe,ringing))) {
+               if (qe.parent->periodicannouncefrequency) {
+                       if ((res = say_periodic_announcement(&qe, ringing))) {
                                goto stop;
                        }
                }