diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index aff86a6331..43d486e575 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2919,15 +2919,27 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl for (x = 0; x < profile->rtpip_index; x++) { stream->write_function(stream, " %s\n", switch_str_nil(profile->rtpip[x])); } - stream->write_function(stream, " %s\n", profile->extrtpip); + if (profile->extrtpip) { + stream->write_function(stream, " %s\n", profile->extrtpip); + } stream->write_function(stream, " %s\n", switch_str_nil(profile->sipip)); - stream->write_function(stream, " %s\n", profile->extsipip); - stream->write_function(stream, " %s\n", switch_str_nil(profile->url)); - stream->write_function(stream, " %s\n", switch_str_nil(profile->bindurl)); - stream->write_function(stream, " %s\n", switch_str_nil(profile->tls_url)); - stream->write_function(stream, " %s\n", switch_str_nil(profile->tls_bindurl)); - stream->write_function(stream, " %s\n", switch_str_nil(profile->ws_bindurl)); - stream->write_function(stream, " %s\n", switch_str_nil(profile->wss_bindurl)); + if (profile->extsipip) { + stream->write_function(stream, " %s\n", profile->extsipip); + } + if (! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only) { + stream->write_function(stream, " %s\n", switch_str_nil(profile->url)); + stream->write_function(stream, " %s\n", switch_str_nil(profile->bindurl)); + } + if (sofia_test_pflag(profile, PFLAG_TLS)) { + stream->write_function(stream, " %s\n", switch_str_nil(profile->tls_url)); + stream->write_function(stream, " %s\n", switch_str_nil(profile->tls_bindurl)); + } + if (profile->ws_bindurl) { + stream->write_function(stream, " %s\n", switch_str_nil(profile->ws_bindurl)); + } + if (profile->wss_bindurl) { + stream->write_function(stream, " %s\n", switch_str_nil(profile->wss_bindurl)); + } stream->write_function(stream, " %s\n", zstr(profile->hold_music) ? "N/A" : profile->hold_music); stream->write_function(stream, " %s\n", zstr(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy); @@ -2935,9 +2947,13 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl stream->write_function(stream, " %s\n", switch_str_nil(profile->outbound_codec_string)); stream->write_function(stream, " %d\n", profile->te); - stream->write_function(stream, " rfc2833\n"); - stream->write_function(stream, " info\n"); - stream->write_function(stream, " none\n"); + if (profile->dtmf_type == DTMF_2833) { + stream->write_function(stream, " rfc2833\n"); + } else if (profile->dtmf_type == DTMF_INFO) { + stream->write_function(stream, " info\n"); + } else { + stream->write_function(stream, " none\n"); + } stream->write_function(stream, " %d\n", profile->cng_pt); stream->write_function(stream, " %d\n", profile->session_timeout); stream->write_function(stream, " %d\n", profile->max_proceeding); @@ -2947,9 +2963,13 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl stream->write_function(stream, " %s\n", sofia_test_flag(profile, TFLAG_ZRTP_PASSTHRU) ? "true" : "false"); stream->write_function(stream, " %s\n", sofia_test_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION) ? "true" : "false"); - stream->write_function(stream, " %s\n", switch_str_nil(profile->user_agent_filter)); - stream->write_function(stream, " %d\n", + if (profile->user_agent_filter) { + stream->write_function(stream, " %s\n", switch_str_nil(profile->user_agent_filter)); + } + if (profile->max_registrations_perext > 0) { + stream->write_function(stream, " %d\n", profile->max_registrations_perext); + } stream->write_function(stream, " %u\n", profile->ib_calls); stream->write_function(stream, " %u\n", profile->ob_calls); stream->write_function(stream, " %u\n", profile->ib_failed_calls);