From e82dd73a02d2d66ea141fe56936e874709c7b608 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 27 Jul 2022 14:01:35 -0400 Subject: [PATCH] TT#14008 don't try to offer RTCP after previous mux If an offer is going to a side that is already known to support rtcp-mux, don't try to offer a fallback RTCP port. Do this by pretending that rtcp-mux=require is set, which leads to the correct behaviour. This is needed because the RTCP fallback port might already be closed, so trying to include it in the offer would require opening a new set of ports, which is undesirable. closes #1494 Change-Id: I550bec08379c799cb7dd090a70d090ae47462467 (cherry picked from commit 3ac4863a94b1bf63555df68bf3c59d03b800faae) --- daemon/call.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index c737f61e7..29cc5e219 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1977,7 +1977,7 @@ static void __rtcp_mux_set(const struct sdp_ng_flags *flags, struct call_media * MEDIA_CLEAR(media, RTCP_MUX); } -static void __rtcp_mux_logic(const struct sdp_ng_flags *flags, struct call_media *media, +static void __rtcp_mux_logic(struct sdp_ng_flags *flags, struct call_media *media, struct call_media *other_media) { if (!flags) @@ -1995,11 +1995,16 @@ static void __rtcp_mux_logic(const struct sdp_ng_flags *flags, struct call_media if (flags->opmode != OP_OFFER) return; - /* default is to pass through the client's choice, unless our peer is already * talking rtcp-mux, then we stick to that */ if (!MEDIA_ISSET(media, RTCP_MUX)) bf_copy_same(&media->media_flags, &other_media->media_flags, MEDIA_FLAG_RTCP_MUX); + else { + // mux already in use - unless we were instructed to do something else, + // keep using it and don't offer a fallback choice: this is needed as the + // fallback port might already be closed + flags->rtcp_mux_require = 1; + } /* in our offer, we can override the client's choice */ __rtcp_mux_set(flags, media);