From 19dddbbd308e5d89ccdbfccff05c8575407fd898 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Tue, 23 Sep 2025 07:41:04 -0600 Subject: [PATCH] res_rtp_asterisk.c: Use rtp->dtls in __rtp_sendto when rtcp mux is used. In __rtp_sendto(), the check for DTLS negotiation completion for rtcp packets needs to use the rtp->dtls structure instead of rtp->rtcp->dtls when AST_RTP_INSTANCE_RTCP_MUX is set. Resolves: #1474 --- res/res_rtp_asterisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 40f20f1509..f258b41fd9 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -3453,7 +3453,7 @@ static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t siz int res; #if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP) char *out = buf; - struct dtls_details *dtls = !rtcp ? &rtp->dtls : &rtp->rtcp->dtls; + struct dtls_details *dtls = (!rtcp || rtp->rtcp->type == AST_RTP_INSTANCE_RTCP_MUX) ? &rtp->dtls : &rtp->rtcp->dtls; /* Don't send RTP if DTLS hasn't finished yet */ if (dtls->ssl && ((*out < 20) || (*out > 63)) && dtls->connection == AST_RTP_DTLS_CONNECTION_NEW) {