fix: do not accept new unmuted media

If a new stream is requested, and the client-qt does not specifically
states that it should be not mute, then accept muted media.

GitLab: #770

Change-Id: I1d9d6bdddfb40216d1750d4246e63745773033a6
This commit is contained in:
Aline Gondim Santos
2022-09-22 16:13:26 -03:00
committed by Sébastien Blin
parent e186d925c4
commit 190892f425
2 changed files with 3 additions and 3 deletions

View File

@ -2399,7 +2399,7 @@ SIPCall::updateAllMediaStreams(const std::vector<MediaAttribute>& mediaAttrList,
addMediaStream(newAttr);
auto& stream = rtpStreams_.back();
// If the remote asks for a new stream, our side sends nothing
stream.mediaAttribute_->muted_ = isRemote;
stream.mediaAttribute_->muted_ = isRemote ? true : stream.mediaAttribute_->muted_;
createRtpSession(stream);
JAMI_DBG("[call:%s] Added a new media stream [%s] @ index %i",
getCallId().c_str(),
@ -2771,8 +2771,7 @@ SIPCall::handleMediaChangeRequest(const std::vector<DRing::MediaMap>& remoteMedi
// If the offered media does not differ from the current local media, the
// request is answered using the current local media.
if (not checkMediaChangeRequest(remoteMediaList)) {
answerMediaChangeRequest(MediaAttribute::mediaAttributesToMediaMaps(getMediaAttributeList()),
true);
answerMediaChangeRequest(MediaAttribute::mediaAttributesToMediaMaps(getMediaAttributeList()));
return;
}

View File

@ -999,6 +999,7 @@ MediaNegotiationTest::audio_only_then_caller_add_video()
scenario.offerUpdate_.emplace_back(audio);
scenario.offerUpdate_.emplace_back(video);
scenario.answerUpdate_.emplace_back(audio);
video.muted_ = true;
scenario.answerUpdate_.emplace_back(video);
scenario.expectMediaRenegotiation_ = true;
scenario.expectMediaChangeRequest_ = true;