diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/ListenOnlyModeToggledInSfuEvtMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/ListenOnlyModeToggledInSfuEvtMsgHdlr.scala index 0b16a39a61..1111793b3c 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/ListenOnlyModeToggledInSfuEvtMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/ListenOnlyModeToggledInSfuEvtMsgHdlr.scala @@ -12,7 +12,11 @@ trait ListenOnlyModeToggledInSfuEvtMsgHdlr { def handleListenOnlyModeToggledInSfuEvtMsg(msg: ListenOnlyModeToggledInSfuEvtMsg): Unit = { for { - vu <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId) + vu <- VoiceUsers.findWithIntIdAndCallerNum( + liveMeeting.voiceUsers, + msg.body.userId, + msg.body.callerNum + ) } yield { VoiceApp.holdChannelInVoiceConf( liveMeeting, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala index afa2c68663..efb6218611 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala @@ -546,9 +546,10 @@ object VoiceApp extends SystemConfiguration { hold ) match { case Some(vu) => - // Mute vs hold state mismatch, enforce hold state again. - // Mute state is the predominant one here. - if (vu.muted != hold) { + // Mute vs hold state mismatch. Enforce it if the user is unmuted, + // but hold is active, to avoid the user being unable to talk when + // the channel is active again. + if (!vu.muted && vu.hold) { toggleListenOnlyMode( liveMeeting, outGW, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala index 8b9adbb15f..47ca576a4e 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala @@ -15,6 +15,10 @@ object VoiceUsers { users.toVector.find(u => u.uuid == uuid && u.intId == intId) } + def findWithIntIdAndCallerNum(users: VoiceUsers, intId: String, callerNum: String): Option[VoiceUserState] = { + users.toVector.find(u => u.callerNum == callerNum && u.intId == intId) + } + def findAll(users: VoiceUsers): Vector[VoiceUserState] = users.toVector def findAllNonListenOnlyVoiceUsers(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.listenOnly == false)