[asterisk-commits] mmichelson: trunk r193349 - /trunk/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 8 14:50:49 CDT 2009


Author: mmichelson
Date: Fri May  8 14:50:44 2009
New Revision: 193349

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193349
Log:
Reset the members' call counts when resetting queue statistics.

This helps to prevent odd scenarios where a queue will claim to have
taken 0 calls, but the members appear to have taken a non-zero amount.

(closes issue #15068)
Reported by: sum
Patches:
      patchreset.patch uploaded by sum (license 766)
Tested by: sum


Modified:
    trunk/apps/app_queue.c

Modified: trunk/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_queue.c?view=diff&rev=193349&r1=193348&r2=193349
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Fri May  8 14:50:44 2009
@@ -1234,6 +1234,16 @@
 	q->callsabandoned = 0;
 	q->callscompletedinsl = 0;
 	q->wrapuptime = 0;
+	q->talktime = 0;
+
+	if (q->members) {
+		struct member *mem;
+		struct ao2_iterator mem_iter = ao2_iterator_init(q->members, 0);
+		while ((mem = ao2_iterator_next(&mem_iter))) {
+			mem->calls = 0;
+			ao2_ref(mem, -1);
+		}
+	}
 }
 
 /*! 




More information about the asterisk-commits mailing list