diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala index 34ace5d20a..e6d16fbe4a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala @@ -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) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala index 24034dd5ee..f2c2bc2622 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala @@ -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, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala index a2ff5546bf..937ebd1cc0 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala @@ -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) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala index ac9fadc19e..5b614c3d6a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala @@ -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() - } - } - } - } } } 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 ceec442943..e0ba15cdc9 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 @@ -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, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index 9bdb1a9d50..f2ad37bedf 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -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) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/guests/GuestsWaitingApprovedMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/guests/GuestsWaitingApprovedMsgHdlr.scala index 9a939df5d8..4cd954d103 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/guests/GuestsWaitingApprovedMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/guests/GuestsWaitingApprovedMsgHdlr.scala @@ -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) } } diff --git a/bigbluebutton-html5/imports/api/users/server/modifiers/addDialInUser.js b/bigbluebutton-html5/imports/api/users/server/modifiers/addDialInUser.js index ddba479d2e..1eaf790d1c 100644 --- a/bigbluebutton-html5/imports/api/users/server/modifiers/addDialInUser.js +++ b/bigbluebutton-html5/imports/api/users/server/modifiers/addDialInUser.js @@ -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',