[asterisk-commits] seanbright: trunk r126115 - /trunk/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 27 18:29:57 CDT 2008


Author: seanbright
Date: Fri Jun 27 18:29:56 2008
New Revision: 126115

URL: http://svn.digium.com/view/asterisk?view=rev&rev=126115
Log:
Pretty up the 'cdr show status' output.

Modified:
    trunk/main/cdr.c

Modified: trunk/main/cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=126115&r1=126114&r2=126115
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Fri Jun 27 18:29:56 2008
@@ -1269,27 +1269,39 @@
 	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;




More information about the asterisk-commits mailing list