diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-11 00:54:54 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-11 00:54:54 +0000 |
commit | a8ec4ca20217748203fc7f8c541cf4d980bcda61 (patch) | |
tree | c6b898bb8ba0f68815a0db12ee39c8a827d8a091 /main/translate.c | |
parent | 00e26442c51a8c811b970a4dbc7820a428da9e21 (diff) |
Fix "core show translation" to not output information for "unknown" codecs.
This fix was made in favor of the proposed patch since it doesn't involve changing
a core codec define.
(closes issue #11722, reported and initially patched by caio1982, final patch by me)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@98047 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/translate.c')
-rw-r--r-- | main/translate.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/translate.c b/main/translate.c index 017f8b19b..6c27e4e24 100644 --- a/main/translate.c +++ b/main/translate.c @@ -557,9 +557,14 @@ static char *handle_cli_core_show_translation(struct ast_cli_entry *e, int cmd, } for (x = -1; x < SHOW_TRANS; x++) { struct ast_str *out = ast_str_alloca(120); - + /*Go ahead and move to next iteration if dealing with an unknown codec*/ + if(x >= 0 && !strcmp(ast_getformatname(1 << (x)), "unknown")) + continue; ast_str_set(&out, -1, " "); for (y = -1; y < SHOW_TRANS; y++) { + /*Go ahead and move to next iteration if dealing with an unknown codec*/ + if (y >= 0 && !strcmp(ast_getformatname(1 << (y)), "unknown")) + continue; if (y >= 0) curlen = strlen(ast_getformatname(1 << (y))); if (curlen < 5) |