]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: Fix raise_respect_min lost in copy_rules() breaking rN queue rules
authorphoneben <3232963@gmail.com>
Sun, 26 Apr 2026 20:34:00 +0000 (23:34 +0300)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 28 Apr 2026 16:28:26 +0000 (16:28 +0000)
app_queue: Fix raise_respect_min not copied in copy_rules() causing rN rules to be ignored.

`copy_rules()` never copied `raise_respect_min` into the per-call rule list, so the flag was always 0 when a timed penaltychange rule fired, making `rN` behave like plain `N` and raising members below `min_penalty` that should have been excluded.

Also fixes `update_qe_rule()` not propagating the flag from `qe->pr` to `qe`, and dropping the `r` prefix when saving back to `QUEUE_RAISE_PENALTY`.

Resolves: #1901

apps/app_queue.c

index b8ea7a616e2b3a1513c0fc8b0209ace7d57962f2..06fc4b0ac11ee02d09cab94473bccb576d8fd787 100644 (file)
@@ -6049,7 +6049,12 @@ static void update_qe_rule(struct queue_ent *qe)
                        raise_penalty = max_penalty;
                }
 
-               snprintf(raise_penalty_str, sizeof(raise_penalty_str), "%d", raise_penalty);
+               qe->raise_respect_min = qe->pr->raise_respect_min;
+               if (qe->raise_respect_min) {
+                       snprintf(raise_penalty_str, sizeof(raise_penalty_str), "r%d", raise_penalty);
+               } else {
+                       snprintf(raise_penalty_str, sizeof(raise_penalty_str), "%d", raise_penalty);
+               }
                pbx_builtin_setvar_helper(qe->chan, "QUEUE_RAISE_PENALTY", raise_penalty_str);
                qe->raise_penalty = raise_penalty;
                ast_debug(3, "Setting raised penalty to %d for caller %s since %d seconds have elapsed\n",
@@ -8737,6 +8742,7 @@ static void copy_rules(struct queue_ent *qe, const char *rulename)
                        new_pr->max_relative = pr_iter->max_relative;
                        new_pr->min_relative = pr_iter->min_relative;
                        new_pr->raise_relative = pr_iter->raise_relative;
+                       new_pr->raise_respect_min = pr_iter->raise_respect_min;
                        AST_LIST_INSERT_TAIL(&qe->qe_rules, new_pr, list);
                }
        }