]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: fix comparison for announce-position-only-up
authorStuart Henderson <sthen@users.noreply.github.com>
Thu, 21 Aug 2025 10:22:40 +0000 (10:22 +0000)
committerGeorge Joseph <gjoseph@sangoma.com>
Wed, 17 Sep 2025 17:40:38 +0000 (11:40 -0600)
Numerically comparing that the current queue position is less than
last_pos_said can only be done after at least one announcement has been
made, otherwise last_pos_said is at the default (0).

Fixes: #1386
(cherry picked from commit ac2948dc8994f9e15ac019a4a86fc0aeb6136a65)

apps/app_queue.c

index 1a2c6b37d450b4d6b11e17e853b277e6d9174c41..bf57f0d72b57f9a00ed6c83a674cac883e30f40c 100644 (file)
@@ -4414,7 +4414,7 @@ static int say_position(struct queue_ent *qe, int ringing)
        }
 
        /* Only announce if the caller's queue position has improved since last time */
-       if (qe->parent->announceposition_only_up && qe->last_pos_said <= qe->pos) {
+       if (qe->parent->announceposition_only_up && qe->last_pos_said > 0 && qe->last_pos_said <= qe->pos) {
                return 0;
        }