[Asterisk-code-review] app_queue: Don't reset queue stats on reload (asterisk[master])

N A asteriskteam at digium.com
Fri Aug 20 15:37:24 CDT 2021


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/16343 )


Change subject: app_queue: Don't reset queue stats on reload
......................................................................

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
---
M apps/app_queue.c
1 file changed, 7 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/16343/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index fdc5211..93adb3f 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -9339,9 +9339,13 @@
 	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);
@@ -10407,7 +10411,7 @@
 	}
 
 	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)) {
@@ -11146,7 +11150,7 @@
 	} 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) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16343
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ib5d4cdec175e44de38ef0f6ede4a7701751766f1
Gerrit-Change-Number: 16343
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210820/50bcb4dc/attachment.html>


More information about the asterisk-code-review mailing list