[asterisk-commits] file: trunk r44150 - in /trunk: ./ apps/ configs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 2 08:40:39 MST 2006


Author: file
Date: Mon Oct  2 10:40:38 2006
New Revision: 44150

URL: http://svn.digium.com/view/asterisk?rev=44150&view=rev
Log:
Add option 'keepstats' which will keep queue statistics during a reload. (issue #7908 reported by jmls)

Modified:
    trunk/CHANGES
    trunk/apps/app_queue.c
    trunk/configs/queues.conf.sample

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?rev=44150&r1=44149&r2=44150&view=diff
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Mon Oct  2 10:40:38 2006
@@ -17,3 +17,5 @@
      can use --with-cap to specify the path.
   * H323 remote hold notification support added (by NOTIFY message
      and/or H.450 supplementary service)
+  * Added keepstats option to queues.conf which will keep queue
+     statistics during a reload.

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?rev=44150&r1=44149&r2=44150&view=diff
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon Oct  2 10:40:38 2006
@@ -236,6 +236,9 @@
 static const char *pm_family = "/Queue/PersistentMembers";
 /* The maximum length of each persistent member queue database entry */
 #define PM_MAX_LEN 8192
+
+/*! \brief queues.conf [general] option */
+static int queue_keep_stats = 0;
 
 /*! \brief queues.conf [general] option */
 static int queue_persistent_members = 0;
@@ -3699,6 +3702,9 @@
 	while ((cat = ast_category_browse(cfg, cat)) ) {
 		if (!strcasecmp(cat, "general")) {	
 			/* Initialize global settings */
+			queue_keep_stats = 0;
+			if ((general_val = ast_variable_retrieve(cfg, "general", "keepstats")))
+				queue_keep_stats = ast_true(general_val);
 			queue_persistent_members = 0;
 			if ((general_val = ast_variable_retrieve(cfg, "general", "persistentmembers")))
 				queue_persistent_members = ast_true(general_val);
@@ -3728,7 +3734,8 @@
 					ast_mutex_lock(&q->lock);
 				/* Re-initialize the queue, and clear statistics */
 				init_queue(q);
-				clear_queue(q);
+				if (!queue_keep_stats) 
+					clear_queue(q);
 				for (cur = q->members; cur; cur = cur->next) {
 					if (!cur->dynamic) {
 						cur->delme = 1;

Modified: trunk/configs/queues.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/queues.conf.sample?rev=44150&r1=44149&r2=44150&view=diff
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Mon Oct  2 10:40:38 2006
@@ -8,6 +8,11 @@
 ;    read into their recorded queues. Default is 'yes'.
 ;
 persistentmembers = yes
+;
+; Keep Stats
+;    Keep queue statistics during a reload. Default is 'no'
+;
+keepstats = no
 ; 
 ; AutoFill Behavior
 ;    The old/current behavior of the queue has a serial type behavior 



More information about the asterisk-commits mailing list