Pretty up the 'cdr show status' output.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.1
Sean Bright 18 years ago
parent 1503ea7128
commit 8ddc7e949d

@ -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);
if (AST_RWLIST_EMPTY(&be_list)) {
ast_cli(a->fd, " (none)\n");
} else {
AST_RWLIST_TRAVERSE(&be_list, beitem, list) {
ast_cli(a->fd, "CDR registered backend: %s\n", beitem->name);
ast_cli(a->fd, " %s\n", beitem->name);
}
}
AST_RWLIST_UNLOCK(&be_list);
ast_cli(a->fd, "\n");
}
return CLI_SUCCESS;

Loading…
Cancel
Save