summaryrefslogtreecommitdiff
path: root/res/res_pjsip/pjsip_cli.c
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2014-12-02 00:30:12 +0000
committerGeorge Joseph <george.joseph@fairview5.com>2014-12-02 00:30:12 +0000
commit7472c661ca1f6509ed0fa4c07b7e6e1c306eb643 (patch)
treefd2ce6ad78647a0af028b15059e7f674d286ed33 /res/res_pjsip/pjsip_cli.c
parentd79c68d3fb3b27d9632ec91b8a0fc572bf833f4b (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip/pjsip_cli.c')
-rw-r--r--res/res_pjsip/pjsip_cli.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_pjsip/pjsip_cli.c b/res/res_pjsip/pjsip_cli.c
index 0f0a67648..e15e75da4 100644
--- a/res/res_pjsip/pjsip_cli.c
+++ b/res/res_pjsip/pjsip_cli.c
@@ -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));