[asterisk-commits] mvanbaak: trunk r140938 - in /trunk: CHANGES channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 3 13:06:35 CDT 2008


Author: mvanbaak
Date: Wed Sep  3 13:06:35 2008
New Revision: 140938

URL: http://svn.digium.com/view/asterisk?view=rev&rev=140938
Log:
Added 'skinny show lines verbose'
This will print the subs and their status for every line (if any).

wedhorn did most of the work with his patch which introduced
'skinny show debug' but a discussion on IRC stated that it should be
added to 'skinny show lines'

Input on the output format by Qwell on IRC.

(closes issue #13344)
Reported by: wedhorn

Modified:
    trunk/CHANGES
    trunk/channels/chan_skinny.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=140938&r1=140937&r2=140938
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Wed Sep  3 13:06:35 2008
@@ -325,6 +325,7 @@
     sorted into the different possible callbacks, with the number of entries
     currently scheduled for each. Gives you a feel for how busy the sip channel
     driver is.
+  * Added 'skinny show lines verbose' CLI command. This will show the subs for every channel.
 
 SIP changes
 -----------

Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=140938&r1=140937&r2=140938
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Wed Sep  3 13:06:35 2008
@@ -2847,20 +2847,32 @@
 {
 	struct skinny_device *d;
 	struct skinny_line *l;
+	struct skinny_subchannel *sub;
+	int verbose = 0;
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "skinny show lines";
+		e->command = "skinny show lines [verbose]";
 		e->usage =
 			"Usage: skinny show lines\n"
-			"       Lists all lines known to the Skinny subsystem.\n";
+			"       Lists all lines known to the Skinny subsystem.\n"
+			"       If 'verbose' is specified, the output includes\n"
+			"       information about subs for each line.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 3)
+
+	if (a->argc == e->args) {
+		if (!strcasecmp(a->argv[e->args-1], "verbose")) {
+			verbose = 1;
+		} else {
+			return CLI_SHOWUSAGE;
+		}
+	} else if (a->argc != e->args - 1) {
 		return CLI_SHOWUSAGE;
+	}
 	
 	
 	ast_cli(a->fd, "Device Name          Instance Name                 Label               \n");
@@ -2873,6 +2885,15 @@
 				l->instance,
 				l->name,
 				l->label);
+			if (verbose) {
+				AST_LIST_TRAVERSE(&l->sub, sub, list) {
+					ast_cli(a->fd, "  %s> %s to %s\n",
+						(sub == l->activesub?"Active  ":"Inactive"),
+						sub->owner->name,
+						(ast_bridged_channel(sub->owner)?ast_bridged_channel(sub->owner)->name:"")
+					);
+				}
+			}
 		}
 	}
 	AST_LIST_UNLOCK(&devices);




More information about the asterisk-commits mailing list