From 6d322b565863aa92c86572c10e4b353a51fafe21 Mon Sep 17 00:00:00 2001 From: Naveen Albert Date: Sat, 18 Apr 2026 05:33:37 -0400 Subject: [PATCH] chan_iax2: Add CHANNEL getter to retrieve auth method. Add a property to the CHANNEL method to retrieve the auth method, which can be used to retrieve the specific auth method actually negotiated for a call (e.g. RSA, MD5, etc.). Also clean up some of the documentation for the secure properties to clarify how these relate to call encryption. Resolves: #1878 UserNote: CHANNEL(auth_method) can now be used to retrieve the auth method negotiated for a call on IAX2 channels. --- channels/chan_iax2.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 93453b6bec..669ed728a4 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -224,11 +224,24 @@ R/O Get the peer's username. + + R/O Get the authentication method used for the call. + + + + + + + - R/O Get the if the IAX channel is secured. + R/O Get if the IAX channel is secured (encryption used for the call). + Because IAX encryption applies to both signaling and media, this setting + provides the same value as secure_media. - R/O Get the if the IAX channel is secured. + R/O Get if the IAX channel is secured (encryption used for the call). + Because IAX encryption applies to both signaling and media, this setting + provides the same value as secure_signaling. @@ -14714,6 +14727,8 @@ static int acf_channel_read(struct ast_channel *chan, const char *funcname, char ast_copy_string(buf, !ast_sockaddr_isnull(&pvt->addr) ? ast_sockaddr_stringify_addr(&pvt->addr) : "", buflen); } else if (!strcasecmp(args, "peername")) { ast_copy_string(buf, pvt->username, buflen); + } else if (!strcasecmp(args, "auth_method")) { + ast_copy_string(buf, auth_method_labels[pvt->eff_auth_method], buflen); } else if (!strcasecmp(args, "secure_signaling") || !strcasecmp(args, "secure_media")) { snprintf(buf, buflen, "%s", IAX_CALLENCRYPTED(pvt) ? "1" : ""); } else {