diff options
author | George Joseph <gjoseph@digium.com> | 2016-12-06 13:54:25 -0700 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2016-12-07 18:11:28 -0600 |
commit | 79b09b5f18ad3de01030d9db1f9c45e91960fd0b (patch) | |
tree | a6b861f851277f5b1781901a77f7b7afc8cfd543 /res/res_pjsip/pjsip_options.c | |
parent | 1067b9add3784c5873ca701bcf24b7bc2844894f (diff) |
res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command
The PJSIPShowRegistrationsInbound AMI command was just dumping out
all AORs which was pretty useless and resource heavy since it had
to get all endpoints, then all aors for each endpoint, then all
contacts for each aor.
PJSIPShowRegistrationInboundContactStatuses sends ContactStatusDetail
events which meets the intended purpose of the other command and has
significantly less overhead. Also, some additional fields that were
added to Contact since the original creation of the ContactStatusDetail
event have been added to the end of the event.
For compatibility purposes, PJSIPShowRegistrationsInbound is left
intact.
ASTERISK-26644 #close
Change-Id: I326f12c9ecb52bf37ba03f0748749de4da01490a
Diffstat (limited to 'res/res_pjsip/pjsip_options.c')
-rw-r--r-- | res/res_pjsip/pjsip_options.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c index 09fe1559b..d2b812dfc 100644 --- a/res/res_pjsip/pjsip_options.c +++ b/res/res_pjsip/pjsip_options.c @@ -1217,7 +1217,7 @@ static void qualify_and_schedule_all(void) } -static int format_contact_status(void *obj, void *arg, int flags) +int ast_sip_format_contact_ami(void *obj, void *arg, int flags) { struct ast_sip_contact_wrapper *wrapper = obj; struct ast_sip_contact *contact = wrapper->contact; @@ -1256,7 +1256,15 @@ static int format_contact_status(void *obj, void *arg, int flags) ast_str_append(&buf, 0, "RoundtripUsec: %" PRId64 "\r\n", status->rtt); } ast_str_append(&buf, 0, "EndpointName: %s\r\n", - ast_sorcery_object_get_id(endpoint)); + endpoint ? ast_sorcery_object_get_id(endpoint) : S_OR(contact->endpoint_name, "")); + + ast_str_append(&buf, 0, "ID: %s\r\n", ast_sorcery_object_get_id(contact)); + ast_str_append(&buf, 0, "AuthenticateQualify: %d\r\n", contact->authenticate_qualify); + ast_str_append(&buf, 0, "OutboundProxy: %s\r\n", contact->outbound_proxy); + ast_str_append(&buf, 0, "Path: %s\r\n", contact->path); + ast_str_append(&buf, 0, "QualifyFrequency: %u\r\n", contact->qualify_frequency); + ast_str_append(&buf, 0, "QualifyTimeout: %.3f\r\n", contact->qualify_timeout); + astman_append(ami->s, "%s\r\n", ast_str_buffer(buf)); ami->count++; @@ -1269,7 +1277,7 @@ static int format_contact_status_for_aor(void *obj, void *arg, int flags) { struct ast_sip_aor *aor = obj; - return ast_sip_for_each_contact(aor, format_contact_status, arg); + return ast_sip_for_each_contact(aor, ast_sip_format_contact_ami, arg); } static int format_ami_contact_status(const struct ast_sip_endpoint *endpoint, |