diff options
author | Richard Mudgett <rmudgett@digium.com> | 2015-03-13 17:04:43 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2015-03-13 17:04:43 +0000 |
commit | a3292230b87b1e80411dcbb346203b3d8d3ccd5e (patch) | |
tree | 022fcf6d2f4ca00bca610c021aa7e67029015796 /res/res_pjsip | |
parent | 34aa0214ebfc033d5deaa05da98bf9cb740188e3 (diff) |
chan_pjsip: AMI action PJSIPShowEndpoint closes AMI connection on error.
Also fixed similar problem with AMI action PJSIPShowEndpoints.
ASTERISK-24872 #close
Reported by: Dmitriy Serov
Review: https://reviewboard.asterisk.org/r/4487/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip')
-rw-r--r-- | res/res_pjsip/pjsip_configuration.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c index 9a0f85381..e4ec03c11 100644 --- a/res/res_pjsip/pjsip_configuration.c +++ b/res/res_pjsip/pjsip_configuration.c @@ -1159,7 +1159,7 @@ static int ami_show_endpoint(struct mansession *s, const struct message *m) ast_sip_get_sorcery(), "endpoint", endpoint_name))) { astman_send_error_va(s, m, "Unable to retrieve endpoint %s\n", endpoint_name); - return -1; + return 0; } astman_send_listack(s, m, "Following are Events for each object " @@ -1199,7 +1199,7 @@ static int format_ami_endpoints(void *obj, void *arg, int flags) ast_sip_create_ami_event("EndpointList", ami), ast_free); if (!buf) { - return -1; + return CMP_STOP; } sip_sorcery_object_ami_set_type_name(endpoint, &buf); @@ -1238,7 +1238,8 @@ static int ami_show_endpoints(struct mansession *s, const struct message *m) endpoints = ast_sip_get_endpoints(); if (!endpoints) { - return -1; + astman_send_error(s, m, "Could not get endpoints\n"); + return 0; } if (!(num = ao2_container_count(endpoints))) { |