]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_asterisk.c: Use rtp->dtls in __rtp_sendto when rtcp mux is used.
authorGeorge Joseph <gjoseph@sangoma.com>
Tue, 23 Sep 2025 13:41:04 +0000 (07:41 -0600)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 23 Sep 2025 15:41:51 +0000 (15:41 +0000)
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

index 40f20f1509760d9716c94ea00607c466129a007b..f258b41fd90245e76053674de6a56532e77680ca 100644 (file)
@@ -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) {