make NULL and "" equivalent for some cid fields.
authorLuigi Rizzo <rizzo@icir.org>
Fri, 21 Apr 2006 10:00:58 +0000 (10:00 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Fri, 21 Apr 2006 10:00:58 +0000 (10:00 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21792 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cli.c

diff --git a/cli.c b/cli.c
index c61f5a5..591652d 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -446,13 +446,13 @@ static int handle_chanlist(int fd, int argc, char *argv[])
                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 @@ static int handle_showchan(int fd, int argc, char *argv[])
                "           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),