Merge pull request #14405 from antobinary/2.4.4-branch

Merge 2.4.4 into 2.5-alpha-1
This commit is contained in:
Anton Georgiev 2022-02-18 12:19:13 -05:00 committed by GitHub
commit 60302d3e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 48 additions and 151 deletions

View File

@ -51,7 +51,7 @@ trait SystemConfiguration {
lazy val endMeetingWhenNoMoreAuthedUsersAfterMinutes = Try(config.getInt("apps.endMeetingWhenNoMoreAuthedUsersAfterMinutes")).getOrElse(2)
lazy val reduceDuplicatedPick = Try(config.getBoolean("apps.reduceDuplicatedPick")).getOrElse(false)
// Redis server configuration
lazy val redisHost = Try(config.getString("redis.host")).getOrElse("127.0.0.1")
lazy val redisPort = Try(config.getInt("redis.port")).getOrElse(6379)

View File

@ -22,6 +22,7 @@ trait RegisterUserReqMsgHdlr {
val event = UserRegisteredRespMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
val guestStatus = msg.body.guestStatus
val regUser = RegisteredUsers.create(msg.body.intUserId, msg.body.extUserId,

View File

@ -11,7 +11,7 @@ trait UserConnectedToGlobalAudioMsgHdlr {
def handleUserConnectedToGlobalAudioMsg(msg: UserConnectedToGlobalAudioMsg) {
log.info("Handling UserConnectedToGlobalAudio: meetingId=" + props.meetingProp.intId + " userId=" + msg.body.userId)
def broadcastEvent(vu: VoiceUserState): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId,
vu.intId)

View File

@ -2,11 +2,9 @@ package org.bigbluebutton.core.apps.voice
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.models.VoiceUsers
import org.bigbluebutton.core.running.{ LiveMeeting, MeetingActor, OutMsgRouter }
import org.bigbluebutton.core2.message.senders.MsgBuilder
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.apps.users.UsersApp
import org.bigbluebutton.core2.MeetingStatus2x
trait UserJoinedVoiceConfEvtMsgHdlr extends SystemConfiguration {
this: MeetingActor =>
@ -15,57 +13,17 @@ trait UserJoinedVoiceConfEvtMsgHdlr extends SystemConfiguration {
val outGW: OutMsgRouter
def handleUserJoinedVoiceConfEvtMsg(msg: UserJoinedVoiceConfEvtMsg): Unit = {
log.info("Received user joined voice conference " + msg)
val guestPolicy = GuestsWaiting.getGuestPolicy(liveMeeting.guestsWaiting)
def notifyModeratorsOfGuestWaiting(guest: GuestWaiting, users: Users2x, meetingId: String): Unit = {
val moderators = Users2x.findAll(users).filter(p => p.role == Roles.MODERATOR_ROLE)
moderators foreach { mod =>
val event = MsgBuilder.buildGuestsWaitingForApprovalEvtMsg(meetingId, mod.intId, Vector(guest))
outGW.send(event)
}
// bbb-html should only listen for this single message
val event = MsgBuilder.buildGuestsWaitingForApprovalEvtMsg(meetingId, "nodeJSapp", Vector(guest))
outGW.send(event)
}
def registerUserInRegisteredUsers() = {
val regUser = RegisteredUsers.create(msg.body.intId, msg.body.voiceUserId,
msg.body.callerIdName, Roles.VIEWER_ROLE, "",
"", true, true, GuestStatus.WAIT, true, false)
RegisteredUsers.add(liveMeeting.registeredUsers, regUser)
}
def registerUserInUsers2x() = {
val newUser = UserState(
intId = msg.body.intId,
extId = msg.body.voiceUserId,
name = msg.body.callerIdName,
role = Roles.VIEWER_ROLE,
guest = true,
authed = true,
guestStatus = GuestStatus.WAIT,
emoji = "none",
pin = false,
presenter = false,
locked = MeetingStatus2x.getPermissions(liveMeeting.status).lockOnJoin,
avatar = "",
clientType = "",
pickExempted = false,
userLeftFlag = UserLeftFlag(false, 0)
if (VoiceUsers.isCallerBanned(msg.body.callerIdNum, liveMeeting.voiceUsers)) {
log.info("Ejecting banned voice user " + msg)
val event = MsgBuilder.buildEjectUserFromVoiceConfSysMsg(
props.meetingProp.intId,
props.voiceProp.voiceConf,
msg.body.voiceUserId
)
Users2x.add(liveMeeting.users2x, newUser)
}
def registerUserAsGuest() = {
if (GuestsWaiting.findWithIntId(liveMeeting.guestsWaiting, msg.body.intId) == None) {
val guest = GuestWaiting(msg.body.intId, msg.body.callerIdName, Roles.VIEWER_ROLE, true, "", true, System.currentTimeMillis())
GuestsWaiting.add(liveMeeting.guestsWaiting, guest)
notifyModeratorsOfGuestWaiting(guest, liveMeeting.users2x, liveMeeting.props.meetingProp.intId)
}
}
def letUserEnter() = {
outGW.send(event)
} else {
VoiceApp.handleUserJoinedVoiceConfEvtMsg(
liveMeeting,
outGW,
@ -81,30 +39,5 @@ trait UserJoinedVoiceConfEvtMsgHdlr extends SystemConfiguration {
"freeswitch"
)
}
//Firs of all we check whether the user is banned from the meeting
if (VoiceUsers.isCallerBanned(msg.body.callerIdNum, liveMeeting.voiceUsers)) {
log.info("Ejecting banned voice user " + msg)
val event = MsgBuilder.buildEjectUserFromVoiceConfSysMsg(
props.meetingProp.intId,
props.voiceProp.voiceConf,
msg.body.voiceUserId
)
outGW.send(event)
} else {
if (msg.body.intId.startsWith("v_")) { // Dial-in user (v_*)
registerUserInRegisteredUsers()
registerUserInUsers2x()
}
guestPolicy match {
case GuestPolicy(policy, setBy) => {
policy match {
case GuestPolicyType.ALWAYS_ACCEPT => letUserEnter()
case GuestPolicyType.ALWAYS_DENY => VoiceApp.removeUserFromVoiceConf(liveMeeting, outGW, msg.body.voiceUserId)
case GuestPolicyType.ASK_MODERATOR => registerUserAsGuest()
}
}
}
}
}
}

View File

@ -2,14 +2,13 @@ package org.bigbluebutton.core.apps.voice
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.LockSettingsUtil
import org.bigbluebutton.common2.msgs.{ BbbClientMsgHeader, BbbCommonEnvCoreMsg, BbbCoreEnvelope, ConfVoiceUser, MessageTypes, Routing, UserJoinedVoiceConfToClientEvtMsg, UserJoinedVoiceConfToClientEvtMsgBody, UserLeftVoiceConfToClientEvtMsg, UserLeftVoiceConfToClientEvtMsgBody, UserMutedVoiceEvtMsg, UserMutedVoiceEvtMsgBody }
import org.bigbluebutton.core.apps.breakout.BreakoutHdlrHelpers
import org.bigbluebutton.core.bus.InternalEventBus
import org.bigbluebutton.core.models.{ Users2x, VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
import org.bigbluebutton.core2.MeetingStatus2x
import org.bigbluebutton.core2.message.senders.MsgBuilder
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.running.{ LiveMeeting, MeetingActor, OutMsgRouter }
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.apps.users.UsersApp
object VoiceApp extends SystemConfiguration {
@ -153,22 +152,20 @@ object VoiceApp extends SystemConfiguration {
}
}
case None =>
if (!cvu.intId.startsWith("v_")) {
handleUserJoinedVoiceConfEvtMsg(
liveMeeting,
outGW,
eventBus,
liveMeeting.props.voiceProp.voiceConf,
cvu.intId,
cvu.voiceUserId,
cvu.callingWith,
cvu.callerIdName,
cvu.callerIdNum,
cvu.muted,
cvu.talking,
cvu.calledInto
)
}
handleUserJoinedVoiceConfEvtMsg(
liveMeeting,
outGW,
eventBus,
liveMeeting.props.voiceProp.voiceConf,
cvu.intId,
cvu.voiceUserId,
cvu.callingWith,
cvu.callerIdName,
cvu.callerIdNum,
cvu.muted,
cvu.talking,
cvu.calledInto
)
}
}
@ -307,17 +304,6 @@ object VoiceApp extends SystemConfiguration {
}
def removeUserFromVoiceConf(
liveMeeting: LiveMeeting,
outGW: OutMsgRouter,
voiceUserId: String,
): Unit = {
val guest = GuestApprovedVO(voiceUserId, GuestStatus.DENY)
UsersApp.approveOrRejectGuest(liveMeeting, outGW, guest, SystemUser.ID)
val event = MsgBuilder.buildEjectUserFromVoiceConfSysMsg(liveMeeting.props.meetingProp.intId, liveMeeting.props.voiceProp.voiceConf, voiceUserId)
outGW.send(event)
}
def handleUserLeftVoiceConfEvtMsg(
liveMeeting: LiveMeeting,
outGW: OutMsgRouter,

View File

@ -255,6 +255,7 @@ class MeetingActor(
// Handling RegisterUserReqMsg as it is forwarded from BBBActor and
// its type is not BbbCommonEnvCoreMsg
case m: RegisterUserReqMsg => usersApp.handleRegisterUserReqMsg(m)
case m: EjectDuplicateUserReqMsg => usersApp.handleEjectDuplicateUserReqMsg(m)
case m: GetAllMeetingsReqMsg => handleGetAllMeetingsReqMsg(m)
case m: GetRunningMeetingStateReqMsg => handleGetRunningMeetingStateReqMsg(m)

View File

@ -2,9 +2,7 @@ package org.bigbluebutton.core2.message.handlers.guests
import org.bigbluebutton.common2.msgs.{ GuestApprovedVO, GuestsWaitingApprovedMsg }
import org.bigbluebutton.core.apps.users.UsersApp
import org.bigbluebutton.core.apps.voice.VoiceApp
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.bus.InternalEventBus
import org.bigbluebutton.core.running.{ BaseMeetingActor, HandlerHelpers, LiveMeeting, OutMsgRouter }
import org.bigbluebutton.core2.message.senders.MsgBuilder
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
@ -14,7 +12,6 @@ trait GuestsWaitingApprovedMsgHdlr extends HandlerHelpers with RightsManagementT
val liveMeeting: LiveMeeting
val outGW: OutMsgRouter
val eventBus: InternalEventBus
def handleGuestsWaitingApprovedMsg(msg: GuestsWaitingApprovedMsg): Unit = {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
@ -27,32 +24,6 @@ trait GuestsWaitingApprovedMsgHdlr extends HandlerHelpers with RightsManagementT
// Remove guest from waiting list
_ <- GuestsWaiting.remove(liveMeeting.guestsWaiting, g.guest)
} yield {
if (g.guest.startsWith("v_")) {
Users2x.findWithIntId(liveMeeting.users2x, g.guest) match {
case Some(dialInUser) =>
if (g.status == GuestStatus.ALLOW) {
VoiceApp.handleUserJoinedVoiceConfEvtMsg(
liveMeeting,
outGW,
eventBus,
liveMeeting.props.voiceProp.voiceConf,
g.guest,
dialInUser.extId,
"none",
dialInUser.name,
dialInUser.name,
false,
false,
"freeswitch"
)
} else {
VoiceApp.removeUserFromVoiceConf(liveMeeting, outGW, dialInUser.extId)
val event = MsgBuilder.buildEjectUserFromVoiceConfSysMsg(liveMeeting.props.meetingProp.intId, liveMeeting.props.voiceProp.voiceConf, g.guest)
outGW.send(event)
}
case None => None
}
}
UsersApp.approveOrRejectGuest(liveMeeting, outGW, g, msg.body.approvedBy)
}
}

View File

@ -1,11 +1,7 @@
FROM openjdk:11-jre-buster
FROM openjdk:11-jre-bullseye
ENV DEBIAN_FRONTEND noninteractive
#Required to install Libreoffice 7
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list
RUN apt update && apt -y install locales-all fontconfig libxt6 libxrender1
RUN apt update && apt -y install -t buster-backports libreoffice
RUN apt update && apt -y install -t bullseye-backports libreoffice && rm /usr/share/java/ant-apache-log4j-1.10.9.jar && rm /usr/share/maven-repo/org/apache/ant/ant-apache-log4j/1.10.9/ant-apache-log4j-1.10.9.jar

View File

@ -1,6 +1,7 @@
import { check } from 'meteor/check';
import addUser from '/imports/api/users/server/modifiers/addUser';
export default function addDialInUser(meetingId, voiceUser) {
check(meetingId, String);
check(voiceUser, Object);
@ -15,7 +16,7 @@ export default function addDialInUser(meetingId, voiceUser) {
extId: intId, // TODO
name: callerName,
role: ROLE_VIEWER.toLowerCase(),
guest: true,
guest: false,
authed: true,
waitingForAcceptance: false,
guestStatus: 'ALLOW',

View File

@ -302,10 +302,14 @@ class VideoPlayer extends Component {
}
handleOnProgress() {
const { mutedByEchoTest } = this.state;
const volume = this.getCurrentVolume();
const muted = this.getMuted();
this.setState({ volume, muted });
if (!mutedByEchoTest) {
this.setState({ volume, muted });
}
}
handleVolumeChanged(volume) {
@ -313,7 +317,11 @@ class VideoPlayer extends Component {
}
handleOnMuted(muted) {
this.setState({ muted });
const { mutedByEchoTest } = this.state;
if (!mutedByEchoTest) {
this.setState({ muted });
}
}
handleReload() {
@ -372,10 +380,10 @@ class VideoPlayer extends Component {
}
getMuted() {
const { muted } = this.state;
const { mutedByEchoTest } = this.state;
const intPlayer = this.player && this.player.getInternalPlayer();
return (intPlayer && intPlayer.isMuted && intPlayer.isMuted()) || muted;
return intPlayer && intPlayer.isMuted && intPlayer.isMuted() && !mutedByEchoTest;
}
autoPlayBlockDetected() {