diff options
author | Sean Bright <sean@malleable.com> | 2012-02-21 11:17:53 +0000 |
---|---|---|
committer | Sean Bright <sean@malleable.com> | 2012-02-21 11:17:53 +0000 |
commit | 1c971ae60497cc84d2c847a277c62531b663d8d4 (patch) | |
tree | 6ad7d571e4b7788e20465e4db6642fa50ebf9546 | |
parent | 4585ec1bbf2cf26de5cd322430ff012cae0893ce (diff) |
Make 'iax2 show callnumber usage' output make sense when an IP is passed in.
........
Merged revisions 356107 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 356108 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_iax2.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 6a50b8ba2..7a0d8265d 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -2599,15 +2599,21 @@ static char *handle_cli_iax2_show_callno_limits(struct ast_cli_entry *e, int cmd if (a->argc < 4 || a->argc > 5) return CLI_SHOWUSAGE; - ast_cli(a->fd, "%-15s %-12s %-12s\n", "Address", "Callno Usage", "Callno Limit"); + if (a->argc == 4) { + ast_cli(a->fd, "%-15s %-12s %-12s\n", "Address", "Callno Usage", "Callno Limit"); + } + i = ao2_iterator_init(peercnts, 0); while ((peercnt = ao2_iterator_next(&i))) { sin.sin_addr.s_addr = peercnt->addr; - if (a->argc == 5 && (!strcasecmp(a->argv[4], ast_inet_ntoa(sin.sin_addr)))) { + if (a->argc == 5) { + if (!strcasecmp(a->argv[4], ast_inet_ntoa(sin.sin_addr))) { + ast_cli(a->fd, "%-15s %-12s %-12s\n", "Address", "Callno Usage", "Callno Limit"); ast_cli(a->fd, "%-15s %-12d %-12d\n", ast_inet_ntoa(sin.sin_addr), peercnt->cur, peercnt->limit); ao2_ref(peercnt, -1); found = 1; break; + } } else { ast_cli(a->fd, "%-15s %-12d %-12d\n", ast_inet_ntoa(sin.sin_addr), peercnt->cur, peercnt->limit); } @@ -2628,7 +2634,7 @@ static char *handle_cli_iax2_show_callno_limits(struct ast_cli_entry *e, int cmd ao2_container_count(callno_pool), ao2_container_count(callno_pool_trunk)); } else if (a->argc == 5 && !found) { - ast_cli(a->fd, "No callnumber table entries for %s found\n", a->argv[4] ); + ast_cli(a->fd, "No call number table entries for %s found\n", a->argv[4] ); } |