diff options
author | George Joseph <george.joseph@fairview5.com> | 2014-09-29 21:59:46 +0000 |
---|---|---|
committer | George Joseph <george.joseph@fairview5.com> | 2014-09-29 21:59:46 +0000 |
commit | faae530006b7a80fad85f61a5384b5686a8da07d (patch) | |
tree | 07cd62fd41c0ad4899ea4e52591e0bbfb3adc22b /res/res_pjsip | |
parent | 8d55892df7b32bffcc9a007bceb7fef81597e058 (diff) |
pjsip_cli: Suppress header print on error or no objects
If there's an error on the pjsip command line or there are no objects, don't
print the column headers.
ASTERISK-24350 #close
Reported-by: Brad Latus
Tested-by: George Joseph
Tested-by: Brad Latus
Review: https://reviewboard.asterisk.org/r/4025/
........
Merged revisions 424128 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip')
-rw-r--r-- | res/res_pjsip/pjsip_cli.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_pjsip/pjsip_cli.c b/res/res_pjsip/pjsip_cli.c index 17876024d..0f0a67648 100644 --- a/res/res_pjsip/pjsip_cli.c +++ b/res/res_pjsip/pjsip_cli.c @@ -198,21 +198,21 @@ char *ast_sip_cli_traverse_objects(struct ast_cli_entry *e, int cmd, struct ast_ if (is_container) { if (!ao2_container_count(container)) { - dump_str_and_free(a->fd, context.output_buffer); + ast_free(context.output_buffer); ast_cli(a->fd, "No objects found.\n\n"); return CLI_SUCCESS; } ao2_callback(container, OBJ_NODATA, formatter_entry->print_body, &context); } else { if (ast_strlen_zero(object_id)) { - dump_str_and_free(a->fd, context.output_buffer); + ast_free(context.output_buffer); ast_cli(a->fd, "No object specified.\n"); return CLI_FAILURE; } object = formatter_entry->retrieve_by_id(object_id); if (!object) { - dump_str_and_free(a->fd, context.output_buffer); + ast_free(context.output_buffer); ast_cli(a->fd, "Unable to find object %s.\n\n", object_id); return CLI_SUCCESS; } |