[asterisk-commits] mmichelson: branch mmichelson/queue-reset r167164 - /team/mmichelson/queue-re...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 4 13:54:10 CST 2009


Author: mmichelson
Date: Sun Jan  4 13:54:09 2009
New Revision: 167164

URL: http://svn.digium.com/view/asterisk?view=rev&rev=167164
Log:
Make the manager QueueReload command parallel the CLI equivalent better


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=167164&r1=167163&r2=167164
==============================================================================
--- team/mmichelson/queue-reset/apps/app_queue.c (original)
+++ team/mmichelson/queue-reset/apps/app_queue.c Sun Jan  4 13:54:09 2009
@@ -6322,18 +6322,27 @@
 
 static int manager_queue_reload(struct mansession *s, const struct message *m)
 {
-	struct ast_flags mask;
+	struct ast_flags mask = {0,};
 	const char *queuename = NULL;
-
-	ast_set_flag(&mask, AST_FLAGS_ALL);
-	
+	int header_found = 0;
+
 	queuename = astman_get_header(m, "Queue");
-	if (!strcasecmp(S_OR(astman_get_header(m, "Reset"), ""), "no"))
-		ast_clear_flag(&mask, QUEUE_RESET_STATS);
-	if (!strcasecmp(S_OR(astman_get_header(m, "Members"), ""), "no"))
-		ast_clear_flag(&mask, QUEUE_RELOAD_MEMBER);
-	if (!strcasecmp(S_OR(astman_get_header(m, "Rules"), ""), "no"))
-		ast_clear_flag(&mask, QUEUE_RELOAD_RULES);
+	if (!strcasecmp(S_OR(astman_get_header(m, "Members"), ""), "yes")) {
+		ast_set_flag(&mask, QUEUE_RELOAD_MEMBER);
+		header_found = 1;
+	}
+	if (!strcasecmp(S_OR(astman_get_header(m, "Rules"), ""), "yes")) {
+		ast_set_flag(&mask, QUEUE_RELOAD_RULES);
+		header_found = 1;
+	}
+	if (!strcasecmp(S_OR(astman_get_header(m, "Parameters"), ""), "yes")) {
+		ast_set_flag(&mask, QUEUE_RELOAD_PARAMETERS);
+		header_found = 1;
+	}
+
+	if (!header_found) {
+		ast_set_flag(&mask, AST_FLAGS_ALL);
+	}
 
 	reload_handler(1, &mask, queuename);
 	return 0;




More information about the asterisk-commits mailing list