diff --git a/daemon/call.c b/daemon/call.c index 20c7794b0..dad3cbb65 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1483,7 +1483,7 @@ static void __rtcp_mux_logic(const struct sdp_ng_flags *flags, struct call_media if (flags->opmode == OP_ANSWER) { /* default is to go with the client's choice, unless we were instructed not * to do that in the offer (see below) */ - if (!MEDIA_ISSET(media, RTCP_MUX_OVERRIDE)) + if (!MEDIA_ISSET(other_media, RTCP_MUX_OVERRIDE)) bf_copy_same(&media->media_flags, &other_media->media_flags, MEDIA_FLAG_RTCP_MUX); return; @@ -1506,14 +1506,14 @@ static void __rtcp_mux_logic(const struct sdp_ng_flags *flags, struct call_media /* we can also control what's going to happen in the answer. it * depends on what was offered, but by default we go with the other * client's choice */ - MEDIA_CLEAR(other_media, RTCP_MUX_OVERRIDE); + MEDIA_CLEAR(media, RTCP_MUX_OVERRIDE); if (MEDIA_ISSET(other_media, RTCP_MUX)) { if (!MEDIA_ISSET(media, RTCP_MUX)) { /* rtcp-mux was offered, but we don't offer it ourselves. * the answer will not accept rtcp-mux (wasn't offered). * the default is to accept the offer, unless we want to * explicitly reject it. */ - MEDIA_SET(other_media, RTCP_MUX_OVERRIDE); + MEDIA_SET(media, RTCP_MUX_OVERRIDE); if (flags->rtcp_mux_reject) MEDIA_CLEAR(other_media, RTCP_MUX); } @@ -1523,9 +1523,9 @@ static void __rtcp_mux_logic(const struct sdp_ng_flags *flags, struct call_media * either explicitly accept it (possibly demux) or reject * it (possible reverse demux). */ if (flags->rtcp_mux_accept) - MEDIA_SET(other_media, RTCP_MUX_OVERRIDE); + MEDIA_SET(media, RTCP_MUX_OVERRIDE); else if (flags->rtcp_mux_reject) { - MEDIA_SET(other_media, RTCP_MUX_OVERRIDE); + MEDIA_SET(media, RTCP_MUX_OVERRIDE); MEDIA_CLEAR(other_media, RTCP_MUX); } } @@ -1533,7 +1533,7 @@ static void __rtcp_mux_logic(const struct sdp_ng_flags *flags, struct call_media else { /* rtcp-mux was not offered. we may offer it, but since it wasn't * offered to us, we must not accept it. */ - MEDIA_SET(other_media, RTCP_MUX_OVERRIDE); + MEDIA_SET(media, RTCP_MUX_OVERRIDE); } } diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 8c15af69b..6d54593de 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -3557,6 +3557,143 @@ SDP +# gh #793 + +new_call; + +offer('gh #793 b1', { ICE => 'remove', 'via-branch' => 'x123', 'rtcp-mux' => ['demux'] }, < 'remove', 'via-branch' => 'x456', 'rtcp-mux' => ['offer'] }, < 'remove', 'via-branch' => 'x123' }, < 'remove', 'via-branch' => 'x123', 'rtcp-mux' => ['demux'] }, < 'remove', 'via-branch' => 'x456', 'rtcp-mux' => ['offer'] }, < 'remove', 'via-branch' => 'x456' }, <