[asterisk-commits] mmichelson: branch group/CCSS r225101 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 21 10:42:35 CDT 2009


Author: mmichelson
Date: Wed Oct 21 10:42:14 2009
New Revision: 225101

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225101
Log:
Now we report the service requested at each endpoint.


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

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=225101&r1=225100&r2=225101
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Oct 21 10:42:14 2009
@@ -2745,14 +2745,33 @@
 	return cc_state_to_string_map[state].state_string;
 }
 
-static void cc_cli_print_monitor_stats(struct ast_cc_monitor *monitor, int fd)
+static struct {
+	enum ast_cc_service_type service;
+	const char *service_string;
+} cc_service_to_string_map[] = {
+	{AST_CC_NONE, "NONE"},
+	{AST_CC_CCBS, "CCBS"},
+	{AST_CC_CCNR, "CCNR"},
+	{AST_CC_CCNL, "CCNL"},
+};
+
+static const char *cc_service_to_string(enum ast_cc_service_type service)
+{
+	return cc_service_to_string_map[service].service_string;
+}
+
+static void cc_cli_print_monitor_stats(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) {
 		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, "\n");
 	}
 	AST_LIST_TRAVERSE(&monitor->child_links, link_iter, next_child) {
-		cc_cli_print_monitor_stats(link_iter->child, fd);
+		cc_cli_print_monitor_stats(link_iter->child, fd, link_iter->service);
 	}
 }
 
@@ -2764,7 +2783,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->monitor, *cli_fd);
+		cc_cli_print_monitor_stats(core_instance->monitor, *cli_fd, AST_CC_NONE);
 	}
 	return 0;
 }




More information about the asterisk-commits mailing list