[asterisk-commits] mmichelson: branch mmichelson/queue-reset r99024 - /team/mmichelson/queue-res...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 18 10:55:28 CST 2008


Author: mmichelson
Date: Fri Jan 18 10:55:27 2008
New Revision: 99024

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99024
Log:
Adding CLI command for resetting queue stats.


Modified:
    team/mmichelson/queue-reset/apps/app_queue.c

Modified: team/mmichelson/queue-reset/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/apps/app_queue.c?view=diff&rev=99024&r1=99023&r2=99024
==============================================================================
--- team/mmichelson/queue-reset/apps/app_queue.c (original)
+++ team/mmichelson/queue-reset/apps/app_queue.c Fri Jan 18 10:55:27 2008
@@ -6104,6 +6104,30 @@
 	return CLI_SUCCESS;
 }
 
+static char *handle_queue_reset(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *queuename = NULL;
+	switch(cmd) {
+		case CLI_INIT:
+			e->command = "queue reset stats";
+			e->usage = 
+				"Usage: queue reset stats <queuename>\n"
+				"Reset stats for <queuename> if specified. Otherwise resets stats for all queues\n";
+			return NULL;
+		case CLI_GENERATE:
+			return complete_queue(a->line, a->word, a->pos, a->n);
+	}
+
+	if (a->argc < 3 || a->argc > 4)
+		return CLI_SHOWUSAGE;
+
+	if (a->argc == 4) /*queue specified*/
+		queuename = a->argv[3];
+
+	reload_handler(1, QUEUE_RESET_STATS, queuename);
+	return CLI_SUCCESS;
+}
+
 static char *handle_queue_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	enum queue_reload_mask mask = QUEUE_RELOAD_ALL;
@@ -6172,7 +6196,7 @@
 	AST_CLI_DEFINE(handle_queue_rule_show, "Show the rules defined in queuerules.conf"),
 	AST_CLI_DEFINE(handle_queue_rule_reload, "Reload the rules defined in queuerules.conf"),
 	AST_CLI_DEFINE(handle_queue_reload, "Reload queues, members, queue rules, or any combination"),
-	//AST_CLI_DEFINE(handle_queue_reset, "Reset queue statistics"),
+	AST_CLI_DEFINE(handle_queue_reset, "Reset queue statistics"),
 };
 
 static int unload_module(void)




More information about the asterisk-commits mailing list