summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2006-02-21 05:41:37 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2006-02-21 05:41:37 +0000
commitf2be8b518dbe80ab5efccf82b47f7163460d273a (patch)
tree91d964eb4bf0f935672be5bf1417f48f26190299 /channels
parent159711c8380c16eb7802cfffa002a10ecadd286e (diff)
Bug 6554 - Show all spans statuses with a single command
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_zap.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 1d19aa505..6664ed24f 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -9524,6 +9524,27 @@ static void build_status(char *s, size_t len, int status, int active)
s[len - 1] = '\0';
}
+static int handle_pri_show_spans(int fd, int argc, char *argv[])
+{
+ int span;
+ int x;
+ char status[256];
+ if (argc != 3)
+ return RESULT_SHOWUSAGE;
+
+ for (span = 0; span < NUM_SPANS; span++) {
+ if (pris[span].pri) {
+ for (x = 0; x < NUM_DCHANS; x++) {
+ if (pris[span].dchannels[x]) {
+ build_status(status, sizeof(status), pris[span].dchanavail[x], pris[span].dchans[x] == pris[span].pri);
+ ast_cli(fd, "PRI span %d/%d: %s\n", span + 1, x, status);
+ }
+ }
+ }
+ }
+ return RESULT_SUCCESS;
+}
+
static int handle_pri_show_span(int fd, int argc, char *argv[])
{
int span;
@@ -9607,6 +9628,10 @@ static const char pri_really_debug_help[] =
static const char pri_show_span_help[] =
"Usage: pri show span <span>\n"
+ " Displays PRI Information on a given PRI span\n";
+
+static const char pri_show_spans_help[] =
+ "Usage: pri show spans\n"
" Displays PRI Information\n";
static struct ast_cli_entry zap_pri_cli[] = {
@@ -9616,6 +9641,8 @@ static struct ast_cli_entry zap_pri_cli[] = {
"Disables PRI debugging on a span", pri_no_debug_help, complete_span_5 },
{ { "pri", "intense", "debug", "span", NULL }, handle_pri_really_debug,
"Enables REALLY INTENSE PRI debugging", pri_really_debug_help, complete_span_5 },
+ { { "pri", "show", "spans", NULL }, handle_pri_show_spans,
+ "Displays PRI Information", pri_show_spans_help },
{ { "pri", "show", "span", NULL }, handle_pri_show_span,
"Displays PRI Information", pri_show_span_help, complete_span_4 },
{ { "pri", "show", "debug", NULL }, handle_pri_show_debug,