[asterisk-commits] trunk - r7776 /trunk/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jan 4 03:22:47 CST 2006


Author: oej
Date: Wed Jan  4 03:22:45 2006
New Revision: 7776

URL: http://svn.digium.com/view/asterisk?rev=7776&view=rev
Log:
Issue #6127: Count in show channeltypes (junky)

Modified:
    trunk/channel.c

Modified: trunk/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/channel.c?rev=7776&r1=7775&r2=7776&view=diff
==============================================================================
--- trunk/channel.c (original)
+++ trunk/channel.c Wed Jan  4 03:22:45 2006
@@ -168,8 +168,10 @@
 
 static int show_channeltypes(int fd, int argc, char *argv[])
 {
-#define FORMAT  "%-10.10s  %-30.30s %-12.12s %-12.12s %-12.12s\n"
+#define FORMAT  "%-10.10s  %-40.40s %-12.12s %-12.12s %-12.12s\n"
 	struct chanlist *cl;
+	int count_chan = 0;
+
 	ast_cli(fd, FORMAT, "Type", "Description",       "Devicestate", "Indications", "Transfer");
 	ast_cli(fd, FORMAT, "----------", "-----------", "-----------", "-----------", "--------");
 	if (ast_mutex_lock(&chlock)) {
@@ -181,8 +183,10 @@
 			(cl->tech->devicestate) ? "yes" : "no", 
 			(cl->tech->indicate) ? "yes" : "no",
 			(cl->tech->transfer) ? "yes" : "no");
+		count_chan++;
 	}
 	ast_mutex_unlock(&chlock);
+	ast_cli(fd, "----------\n%d channel drivers registered.\n", count_chan);
 	return RESULT_SUCCESS;
 
 #undef FORMAT



More information about the asterisk-commits mailing list