aboutsummaryrefslogtreecommitdiffstats
path: root/cli.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-09 06:14:30 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-09 06:14:30 +0000
commitc199e3b0e21f73b47735d1a1ffadbc7b678c76bc (patch)
tree4f501a44df1b328176de6c855109c20ee36402e9 /cli.c
parentbacddfcf518c946535e9c72a3259900c1fb488c8 (diff)
use S_OR where appropriate, comment an unclear difference in format
between CONCISE and VERBOSE git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25860 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cli.c')
-rw-r--r--cli.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/cli.c b/cli.c
index 09803954f..0c5e84088 100644
--- a/cli.c
+++ b/cli.c
@@ -422,15 +422,21 @@ 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->appl ? c->appl : "(None)",
+ S_OR(c->data, ""), /* XXX different from verbose ? */
S_OR(c->cid.cid_num, ""),
- c->accountcode ? c->accountcode : "", c->amaflags,
- durbuf, bc ? bc->name : "(None)");
+ S_OR(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)",
- S_OR(c->cid.cid_num, ""), durbuf,
- c->accountcode ? c->accountcode : "", bc ? bc->name : "(None)");
+ c->appl ? c->appl : "(None)",
+ c->data ? S_OR(c->data, "(Empty)" ): "(None)",
+ S_OR(c->cid.cid_num, ""),
+ durbuf,
+ S_OR(c->accountcode, ""),
+ bc ? bc->name : "(None)");
} else {
if (!ast_strlen_zero(c->context) && !ast_strlen_zero(c->exten))
snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", c->exten, c->context, c->priority);