diff --git a/src/conference.cpp b/src/conference.cpp index c2b283a686016c5a0648946eebdbb9e35c49c61c..ae7b93e9a3ebf07309820bc2e249d64e8d8ec52d 100644 --- a/src/conference.cpp +++ b/src/conference.cpp @@ -443,7 +443,14 @@ Conference::attach() if (getState() == State::ACTIVE_DETACHED) { auto& rbPool = Manager::instance().getRingBufferPool(); for (const auto& participant : getParticipantList()) { - rbPool.bindCallID(participant, RingBufferPool::DEFAULT_ID); + if (auto call = Manager::instance().getCallFromCallID(participant)) { + if (isMuted(string_remove_suffix(call->getPeerNumber(), '@'))) + rbPool.bindHalfDuplexOut(participant, RingBufferPool::DEFAULT_ID); + else + rbPool.bindCallID(participant, RingBufferPool::DEFAULT_ID); + rbPool.flush(participant); + } + // Reset ringbuffer's readpointers rbPool.flush(participant); } @@ -497,15 +504,25 @@ Conference::bindParticipant(const std::string& participant_id) auto& rbPool = Manager::instance().getRingBufferPool(); for (const auto& item : participants_) { - if (participant_id != item) - rbPool.bindCallID(participant_id, item); + if (participant_id != item) { + // Do not attach muted participants + if (auto call = Manager::instance().getCallFromCallID(item)) { + if (isMuted(string_remove_suffix(call->getPeerNumber(), '@'))) + rbPool.bindHalfDuplexOut(item, participant_id); + else + rbPool.bindCallID(participant_id, item); + } + } rbPool.flush(item); } // Bind local participant to other participants only if the // local is attached to the conference. if (getState() == State::ACTIVE_ATTACHED) { - rbPool.bindCallID(participant_id, RingBufferPool::DEFAULT_ID); + if (isMuted("host"sv)) + rbPool.bindHalfDuplexOut(RingBufferPool::DEFAULT_ID, participant_id); + else + rbPool.bindCallID(participant_id, RingBufferPool::DEFAULT_ID); rbPool.flush(RingBufferPool::DEFAULT_ID); } }