[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r242094 - /team/group/CCSS_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 21 16:51:37 CST 2010


Author: mmichelson
Date: Thu Jan 21 16:51:33 2010
New Revision: 242094

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242094
Log:
New version of CLI command.


Modified:
    team/group/CCSS_Monitor_Restructure/main/ccss.c

Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=242094&r1=242093&r2=242094
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Thu Jan 21 16:51:33 2010
@@ -3358,21 +3358,20 @@
 	return;
 }
 
-static void cc_cli_print_monitor_stats(int core_id, struct ast_cc_monitor *monitor, int fd, enum ast_cc_service_type service)
-{
-	struct ast_cc_monitor_link *link_iter;
-	if (monitor->interface->monitor_class != AST_CC_ROOT_MONITOR) {
+static void cc_cli_print_monitor_stats(struct cc_monitor *monitor, int fd, int parent_id)
+{
+	if (!monitor) {
+		return;
+	}
+
+	if (monitor->parent_id == parent_id) {
 		ast_cli(fd, "\t\t|-->%s", monitor->interface->name);
 		if (monitor->interface->monitor_class == AST_CC_DEVICE_MONITOR) {
-			ast_cli(fd, "(%s)", cc_service_to_string(service));
+			ast_cli(fd, "(%s)", cc_service_to_string(monitor->service_offered));
 		}
-		ast_cli(fd, "\n");
-	}
-	AST_LIST_TRAVERSE(&monitor->child_links, link_iter, next_child) {
-		if (core_id == link_iter->core_id) {
-			cc_cli_print_monitor_stats(core_id, link_iter->child, fd, link_iter->service);
-		}
-	}
+	}
+
+	cc_cli_print_monitor_stats(AST_DLLIST_NEXT(monitor, next), fd, monitor->id);
 }
 
 static int print_stats_cb(void *obj, void *arg, int flags)
@@ -3382,9 +3381,7 @@
 
 	ast_cli(*cli_fd, "%d\t\t%s\t\t%s\n", core_instance->core_id, core_instance->agent->interface,
 			cc_state_to_string(core_instance->current_state));
-	if (core_instance->monitor) {
-		cc_cli_print_monitor_stats(core_instance->core_id, core_instance->monitor, *cli_fd, AST_CC_NONE);
-	}
+	cc_cli_print_monitor_stats(AST_DLLIST_FIRST(core_instance->monitors), *cli_fd, 0);
 	return 0;
 }
 




More information about the asterisk-commits mailing list