[asterisk-commits] seanbright: branch group/NoLossCDR-Redux2 r105548 - /team/group/NoLossCDR-Red...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Mar 1 10:59:22 CST 2008


Author: seanbright
Date: Sat Mar  1 10:59:21 2008
New Revision: 105548

URL: http://svn.digium.com/view/asterisk?view=rev&rev=105548
Log:
Minor formatting fixes and misc. clean-up

Modified:
    team/group/NoLossCDR-Redux2/main/cdr.c

Modified: team/group/NoLossCDR-Redux2/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/group/NoLossCDR-Redux2/main/cdr.c?view=diff&rev=105548&r1=105547&r2=105548
==============================================================================
--- team/group/NoLossCDR-Redux2/main/cdr.c (original)
+++ team/group/NoLossCDR-Redux2/main/cdr.c Sat Mar  1 10:59:21 2008
@@ -1199,7 +1199,7 @@
 		e->command = "cdr show status";
 		e->usage = 
 			"Usage: cdr show status\n"
-			"	Displays the Call Detail Record engine system status.\n";
+			"       Displays the Call Detail Record engine system status.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
@@ -1208,24 +1208,26 @@
 	if (a->argc > 3)
 		return CLI_SHOWUSAGE;
 
-	/* What if there are no backends? */
 	ast_cli(a->fd, "\n");
 	ast_cli(a->fd, "Call Detail Recording (CDR) Status\n");
 	ast_cli(a->fd, "----------------------------------\n");
-	ast_cli(a->fd, "  Engine status: %s\n", enabled ? "Enabled" : "Disabled");
-
-	/* Since we unregister the CLI command when enabled=no, we will never get when !enabled */
+	ast_cli(a->fd, "  Engine status:           %s\n", enabled ? "Enabled" : "Disabled");
+
 	if (enabled) {
-		ast_cli(a->fd, "  Safe shutdown: %s\n\n", safeshutdown ? "Enabled" : "Disabled");
-		ast_cli(a->fd, "  CDR output unanswered calls: %s\n\n", unanswered ? "yes" : "no");
-		ast_cli(a->fd, "  Registered Backends:\n");
-		ast_cli(a->fd, "  --------------------\n");
+		ast_cli(a->fd, "  Safe shutdown:           %s\n", safeshutdown ? "Enabled" : "Disabled");
+		ast_cli(a->fd, "  Output unanswered calls: %s\n\n", unanswered ? "Yes" : "No");
 		AST_RWLIST_RDLOCK(&backends);
-		AST_RWLIST_TRAVERSE(&backends, backend, list) {
-			if (ast_strlen_zero(backend->sink_name)) {
-				ast_cli(a->fd, "  %s\n", backend->description);
-			} else {
-				ast_cli(a->fd, "  %s (%s)\n", backend->description, backend->sink_name);
+		/* What if there are no backends? */
+		if (!AST_RWLIST_EMPTY(&backends)) {
+			ast_cli(a->fd, "* Registered Backends:\n");
+			ast_cli(a->fd, "  --------------------\n");
+
+			AST_RWLIST_TRAVERSE(&backends, backend, list) {
+				if (ast_strlen_zero(backend->sink_name)) {
+					ast_cli(a->fd, "  %s\n", backend->description);
+				} else {
+					ast_cli(a->fd, "  %s (%s)\n", backend->description, backend->sink_name);
+				}
 			}
 		}
 		AST_RWLIST_UNLOCK(&backends);




More information about the asterisk-commits mailing list