]> 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)
committerStuart Henderson <sthen@users.noreply.github.com>
Wed, 3 Sep 2025 13:15:48 +0000 (13:15 +0000)
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
apps/app_queue.c

index 398eab2564868a3f3e7da53bb9341976084a59cc..1802eee7d63fd7a1f41d9b37b7f7244a49ad9167 100644 (file)
@@ -4370,7 +4370,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;
        }