diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 23:29:56 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 23:29:56 +0000 |
commit | 7b18edac557b923640b1f474ed8e3cef3975d133 (patch) | |
tree | 8988d9ad66c08938f7fa9fe92e20cafda969deea /main/cdr.c | |
parent | 77569e494e40134b74bcd7b0d398d6b329af7b65 (diff) |
Pretty up the 'cdr show status' output.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@126115 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cdr.c')
-rw-r--r-- | main/cdr.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/main/cdr.c b/main/cdr.c index 9df82579b..259328fe1 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -1269,27 +1269,39 @@ static char *handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_ if (a->argc > 3) return CLI_SHOWUSAGE; - ast_cli(a->fd, "CDR logging: %s\n", enabled ? "enabled" : "disabled"); - ast_cli(a->fd, "CDR mode: %s\n", batchmode ? "batch" : "simple"); + ast_cli(a->fd, "\n"); + ast_cli(a->fd, "Call Detail Record (CDR) settings\n"); + ast_cli(a->fd, "----------------------------------\n"); + ast_cli(a->fd, " Logging: %s\n", enabled ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Mode: %s\n", batchmode ? "Batch" : "Simple"); if (enabled) { - ast_cli(a->fd, "CDR output unanswered calls: %s\n", unanswered ? "yes" : "no"); + ast_cli(a->fd, " Log unanswered calls: %s\n\n", unanswered ? "Yes" : "No"); if (batchmode) { + ast_cli(a->fd, "* Batch Mode Settings\n"); + ast_cli(a->fd, " -------------------\n"); if (batch) cnt = batch->size; if (cdr_sched > -1) nextbatchtime = ast_sched_when(sched, cdr_sched); - ast_cli(a->fd, "CDR safe shut down: %s\n", batchsafeshutdown ? "enabled" : "disabled"); - ast_cli(a->fd, "CDR batch threading model: %s\n", batchscheduleronly ? "scheduler only" : "scheduler plus separate threads"); - ast_cli(a->fd, "CDR current batch size: %d record%s\n", cnt, ESS(cnt)); - ast_cli(a->fd, "CDR maximum batch size: %d record%s\n", batchsize, ESS(batchsize)); - ast_cli(a->fd, "CDR maximum batch time: %d second%s\n", batchtime, ESS(batchtime)); - ast_cli(a->fd, "CDR next scheduled batch processing time: %ld second%s\n", nextbatchtime, ESS(nextbatchtime)); + ast_cli(a->fd, " Safe shutdown: %s\n", batchsafeshutdown ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Threading model: %s\n", batchscheduleronly ? "Scheduler only" : "Scheduler plus separate threads"); + ast_cli(a->fd, " Current batch size: %d record%s\n", cnt, ESS(cnt)); + ast_cli(a->fd, " Maximum batch size: %d record%s\n", batchsize, ESS(batchsize)); + ast_cli(a->fd, " Maximum batch time: %d second%s\n", batchtime, ESS(batchtime)); + ast_cli(a->fd, " Next batch processing time: %ld second%s\n\n", nextbatchtime, ESS(nextbatchtime)); } + ast_cli(a->fd, "* Registered Backends\n"); + ast_cli(a->fd, " -------------------\n"); AST_RWLIST_RDLOCK(&be_list); - AST_RWLIST_TRAVERSE(&be_list, beitem, list) { - ast_cli(a->fd, "CDR registered backend: %s\n", beitem->name); + if (AST_RWLIST_EMPTY(&be_list)) { + ast_cli(a->fd, " (none)\n"); + } else { + AST_RWLIST_TRAVERSE(&be_list, beitem, list) { + ast_cli(a->fd, " %s\n", beitem->name); + } } AST_RWLIST_UNLOCK(&be_list); + ast_cli(a->fd, "\n"); } return CLI_SUCCESS; |