From: Mark Murawski Date: Mon, 24 Mar 2025 01:05:55 +0000 (-0400) Subject: chan_pjsip: Add the same details as PJSIPShowContacts to the CLI via 'pjsip show... X-Git-Tag: 21.9.0-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cceb936c0161ce763307fdac7fb5c56e929e8a8;p=thirdparty%2Fasterisk.git chan_pjsip: Add the same details as PJSIPShowContacts to the CLI via 'pjsip show contact' CLI 'pjsip show contact' does not show enough information. One must telnet to AMI or write a script to ask Asterisk for example what the User-Agent is on a Contact This feature adds the same details as PJSIPShowContacts to the CLI Resolves: #643 (cherry picked from commit abc8c5c93af939cda304d1fbb47f40db92e68c0a) --- diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index 42934e5564..2c7d25c688 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -1136,6 +1136,11 @@ static int cli_contact_print_body(void *obj, void *arg, int flags) ast_sip_get_contact_short_status_label(status ? status->status : UNKNOWN), (status && (status->status == AVAILABLE)) ? ((long long) status->rtt) / 1000.0 : NAN); + if (context->show_details || (context->show_details_only_level_0 && context->indent_level == 0)) { + ast_str_append(&context->output_buffer, 0, "\n"); + ast_sip_cli_print_sorcery_objectset(contact, context, 0); + } + ao2_cleanup(status); return 0; }