diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala index 13792bf5d1..127ae4af58 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala @@ -17,6 +17,7 @@ import org.bigbluebutton.common2.messages.MessageBody.MeetingCreatedEvtBody import org.bigbluebutton.common2.messages._ import org.bigbluebutton.core.running.RunningMeeting import org.bigbluebutton.core2.RunningMeetings +import org.bigbluebutton.core2.message.handlers.CreateMeetingReqMsgHdlr object BigBlueButtonActor extends SystemConfiguration { def props(system: ActorSystem, @@ -27,8 +28,9 @@ object BigBlueButtonActor extends SystemConfiguration { } class BigBlueButtonActor(val system: ActorSystem, - eventBus: IncomingEventBus, bbbMsgBus: BbbMsgRouterEventBus, - outGW: OutMessageGateway) extends Actor with ActorLogging with SystemConfiguration { + val eventBus: IncomingEventBus, val bbbMsgBus: BbbMsgRouterEventBus, + val outGW: OutMessageGateway) extends Actor + with ActorLogging with SystemConfiguration { implicit def executionContext = system.dispatcher implicit val timeout = Timeout(5 seconds) @@ -54,8 +56,10 @@ class BigBlueButtonActor(val system: ActorSystem, } def receive = { + // 2x messages case msg: BbbCommonEnvCoreMsg => handleBbbCommonEnvCoreMsg(msg) - case msg: CreateMeetingReqMsg => handleCreateMeetingReqMsg(msg) + + // 1x messages case msg: CreateMeeting => handleCreateMeeting(msg) case msg: DestroyMeeting => handleDestroyMeeting(msg) case msg: KeepAliveMessage => handleKeepAliveMessage(msg) @@ -88,6 +92,52 @@ class BigBlueButtonActor(val system: ActorSystem, } } + def handleCreateMeetingReqMsg(msg: CreateMeetingReqMsg): Unit = { + log.debug("****** RECEIVED CreateMeetingReqMsg msg {}", msg) + + RunningMeetings.findWithId(meetings, msg.body.props.meetingProp.intId) match { + case None => { + log.info("Create meeting request. meetingId={}", msg.body.props.meetingProp.intId) + + val m = RunningMeeting(msg.body.props, outGW, eventBus) + + /** Subscribe to meeting and voice events. **/ + eventBus.subscribe(m.actorRef, m.props.meetingProp.intId) + eventBus.subscribe(m.actorRef, m.props.voiceProp.voiceConf) + eventBus.subscribe(m.actorRef, m.props.screenshareProps.screenshareConf) + + bbbMsgBus.subscribe(m.actorRef, m.props.meetingProp.intId) + + RunningMeetings.add(meetings, m) + + // Send old message format + outGW.send(new MeetingCreated(m.props.meetingProp.intId, + m.props.meetingProp.extId, m.props.breakoutProps.parentId, + m.props.recordProp.record, m.props.meetingProp.name, + m.props.voiceProp.voiceConf, m.props.durationProps.duration, + m.props.password.moderatorPass, m.props.password.viewerPass, + m.props.durationProps.createdTime, m.props.durationProps.createdDate, + m.props.meetingProp.isBreakout)) + + m.actorRef ! new InitializeMeeting(m.props.meetingProp.intId, m.props.recordProp.record) + + // Send new 2x message + val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka") + val envelope = BbbCoreEnvelope(MeetingCreatedEvtMsg.NAME, routing) + val header = BbbCoreBaseHeader(MeetingCreatedEvtMsg.NAME) + val body = MeetingCreatedEvtBody(msg.body.props) + val event = MeetingCreatedEvtMsg(header, body) + val msgEvent = BbbCommonEnvCoreMsg(envelope, event) + outGW.send(msgEvent) + } + case Some(m) => { + log.info("Meeting already created. meetingID={}", msg.body.props.meetingProp.intId) + // do nothing + } + } + + } + private def findMeetingWithVoiceConfId(voiceConfId: String): Option[RunningMeeting] = { RunningMeetings.findMeetingWithVoiceConfId(meetings, voiceConfId) } @@ -235,52 +285,6 @@ class BigBlueButtonActor(val system: ActorSystem, */ } - private def handleCreateMeetingReqMsg(msg: CreateMeetingReqMsg): Unit = { - log.debug("****** RECEIVED CreateMeetingReqMsg msg {}", msg) - - RunningMeetings.findWithId(meetings, msg.body.props.meetingProp.intId) match { - case None => { - log.info("Create meeting request. meetingId={}", msg.body.props.meetingProp.intId) - - val m = RunningMeeting(msg.body.props, outGW, eventBus) - - /** Subscribe to meeting and voice events. **/ - eventBus.subscribe(m.actorRef, m.props.meetingProp.intId) - eventBus.subscribe(m.actorRef, m.props.voiceProp.voiceConf) - eventBus.subscribe(m.actorRef, m.props.screenshareProps.screenshareConf) - - bbbMsgBus.subscribe(m.actorRef, m.props.meetingProp.intId) - - RunningMeetings.add(meetings, m) - - // Send old message format - outGW.send(new MeetingCreated(m.props.meetingProp.intId, - m.props.meetingProp.extId, m.props.breakoutProps.parentId, - m.props.recordProp.record, m.props.meetingProp.name, - m.props.voiceProp.voiceConf, m.props.durationProps.duration, - m.props.password.moderatorPass, m.props.password.viewerPass, - m.props.durationProps.createdTime, m.props.durationProps.createdDate, - m.props.meetingProp.isBreakout)) - - m.actorRef ! new InitializeMeeting(m.props.meetingProp.intId, m.props.recordProp.record) - - // Send new 2x message - val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka") - val envelope = BbbCoreEnvelope(MeetingCreatedEvtMsg.NAME, routing) - val header = BbbCoreBaseHeader(MeetingCreatedEvtMsg.NAME) - val body = MeetingCreatedEvtBody(msg.body.props) - val event = MeetingCreatedEvtMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - outGW.send(msgEvent) - } - case Some(m) => { - log.info("Meeting already created. meetingID={}", msg.body.props.meetingProp.intId) - // do nothing - } - } - - } - private def handleCreateMeeting(msg: CreateMeeting): Unit = { } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/MeetingModel.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/MeetingModel.scala index aac53563ef..6f3abc4314 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/MeetingModel.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/MeetingModel.scala @@ -18,9 +18,9 @@ class MeetingModel { private var audioSettingsInited = false private var permissionsInited = false private var permissions = new Permissions() - private var recording = false; + private var recording = false private var broadcastingRTMP = false - private var muted = false; + private var muted = false private var meetingEnded = false private var meetingMuted = false private var guestPolicy = GuestPolicy.ASK_MODERATOR @@ -39,8 +39,8 @@ class MeetingModel { val startedOn = timeNowInSeconds; - var breakoutRoomsStartedOn: Long = 0; - var breakoutRoomsdurationInMinutes: Int = 0; + var breakoutRoomsStartedOn: Long = 0 + var breakoutRoomsdurationInMinutes: Int = 0 def resetDesktopSharingParams() = { broadcastingRTMP = false @@ -56,7 +56,6 @@ class MeetingModel { def setDeskShareStarted(b: Boolean) { deskShareStarted = b - println("---deskshare status changed to:" + b) } def setDesktopShareVideoWidth(videoWidth: Int) { @@ -88,7 +87,6 @@ class MeetingModel { } def setRTMPBroadcastingUrl(path: String) { - println("---RTMP broadcastUrl changed to:" + path) rtmpBroadcastingUrl = path } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationApp.scala index 98084c4dd2..8864e7dae1 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationApp.scala @@ -3,7 +3,8 @@ package org.bigbluebutton.core.apps import org.bigbluebutton.core.api._ import org.bigbluebutton.core.OutMessageGateway import org.bigbluebutton.core.models.Users -import org.bigbluebutton.core.running.{ MeetingActor } +import org.bigbluebutton.core.running.MeetingActor +import org.bigbluebutton.core2.MeetingStatus2x trait PresentationApp { this: MeetingActor => @@ -73,7 +74,7 @@ trait PresentationApp { } def handleGetPresentationInfo(msg: GetPresentationInfo) { - val curPresenter = liveMeeting.getCurrentPresenterInfo() + val curPresenter = MeetingStatus2x.getCurrentPresenterInfo(liveMeeting.status) val presenter = new CurrentPresenter(curPresenter.presenterID, curPresenter.presenterName, curPresenter.assignedBy) val presentations = liveMeeting.presModel.getPresentations val presentationInfo = new CurrentPresentationInfo(presenter, presentations) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala index 8c9de7b08a..52dd455647 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala @@ -5,6 +5,7 @@ import org.bigbluebutton.core.OutMessageGateway import org.bigbluebutton.core.api.GuestPolicy import org.bigbluebutton.core.models._ import org.bigbluebutton.core.running.MeetingActor +import org.bigbluebutton.core2.MeetingStatus2x trait UsersApp { this: MeetingActor => @@ -16,7 +17,7 @@ trait UsersApp { val user = Users.findWithId(msg.userid, liveMeeting.users) user foreach { u => - if (liveMeeting.addGlobalAudioConnection(msg.userid)) { + if (MeetingStatus2x.addGlobalAudioConnection(liveMeeting.status, msg.userid)) { for { uvo <- Users.joinedVoiceListenOnly(msg.userid, liveMeeting.users) } yield { @@ -32,7 +33,7 @@ trait UsersApp { val user = Users.findWithId(msg.userid, liveMeeting.users) user foreach { u => - if (liveMeeting.removeGlobalAudioConnection(msg.userid)) { + if (MeetingStatus2x.removeGlobalAudioConnection(liveMeeting.status, msg.userid)) { if (!u.joinedWeb) { for { uvo <- Users.userLeft(u.id, liveMeeting.users) @@ -358,7 +359,9 @@ trait UsersApp { outGW.send(new GuestAccessDenied(props.meetingProp.intId, props.recordProp.record, uvo.id)) } else { outGW.send(new UserJoined(props.meetingProp.intId, props.recordProp.record, uvo)) - outGW.send(new MeetingState(props.meetingProp.intId, props.recordProp.record, uvo.id, liveMeeting.meetingModel.getPermissions(), liveMeeting.meetingModel.isMeetingMuted())) + outGW.send(new MeetingState(props.meetingProp.intId, props.recordProp.record, uvo.id, + liveMeeting.meetingModel.getPermissions(), liveMeeting.meetingModel.isMeetingMuted())) + if (!waitingForAcceptance) { // Become presenter if the only moderator if ((Users.numModerators(liveMeeting.users) == 1) || (Users.hasNoPresenter(liveMeeting.users))) { @@ -455,8 +458,9 @@ trait UsersApp { def startRecordingVoiceConference() { if (Users.numUsersInVoiceConference(liveMeeting.users) == 1 && - props.recordProp.record && !liveMeeting.isVoiceRecording) { - liveMeeting.startRecordingVoice() + props.recordProp.record && + !MeetingStatus2x.isVoiceRecording(liveMeeting.status)) { + MeetingStatus2x.startRecordingVoice(liveMeeting.status) log.info("Send START RECORDING voice conf. meetingId=" + props.meetingProp.intId + " voice conf=" + props.voiceProp.voiceConf) outGW.send(new StartRecordingVoiceConf(props.meetingProp.intId, props.recordProp.record, props.voiceProp.voiceConf)) } @@ -519,8 +523,9 @@ trait UsersApp { def stopRecordingVoiceConference() { if (Users.numUsersInVoiceConference(liveMeeting.users) == 0 && - props.recordProp.record && liveMeeting.isVoiceRecording) { - liveMeeting.stopRecordingVoice() + props.recordProp.record && + MeetingStatus2x.isVoiceRecording(liveMeeting.status)) { + MeetingStatus2x.stopRecordingVoice(liveMeeting.status) log.info("Send STOP RECORDING voice conf. meetingId=" + props.meetingProp.intId + " voice conf=" + props.voiceProp.voiceConf) outGW.send(new StopRecordingVoiceConf(props.meetingProp.intId, props.recordProp.record, props.voiceProp.voiceConf, liveMeeting.meetingModel.getVoiceRecordingFilename())) @@ -593,7 +598,7 @@ trait UsersApp { } yield { removePresenterRightsToCurrentPresenter() Users.becomePresenter(newPres.id, liveMeeting.users) - liveMeeting.setCurrentPresenterInfo(new Presenter(newPresenterID, newPresenterName, assignedBy)) + MeetingStatus2x.setCurrentPresenterInfo(liveMeeting.status, new Presenter(newPresenterID, newPresenterName, assignedBy)) outGW.send(new PresenterAssigned(props.meetingProp.intId, props.recordProp.record, new Presenter(newPresenterID, newPresenterName, assignedBy))) outGW.send(new UserStatusChange(props.meetingProp.intId, props.recordProp.record, newPresenterID, "presenter", true: java.lang.Boolean)) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersModel.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersModel.scala deleted file mode 100755 index 3348a0ddcd..0000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersModel.scala +++ /dev/null @@ -1,69 +0,0 @@ -package org.bigbluebutton.core.apps - -import org.bigbluebutton.core.api.Presenter - -class UsersModel { - // private var uservos = new Users - - // private var regUsers = new RegisteredUsers - - /* When reconnecting SIP global audio, users may receive the connection message - * before the disconnection message. - * This variable is a connection counter that should control this scenario. - */ - private var globalAudioConnectionCounter = new collection.immutable.HashMap[String, Integer] - - private var recordingVoice = false - - private var currentPresenter = new Presenter("system", "system", "system") - - def setCurrentPresenterInfo(pres: Presenter) { - currentPresenter = pres - } - - def getCurrentPresenterInfo(): Presenter = { - currentPresenter - } - - def addGlobalAudioConnection(userID: String): Boolean = { - globalAudioConnectionCounter.get(userID) match { - case Some(vc) => { - globalAudioConnectionCounter += userID -> (vc + 1) - false - } - case None => { - globalAudioConnectionCounter += userID -> 1 - true - } - } - } - - def removeGlobalAudioConnection(userID: String): Boolean = { - globalAudioConnectionCounter.get(userID) match { - case Some(vc) => { - if (vc == 1) { - globalAudioConnectionCounter -= userID - true - } else { - globalAudioConnectionCounter += userID -> (vc - 1) - false - } - } - case None => { - false - } - } - } - - def startRecordingVoice() { - recordingVoice = true - } - - def stopRecordingVoice() { - recordingVoice = false - } - - def isVoiceRecording: Boolean = { - recordingVoice - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala index 49aa7ba729..d953743f6c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala @@ -7,12 +7,13 @@ import org.bigbluebutton.core.api._ import org.bigbluebutton.core.apps._ import org.bigbluebutton.core.models.{ RegisteredUsers, Users } import org.bigbluebutton.core.{ MeetingModel, MeetingProperties } +import org.bigbluebutton.core2.MeetingStatus2x class LiveMeeting(val props: DefaultProps, + val status: MeetingStatus2x, val chatModel: ChatModel, val layoutModel: LayoutModel, val meetingModel: MeetingModel, - private val usersModel: UsersModel, val users: Users, val registeredUsers: RegisteredUsers, val pollModel: PollModel, @@ -33,34 +34,6 @@ class LiveMeeting(val props: DefaultProps, } } - def setCurrentPresenterInfo(pres: Presenter) { - usersModel.setCurrentPresenterInfo(pres) - } - - def getCurrentPresenterInfo(): Presenter = { - usersModel.getCurrentPresenterInfo() - } - - def addGlobalAudioConnection(userID: String): Boolean = { - usersModel.addGlobalAudioConnection(userID) - } - - def removeGlobalAudioConnection(userID: String): Boolean = { - usersModel.removeGlobalAudioConnection(userID) - } - - def startRecordingVoice() { - usersModel.startRecordingVoice() - } - - def stopRecordingVoice() { - usersModel.stopRecordingVoice() - } - - def isVoiceRecording: Boolean = { - usersModel.isVoiceRecording - } - def startCheckingIfWeNeedToEndVoiceConf() { if (Users.numWebUsers(users) == 0 && !props.meetingProp.isBreakout) { meetingModel.lastWebUserLeft() 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 2ee3090cd8..ad2a5afe7d 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 @@ -55,9 +55,14 @@ class MeetingActor(val props: DefaultProps, eventBus.subscribe(actorMonitor, props.screenshareProps.screenshareConf) def receive = { + //============================= + // 2x messages case msg: BbbCommonEnvCoreMsg => handleBbbCommonEnvCoreMsg(msg) case msg: RegisterUserReqMsg => handleRegisterUserReqMsg(msg) + //====================================== + //======================================= + // old messages case msg: ActivityResponse => handleActivityResponse(msg) case msg: MonitorNumberOfUsers => handleMonitorNumberOfUsers(msg) case msg: ValidateAuthToken => handleValidateAuthToken(msg) @@ -201,10 +206,22 @@ class MeetingActor(val props: DefaultProps, "msgType" -> "direct", "meetingId" -> props.meetingProp.intId, "userId" -> msg.body.userId) val envelope = BbbCoreEnvelope(ValidateAuthTokenRespMsg.NAME, routing) val header = BbbCoreHeaderWithMeetingId(ValidateAuthTokenRespMsg.NAME, props.meetingProp.intId) - val body = ValidateAuthTokenRespMsgBody(msg.body.userId, msg.body.authToken, true) - val event = ValidateAuthTokenRespMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - outGW.send(msgEvent) + + RegisteredUsers.getRegisteredUserWithToken(msg.body.authToken, msg.body.userId, liveMeeting.registeredUsers) match { + case Some(u) => + log.info("ValidateToken success. meetingId=" + props.meetingProp.intId + " userId=" + msg.body.userId) + + val body = ValidateAuthTokenRespMsgBody(msg.body.userId, msg.body.authToken, true) + val event = ValidateAuthTokenRespMsg(header, body) + val msgEvent = BbbCommonEnvCoreMsg(envelope, event) + outGW.send(msgEvent) + case None => + log.info("ValidateToken failed. meetingId=" + props.meetingProp.intId + " userId=" + msg.body.userId) + val body = ValidateAuthTokenRespMsgBody(msg.body.userId, msg.body.authToken, false) + val event = ValidateAuthTokenRespMsg(header, body) + val msgEvent = BbbCommonEnvCoreMsg(envelope, event) + outGW.send(msgEvent) + } } def handleDeskShareRTMPBroadcastStoppedRequest(msg: DeskShareRTMPBroadcastStoppedRequest): Unit = { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala index 7406bf032d..a20f7073c2 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala @@ -20,7 +20,6 @@ class RunningMeeting(val props: DefaultProps, val outGW: OutMessageGateway, val chatModel = new ChatModel() val layoutModel = new LayoutModel() val meetingModel = new MeetingModel() - val usersModel = new UsersModel() val pollModel = new PollModel() val wbModel = new WhiteboardModel() val presModel = new PresentationModel() @@ -29,13 +28,14 @@ class RunningMeeting(val props: DefaultProps, val outGW: OutMessageGateway, val notesModel = new SharedNotesModel() val users = new Users val registeredUsers = new RegisteredUsers - // val meetingStatux2x = new MeetingStatus2x(props, ) + val meetingStatux2x = new MeetingStatus2x // meetingModel.setGuestPolicy(props.usersProp.guestPolicy) // We extract the meeting handlers into this class so it is // easy to test. - val liveMeeting = new LiveMeeting(props, chatModel, layoutModel, meetingModel, usersModel, users, registeredUsers, pollModel, + val liveMeeting = new LiveMeeting(props, meetingStatux2x, chatModel, layoutModel, + meetingModel, users, registeredUsers, pollModel, wbModel, presModel, breakoutModel, captionModel, notesModel) val actorRef = context.actorOf(MeetingActor.props(props, eventBus, outGW, liveMeeting), props.meetingProp.intId) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala index 8a0b3058f2..67d5b4e12a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala @@ -1,5 +1,141 @@ package org.bigbluebutton.core2 -class MeetingStatus2x { +import org.bigbluebutton.core.MeetingExtensionProp +import org.bigbluebutton.core.api.{GuestPolicy, Permissions, Presenter} +object MeetingStatus2x { + def setCurrentPresenterInfo(status: MeetingStatus2x, pres: Presenter) { + status.currentPresenter = pres + } + + def getCurrentPresenterInfo(status: MeetingStatus2x): Presenter = { + status.currentPresenter + } + + def addGlobalAudioConnection(status: MeetingStatus2x, userID: String): Boolean = { + status.globalAudioConnectionCounter.get(userID) match { + case Some(vc) => { + status.globalAudioConnectionCounter += userID -> (vc + 1) + false + } + case None => { + status.globalAudioConnectionCounter += userID -> 1 + true + } + } + } + + def removeGlobalAudioConnection(status: MeetingStatus2x, userID: String): Boolean = { + status.globalAudioConnectionCounter.get(userID) match { + case Some(vc) => { + if (vc == 1) { + status.globalAudioConnectionCounter -= userID + true + } else { + status.globalAudioConnectionCounter += userID -> (vc - 1) + false + } + } + case None => { + false + } + } + } + + def startRecordingVoice(status: MeetingStatus2x): Boolean = { + status.recordingVoice = true + status.recordingVoice + } + + def stopRecordingVoice(status: MeetingStatus2x): Boolean = { + status.recordingVoice = false + status.recordingVoice + } + + def isVoiceRecording(status: MeetingStatus2x): Boolean = { + status.recordingVoice + } +} + +class MeetingStatus2x { + private var globalAudioConnectionCounter = new collection.immutable.HashMap[String, Integer] + + private var recordingVoice = false + + private var currentPresenter = new Presenter("system", "system", "system") + private var audioSettingsInited = false + private var permissionsInited = false + private var permissions = new Permissions() + private var recording = false + private var broadcastingRTMP = false + private var muted = false + private var meetingEnded = false + private var meetingMuted = false + private var guestPolicy = GuestPolicy.ASK_MODERATOR + private var guestPolicySetBy: String = null + + private var hasLastWebUserLeft = false + private var lastWebUserLeftOnTimestamp: Long = 0 + + private var voiceRecordingFilename: String = "" + private var rtmpBroadcastingUrl: String = "" + private var deskShareStarted = false + private var desktopShareVideoWidth = 0 + private var desktopShareVideoHeight = 0 + + private var extension = new MeetingExtensionProp + + val startedOn = timeNowInSeconds; + var breakoutRoomsStartedOn: Long = 0 + var breakoutRoomsdurationInMinutes: Int = 0 + + private def setCurrentPresenterInfo(pres: Presenter) { + currentPresenter = pres + } + + private def getCurrentPresenterInfo(): Presenter = { + currentPresenter + } + + private def addGlobalAudioConnection(userID: String): Boolean = { + globalAudioConnectionCounter.get(userID) match { + case Some(vc) => { + globalAudioConnectionCounter += userID -> (vc + 1) + false + } + case None => { + globalAudioConnectionCounter += userID -> 1 + true + } + } + } + + private def removeGlobalAudioConnection(userID: String): Boolean = { + globalAudioConnectionCounter.get(userID) match { + case Some(vc) => { + if (vc == 1) { + globalAudioConnectionCounter -= userID + true + } else { + globalAudioConnectionCounter += userID -> (vc - 1) + false + } + } + case None => { + false + } + } + } + + private def startRecordingVoice() { + recordingVoice = true + } + + private def stopRecordingVoice() { + recordingVoice = false + } + + private def isVoiceRecording: Boolean = { + recordingVoice + } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/CreateMeetingReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/CreateMeetingReqMsgHdlr.scala index 2206c5d920..6809d189b8 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/CreateMeetingReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/CreateMeetingReqMsgHdlr.scala @@ -1,8 +1,5 @@ package org.bigbluebutton.core2.message.handlers -/** - * Created by ralam on 2017-05-29. - */ trait CreateMeetingReqMsgHdlr { } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as index a00d96e1ab..e4dea29dfb 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as @@ -111,7 +111,7 @@ package org.bigbluebutton.main.model.users } public function onMessageFromServer2x(messageName:String, msg:String):void { - trace("onMessageFromServer - " + msg); + trace("onMessageFromServer2x - " + msg); var map:Object = JSON.parse(msg); var header: Object = map.header as Object; var body: Object = map.body as Object; @@ -122,8 +122,6 @@ package org.bigbluebutton.main.model.users } public function onMessageFromServer(messageName:String, msg:Object):void { - trace("onMessageFromServer2 - " + msg); - if (!authenticated && (messageName == "validateAuthTokenReply")) { handleValidateAuthTokenReply(msg) } else if (messageName == "validateAuthTokenTimedOut") {