aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-02 15:40:38 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-02 15:40:38 +0000
commit7e93d0bc48360990a7e603800fdf17700341db74 (patch)
treeaad0aa58eba21cfb5f57438c0b8351454ccd5cc1 /apps/app_queue.c
parentde7d8b6bd2b05576789d991e51bf1e5c6b8a37af (diff)
Add option 'keepstats' which will keep queue statistics during a reload. (issue #7908 reported by jmls)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@44150 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 6d1df42d7..6ec3c4ef3 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -238,6 +238,9 @@ static const char *pm_family = "/Queue/PersistentMembers";
#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;
/*! \brief queues.conf per-queue weight option */
@@ -3699,6 +3702,9 @@ static int reload_queues(void)
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 @@ static int reload_queues(void)
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;