[asterisk-commits] trunk r21792 - /trunk/cli.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 21 03:01:01 MST 2006


Author: rizzo
Date: Fri Apr 21 05:00:58 2006
New Revision: 21792

URL: http://svn.digium.com/view/asterisk?rev=21792&view=rev
Log:
make NULL and "" equivalent for some cid fields.


Modified:
    trunk/cli.c

Modified: trunk/cli.c
URL: http://svn.digium.com/view/asterisk/trunk/cli.c?rev=21792&r1=21791&r2=21792&view=diff
==============================================================================
--- trunk/cli.c (original)
+++ trunk/cli.c Fri Apr 21 05:00:58 2006
@@ -446,13 +446,13 @@
 		if (concise) {
 			ast_cli(fd, CONCISE_FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state),
 			        c->appl ? c->appl : "(None)", c->data ? c->data : "",
-			        c->cid.cid_num ? c->cid.cid_num : "",
+			        S_OR(c->cid.cid_num, ""),
 			        c->accountcode ? c->accountcode : "", c->amaflags, 
 			        durbuf, bc ? bc->name : "(None)");
 		} else if (verbose) {
 			ast_cli(fd, VERBOSE_FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state),
 			        c->appl ? c->appl : "(None)", c->data ? S_OR(c->data, "(Empty)" ): "(None)",
-			        c->cid.cid_num ? c->cid.cid_num : "", durbuf,
+			        S_OR(c->cid.cid_num, ""), durbuf,
 			        c->accountcode ? c->accountcode : "", bc ? bc->name : "(None)");
 		} else {
 			if (!ast_strlen_zero(c->context) && !ast_strlen_zero(c->exten)) 
@@ -750,9 +750,9 @@
 		"           Data: %s\n"
 		"    Blocking in: %s\n",
 		c->name, c->tech->type, c->uniqueid,
-		(c->cid.cid_num ? c->cid.cid_num : "(N/A)"),
-		(c->cid.cid_name ? c->cid.cid_name : "(N/A)"),
-		(c->cid.cid_dnid ? c->cid.cid_dnid : "(N/A)" ), ast_state2str(c->_state), c->_state, c->rings, 
+		S_OR(c->cid.cid_num, "(N/A)"),
+		S_OR(c->cid.cid_name, "(N/A)"),
+		S_OR(c->cid.cid_dnid, "(N/A)"), ast_state2str(c->_state), c->_state, c->rings, 
 		ast_getformatname_multiple(nf, sizeof(nf), c->nativeformats), 
 		ast_getformatname_multiple(wf, sizeof(wf), c->writeformat), 
 		ast_getformatname_multiple(rf, sizeof(rf), c->readformat),



More information about the asterisk-commits mailing list