if ((newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0, state_interface, ringinuse, wrapuptime))) {
newm->wrapuptime = wrapuptime;
if (cur) {
- /* Round Robin Queue Position must be copied if this is replacing an existing member */
ao2_lock(q->members);
+ /* Round Robin Queue Position must be copied if this is replacing an existing member */
newm->queuepos = cur->queuepos;
+ /* Don't reset agent stats either */
+ newm->calls = cur->calls;
+ newm->lastcall = cur->lastcall;
+
ao2_link(q->members, newm);
ao2_unlink(q->members, cur);
ao2_unlock(q->members);
}
if (!header_found) {
- ast_set_flag(&mask, AST_FLAGS_ALL);
+ ast_set_flag(&mask, AST_FLAGS_ALL & ~QUEUE_RESET_STATS);
}
if (!reload_handler(1, &mask, queuename)) {
} else if (!strcasecmp(a->argv[2], "parameters")) {
ast_set_flag(&mask, QUEUE_RELOAD_PARAMETERS);
} else if (!strcasecmp(a->argv[2], "all")) {
- ast_set_flag(&mask, AST_FLAGS_ALL);
+ ast_set_flag(&mask, AST_FLAGS_ALL & ~QUEUE_RESET_STATS);
}
if (a->argc == 3) {
--- /dev/null
+Subject: app_queue
+
+Reload behavior in app_queue has been changed so
+queue and agent stats are not reset during full
+app_queue module reloads. The queue reset stats
+CLI command may still be used to reset stats while
+Asterisk is running.