Skip to content

Commit 92f9ae3

Browse files
InterLinked1Friendly Automation
authored andcommitted
app_queue: Don't reset queue stats on reload
Prevents reloads of app_queue from also resetting queue statistics. Also preserves individual queue agent statistics if we're just reloading members. ASTERISK-28701 Change-Id: Ib5d4cdec175e44de38ef0f6ede4a7701751766f1
1 parent 63d27af commit 92f9ae3

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

apps/app_queue.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9339,9 +9339,13 @@ static void reload_single_member(const char *memberdata, struct call_queue *q)
93399339
if ((newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0, state_interface, ringinuse, wrapuptime))) {
93409340
newm->wrapuptime = wrapuptime;
93419341
if (cur) {
9342-
/* Round Robin Queue Position must be copied if this is replacing an existing member */
93439342
ao2_lock(q->members);
9343+
/* Round Robin Queue Position must be copied if this is replacing an existing member */
93449344
newm->queuepos = cur->queuepos;
9345+
/* Don't reset agent stats either */
9346+
newm->calls = cur->calls;
9347+
newm->lastcall = cur->lastcall;
9348+
93459349
ao2_link(q->members, newm);
93469350
ao2_unlink(q->members, cur);
93479351
ao2_unlock(q->members);
@@ -10407,7 +10411,7 @@ static int manager_queue_reload(struct mansession *s, const struct message *m)
1040710411
}
1040810412

1040910413
if (!header_found) {
10410-
ast_set_flag(&mask, AST_FLAGS_ALL);
10414+
ast_set_flag(&mask, AST_FLAGS_ALL & ~QUEUE_RESET_STATS);
1041110415
}
1041210416

1041310417
if (!reload_handler(1, &mask, queuename)) {
@@ -11146,7 +11150,7 @@ static char *handle_queue_reload(struct ast_cli_entry *e, int cmd, struct ast_cl
1114611150
} else if (!strcasecmp(a->argv[2], "parameters")) {
1114711151
ast_set_flag(&mask, QUEUE_RELOAD_PARAMETERS);
1114811152
} else if (!strcasecmp(a->argv[2], "all")) {
11149-
ast_set_flag(&mask, AST_FLAGS_ALL);
11153+
ast_set_flag(&mask, AST_FLAGS_ALL & ~QUEUE_RESET_STATS);
1115011154
}
1115111155

1115211156
if (a->argc == 3) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Subject: app_queue
2+
3+
Reload behavior in app_queue has been changed so
4+
queue and agent stats are not reset during full
5+
app_queue module reloads. The queue reset stats
6+
CLI command may still be used to reset stats while
7+
Asterisk is running.

0 commit comments

Comments
 (0)