diff options
author | Joshua Colp <jcolp@digium.com> | 2015-11-21 11:36:47 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-11-21 11:36:48 -0600 |
commit | fa969196b36cabe3f388b5c62baf987c7c33bbc6 (patch) | |
tree | 5a109a95380914b1f182dc57794a72a04fd2617b | |
parent | 6dd8b6721620686faf4ea31b4eee70ec4d872718 (diff) | |
parent | af288b2d9650bf7fdc30591e82a06b6c7610b80f (diff) |
Merge "main/cli: Use proper string methods to check existence of context/exten/app" into 13
-rw-r--r-- | main/cli.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/cli.c b/main/cli.c index 0d66f3e48..7f86eab3a 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1076,10 +1076,12 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar char locbuf[40] = "(None)"; char appdata[40] = "(None)"; - if (!cs->context && !cs->exten) + if (!ast_strlen_zero(cs->context) && !ast_strlen_zero(cs->exten)) { snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", cs->exten, cs->context, cs->priority); - if (cs->appl) + } + if (!ast_strlen_zero(cs->appl)) { snprintf(appdata, sizeof(appdata), "%s(%s)", cs->appl, S_OR(cs->data, "")); + } ast_cli(a->fd, FORMAT_STRING, cs->name, locbuf, ast_state2str(cs->state), appdata); } } |