aboutsummaryrefslogtreecommitdiffstats
path: root/main/cli.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-05 20:54:30 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-05 20:54:30 +0000
commit80e141d6ff27c22f20e9eb9639ff84d65c07a89e (patch)
treee153ed82937f1c994dd8145b3a43521624bf2c7b /main/cli.c
parentd5f935aea5f19c476fc69ab61cc14ec8c3ab5b70 (diff)
Implement flags for AGI in the channel structure so taht "show channels" and
AMI commands can display that a channel is under control of an AGI. Work inspired by work at customer site, but paid for by Edvina AB git-svn-id: http://svn.digium.com/svn/asterisk/trunk@128240 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c
index 1335ec6b7..6cbaf9a72 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -628,6 +628,20 @@ static char *handle_showcalls(struct ast_cli_entry *e, int cmd, struct ast_cli_a
return RESULT_SUCCESS;
}
+/*! \brief Add a marker before the app if the channel is controlled by AGI/FastAGI or AsyncAGI
+ Used for "show channels"
+*/
+static const char *agi_flag(struct ast_channel *chan)
+{
+ if (ast_test_flag(chan, AST_FLAG_AGI))
+ return "[AGI] ";
+ if (ast_test_flag(chan, AST_FLAG_FASTAGI))
+ return "[FAGI] ";
+ if (ast_test_flag(chan, AST_FLAG_ASYNCAGI))
+ return "[AAGI] ";
+ return "";
+}
+
static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
#define FORMAT_STRING "%-20.20s %-20.20s %-7.7s %-30.30s\n"
@@ -723,7 +737,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
if (!ast_strlen_zero(c->context) && !ast_strlen_zero(c->exten))
snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", c->exten, c->context, c->priority);
if (c->appl)
- snprintf(appdata, sizeof(appdata), "%s(%s)", c->appl, S_OR(c->data, ""));
+ snprintf(appdata, sizeof(appdata), "%s%s(%s)", agi_flag(c), c->appl, S_OR(c->data, ""));
ast_cli(fd, FORMAT_STRING, c->name, locbuf, ast_state2str(c->_state), appdata);
}
}