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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 20 16:48:51 CDT 2009


Author: mmichelson
Date: Tue Oct 20 16:48:48 2009
New Revision: 224850

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=224850
Log:
Simple core_id and status reporter. Needs formatting love.


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=224850&r1=224849&r2=224850
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Oct 20 16:48:48 2009
@@ -2724,12 +2724,21 @@
 	return;
 }
 
+static int print_stats_cb(void *obj, void *arg, int flags)
+{
+	int *cli_fd = arg;
+	struct cc_core_instance *core_instance = obj;
+
+	ast_cli(*cli_fd, "Core: %d, State: %d\n", core_instance->core_id, core_instance->current_state);
+	return 0;
+}
+
 static int cc_cli_output_status(void *data)
 {
-	int cli_fd = *(int *)data;
-
-	ast_cli(cli_fd, "HELLO!\n");
-	ast_free(data);
+	int *cli_fd = data;
+
+	ao2_t_callback(cc_core_instances, OBJ_NODATA, print_stats_cb, cli_fd, "Printing stats to CLI");
+	ast_free(cli_fd);
 	return 0;
 }
 




More information about the asterisk-commits mailing list