]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pjproject cli: Add object count after object lists 22/5022/2
authorGeorge Joseph <gjoseph@digium.com>
Mon, 20 Feb 2017 14:04:25 +0000 (07:04 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 20 Feb 2017 14:07:17 +0000 (08:07 -0600)
When listing a container, we now print the number of objects
in the container at the end of the list.

Change-Id: I791cbc3ee9da9a2af9adc655164b5d32953df812

res/res_pjsip/pjsip_cli.c

index e6433f43587c40c3e4b4b12f0ca80c9ee4212219..56ec191edd1cedcf727fc0d5608ff9e16d6ba4bb 100644 (file)
@@ -221,6 +221,8 @@ char *ast_sip_cli_traverse_objects(struct ast_cli_entry *e, int cmd, struct ast_
                        return CLI_SUCCESS;
                }
                ao2_callback(container, OBJ_NODATA, formatter_entry->print_body, &context);
+               ast_str_append(&context.output_buffer, 0, "\nObjects found: %d\n", ao2_container_count(container));
+
        } else {
                if (ast_strlen_zero(object_id)) {
                        ast_free(context.output_buffer);