From 2eddf5b868f16561c813dc08a3d0bcd311d3bcb0 Mon Sep 17 00:00:00 2001 From: Jaco Kroon Date: Thu, 7 May 2026 23:07:32 +0200 Subject: [PATCH] pjsip_configuration: Show actual dtls_verify config. Rather than merely showing dtls_verify : Yes/No in pjsip show endpoint xxx it will now be shown what exactly is being checked, ie, one of: dtls_verify : No dtls_verify : Fingerprint dtls_verify : Certificate dtls_verify : Yes Where Yes implies both Fingerprint and Certificate. Signed-off-by: Jaco Kroon --- res/res_pjsip/pjsip_configuration.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c index 12b8ee6f88..4d4d06a9b6 100644 --- a/res/res_pjsip/pjsip_configuration.c +++ b/res/res_pjsip/pjsip_configuration.c @@ -1021,7 +1021,19 @@ static int dtls_handler(const struct aco_option *opt, static int dtlsverify_to_str(const void *obj, const intptr_t *args, char **buf) { const struct ast_sip_endpoint *endpoint = obj; - *buf = ast_strdup(AST_YESNO(endpoint->media.rtp.dtls_cfg.verify)); + if (endpoint->media.rtp.dtls_cfg.verify == AST_RTP_DTLS_VERIFY_NONE) { + *buf = ast_strdup("No"); + } else if (endpoint->media.rtp.dtls_cfg.verify == AST_RTP_DTLS_VERIFY_FINGERPRINT) { + *buf = ast_strdup("Fingerprint"); + } else if (endpoint->media.rtp.dtls_cfg.verify == AST_RTP_DTLS_VERIFY_CERTIFICATE) { + *buf = ast_strdup("Certificate"); + } else if (endpoint->media.rtp.dtls_cfg.verify == (AST_RTP_DTLS_VERIFY_FINGERPRINT|AST_RTP_DTLS_VERIFY_CERTIFICATE)) { + *buf = ast_strdup("Yes"); + } else { + *buf = NULL; + ast_assert(0); + return 1; + } return 0; }