res_pjsip_endpoint_identifier_ip: Add 'show identify(ies)' cli commands

While troubleshooting other things I realized there were no pjsip cli
commands for identify.  This patch adds them.  It also also fixes a
reference leak when a 'show endpoint' displayed identifies and properly
sets the return code if load_module can't allocate a cli formatter structure.

Tested-by: George Joseph

Review: https://reviewboard.asterisk.org/r/4212/
........

Merged revisions 428725 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 428731 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
George Joseph
2014-12-02 00:31:49 +00:00
parent 4ff6bd831f
commit f418f25c44
2 changed files with 81 additions and 7 deletions

View File

@@ -144,6 +144,11 @@ char *ast_sip_cli_traverse_objects(struct ast_cli_entry *e, int cmd, struct ast_
if (!ast_ends_with(cmd2, "s")) {
ast_copy_string(formatter_type, cmd2, sizeof(formatter_type));
is_container = 0;
} else if (ast_ends_with(cmd2, "ies")) {
/* Take the plural "ies" off of the object name and re[place with "y". */
int l = strlen(cmd2);
snprintf(formatter_type, 64, "%*.*sy", l - 3, l - 3, cmd2);
is_container = 1;
} else {
/* Take the plural "s" off of the object name. */
ast_copy_string(formatter_type, cmd2, strlen(cmd2));