aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-03 18:06:35 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-03 18:06:35 +0000
commit9e5a712e5711268238b0eeb60afb8ba5112121fd (patch)
treee0d8c15dd670edb193afb395109a396fe2343816 /channels/chan_skinny.c
parentb907c8d0bee47cf7b94d94fb252bb69044e88a60 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@140938 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 18d5790ca..9ab38521d 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -2847,20 +2847,32 @@ static char *handle_skinny_show_lines(struct ast_cli_entry *e, int cmd, struct a
{
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 @@ static char *handle_skinny_show_lines(struct ast_cli_entry *e, int cmd, struct a
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);