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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 18 13:29:20 CST 2008


Author: mmichelson
Date: Fri Jan 18 13:29:19 2008
New Revision: 99077

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99077
Log:
Add the queue member reload CLI command.

Next step: Manager versions of the CLI commands


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=99077&r1=99076&r2=99077
==============================================================================
--- team/mmichelson/queue-reset/apps/app_queue.c (original)
+++ team/mmichelson/queue-reset/apps/app_queue.c Fri Jan 18 13:29:19 2008
@@ -6128,6 +6128,30 @@
 	return CLI_SUCCESS;
 }
 
+static char *handle_queue_member_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *queuename = NULL;
+	switch(cmd) {
+		case CLI_INIT:
+			e->command = "queue member reload\n";
+			e->usage =
+				"Usage: queue member reload <queuename>\n"
+				"Reload queue members in <queuename> if specified. Otherwise, reload members in 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_RELOAD_MEMBER, 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;
@@ -6197,6 +6221,7 @@
 	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_member_reload, "Reload queue members"),
 };
 
 static int unload_module(void)




More information about the asterisk-commits mailing list