Commit 34081bb4df for asterisk.org
commit 34081bb4df2693284b8c89d31ce3ff613645937c
Author: Jaco Kroon <jaco@uls.co.za>
Date: Thu May 7 23:07:32 2026 +0200
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 <jaco@uls.co.za>
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;
}