aboutsummaryrefslogtreecommitdiffstats
path: root/main/cli.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 04:43:33 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 04:43:33 +0000
commita5efdcb36154ed5c5d6325ccc1b4dd99490b48e9 (patch)
tree1f70ab1c1a8d010ade37a053edebff107ad9fcc9 /main/cli.c
parentfc61184a360cc7cbbf3c4678368cfa045ff33d31 (diff)
Context tracing for channels
(closes issue #11268) Reported by: moy Patches: chantrace-datastored-encapsulated-rev94934.patch uploaded by moy (license 222) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103754 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c
index 8813c6a3f..806542102 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -987,6 +987,9 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
char nf[256], wf[256], rf[256];
long elapsed_seconds=0;
int hour=0, min=0, sec=0;
+#ifdef CHANNEL_TRACE
+ int trace_enabled;
+#endif
switch (cmd) {
case CLI_INIT:
@@ -1071,7 +1074,12 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
ast_cli(a->fd," Variables:\n%s\n", out->str);
if (c->cdr && ast_cdr_serialize_variables(c->cdr, &out, '=', '\n', 1))
ast_cli(a->fd," CDR Variables:\n%s\n", out->str);
-
+#ifdef CHANNEL_TRACE
+ trace_enabled = ast_channel_trace_is_enabled(c);
+ ast_cli(a->fd, " Context Trace: %s\n", trace_enabled ? "Enabled" : "Disabled");
+ if (trace_enabled && ast_channel_trace_serialize(c, &out))
+ ast_cli(a->fd, " Trace:\n%s\n", out->str);
+#endif
ast_channel_unlock(c);
return CLI_SUCCESS;
}