Set webcamsOnlyForModerator in MeetingActor when the meeting is creator.

This commit is contained in:
Ghazi Triki 2018-01-09 20:47:03 +01:00
parent 8f47e7b7de
commit 9cad3facc3
3 changed files with 35 additions and 30 deletions

View File

@ -32,7 +32,6 @@ import org.bigbluebutton.core.apps.breakout._
import org.bigbluebutton.core.apps.polls._
import org.bigbluebutton.core.apps.voice._
import scala.concurrent.duration._
import org.bigbluebutton.core2.testdata.FakeTestData
import org.bigbluebutton.core.apps.layout.LayoutApp2x
import org.bigbluebutton.core.apps.meeting.SyncGetMeetingInfoRespMsgHdlr
import org.bigbluebutton.core.apps.users.ChangeLockSettingsInMeetingCmdMsgHdlr
@ -138,6 +137,9 @@ class MeetingActor(
MeetingStatus2x.unmuteMeeting(liveMeeting.status)
}
// Set webcamsOnlyForModerator property in case we didn't after meeting creation
MeetingStatus2x.setWebcamsOnlyForModerator(liveMeeting.status, liveMeeting.props.usersProp.webcamsOnlyForModerator)
/*******************************************************************/
//object FakeTestData extends FakeTestData
//FakeTestData.createFakeUsers(liveMeeting)

View File

@ -248,6 +248,7 @@ public class MeetingService implements MessageListener {
logData.put("name", m.getName());
logData.put("duration", m.getDuration());
logData.put("isBreakout", m.isBreakout());
logData.put("webcamsOnlyForModerator", m.getWebcamsOnlyForModerator());
logData.put("record", m.isRecord());
logData.put("event", "create_meeting");
logData.put("description", "Create meeting.");

View File

@ -5,18 +5,19 @@ import akka.actor.ActorSystem
import akka.event.Logging
import org.bigbluebutton.api.messaging.converters.messages._
import org.bigbluebutton.api2.bus._
import org.bigbluebutton.api2.endpoint.redis.{AppsRedisSubscriberActor, MessageSender, RedisPublisher}
import org.bigbluebutton.api2.meeting.{MeetingsManagerActor, OldMeetingMsgHdlrActor, RegisterUser}
import org.bigbluebutton.api2.endpoint.redis.{ AppsRedisSubscriberActor, MessageSender, RedisPublisher }
import org.bigbluebutton.api2.meeting.{ MeetingsManagerActor, OldMeetingMsgHdlrActor, RegisterUser }
import org.bigbluebutton.common.messages.SendStunTurnInfoReplyMessage
import org.bigbluebutton.common2.domain._
import org.bigbluebutton.presentation.messages._
import scala.concurrent.duration._
class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
val screenshareRtmpServer: String,
val screenshareRtmpBroadcastApp: String,
val screenshareConfSuffix: String) extends IBbbWebApiGWApp with SystemConfiguration{
class BbbWebApiGWApp(
val oldMessageReceivedGW: OldMessageReceivedGW,
val screenshareRtmpServer: String,
val screenshareRtmpBroadcastApp: String,
val screenshareConfSuffix: String) extends IBbbWebApiGWApp with SystemConfiguration {
implicit val system = ActorSystem("bbb-web-common")
@ -39,15 +40,14 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
private val msgToAkkaAppsEventBus = new MsgToAkkaAppsEventBus
/**
* Not used for now as we will still user MeetingService for 2.0 (ralam july 4, 2017)
*/
* Not used for now as we will still user MeetingService for 2.0 (ralam july 4, 2017)
*/
//private val meetingManagerActorRef = system.actorOf(
// MeetingsManagerActor.props(msgToAkkaAppsEventBus), "meetingManagerActor")
//msgFromAkkaAppsEventBus.subscribe(meetingManagerActorRef, fromAkkaAppsChannel)
private val oldMeetingMsgHdlrActor = system.actorOf(
OldMeetingMsgHdlrActor.props(oldMessageReceivedGW), "oldMeetingMsgHdlrActor"
)
OldMeetingMsgHdlrActor.props(oldMessageReceivedGW), "oldMeetingMsgHdlrActor")
msgFromAkkaAppsEventBus.subscribe(oldMeetingMsgHdlrActor, fromAkkaAppsChannel)
private val msgToAkkaAppsToJsonActor = system.actorOf(
@ -56,7 +56,7 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
msgToAkkaAppsEventBus.subscribe(msgToAkkaAppsToJsonActor, toAkkaAppsChannel)
private val appsRedisSubscriberActor = system.actorOf(
AppsRedisSubscriberActor.props(receivedJsonMsgBus,oldMessageEventBus), "appsRedisSubscriberActor")
AppsRedisSubscriberActor.props(receivedJsonMsgBus, oldMessageEventBus), "appsRedisSubscriberActor")
private val receivedJsonMsgHdlrActor = system.actorOf(
ReceivedJsonMsgHdlrActor.props(msgFromAkkaAppsEventBus), "receivedJsonMsgHdlrActor")
@ -68,7 +68,7 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
oldMessageEventBus.subscribe(oldMessageJsonReceiverActor, fromAkkaAppsOldJsonChannel)
/*****
/*****
* External APIs for Gateway
*/
def send(channel: String, json: String): Unit = {
@ -78,21 +78,22 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
def createMeeting(meetingId: String, extMeetingId: String, parentMeetingId: String, meetingName: String,
recorded: java.lang.Boolean, voiceBridge: String, duration: java.lang.Integer,
autoStartRecording: java.lang.Boolean,
autoStartRecording: java.lang.Boolean,
allowStartStopRecording: java.lang.Boolean, webcamsOnlyForModerator: java.lang.Boolean, moderatorPass: String,
viewerPass: String, createTime: java.lang.Long, createDate: String, isBreakout: java.lang.Boolean,
sequence: java.lang.Integer,
metadata: java.util.Map[String, String], guestPolicy: String,
welcomeMsgTemplate: String, welcomeMsg: String, modOnlyMessage: String,
dialNumber: String, maxUsers: java.lang.Integer, maxInactivityTimeoutMinutes: java.lang.Integer,
warnMinutesBeforeMax: java.lang.Integer,
meetingExpireIfNoUserJoinedInMinutes: java.lang.Integer,
dialNumber: String, maxUsers: java.lang.Integer, maxInactivityTimeoutMinutes: java.lang.Integer,
warnMinutesBeforeMax: java.lang.Integer,
meetingExpireIfNoUserJoinedInMinutes: java.lang.Integer,
meetingExpireWhenLastUserLeftInMinutes: java.lang.Integer,
muteOnStart: java.lang.Boolean): Unit = {
muteOnStart: java.lang.Boolean): Unit = {
val meetingProp = MeetingProp(name = meetingName, extId = extMeetingId, intId = meetingId,
isBreakout = isBreakout.booleanValue())
val durationProps = DurationProps(duration = duration.intValue(),
val durationProps = DurationProps(
duration = duration.intValue(),
createdTime = createTime.longValue(), createDate,
maxInactivityTimeoutMinutes = maxInactivityTimeoutMinutes.intValue(),
warnMinutesBeforeMax = warnMinutesBeforeMax.intValue(),
@ -109,7 +110,8 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
val usersProp = UsersProp(maxUsers = maxUsers.intValue(), webcamsOnlyForModerator = webcamsOnlyForModerator.booleanValue(),
guestPolicy = guestPolicy)
val metadataProp = MetadataProp(mapAsScalaMap(metadata).toMap)
val screenshareProps = ScreenshareProps(screenshareConf = voiceBridge + screenshareConfSuffix,
val screenshareProps = ScreenshareProps(
screenshareConf = voiceBridge + screenshareConfSuffix,
red5ScreenshareIp = screenshareRtmpServer,
red5ScreenshareApp = screenshareRtmpBroadcastApp)
@ -123,23 +125,23 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
}
def registerUser (meetingId: String, intUserId: String, name: String,
role: String, extUserId: String, authToken: String, avatarURL: String,
guest: java.lang.Boolean, authed: java.lang.Boolean): Unit = {
def registerUser(meetingId: String, intUserId: String, name: String,
role: String, extUserId: String, authToken: String, avatarURL: String,
guest: java.lang.Boolean, authed: java.lang.Boolean): Unit = {
// meetingManagerActorRef ! new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name,
// role = role, extUserId = extUserId, authToken = authToken, avatarURL = avatarURL,
// guest = guest, authed = authed)
// meetingManagerActorRef ! new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name,
// role = role, extUserId = extUserId, authToken = authToken, avatarURL = avatarURL,
// guest = guest, authed = authed)
val regUser = new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name,
role = role, extUserId = extUserId, authToken = authToken, avatarURL = avatarURL,
guest = guest.booleanValue(), authed = authed.booleanValue())
role = role, extUserId = extUserId, authToken = authToken, avatarURL = avatarURL,
guest = guest.booleanValue(), authed = authed.booleanValue())
val event = MsgBuilder.buildRegisterUserRequestToAkkaApps(regUser)
msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event))
}
def destroyMeeting (msg: DestroyMeetingMessage): Unit = {
def destroyMeeting(msg: DestroyMeetingMessage): Unit = {
val event = MsgBuilder.buildDestroyMeetingSysCmdMsg(msg)
msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event))
}
@ -172,7 +174,7 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW,
}
def sendDocConversionMsg(msg: IDocConversionMsg): Unit = {
if (msg.isInstanceOf[DocPageGeneratedProgress]) {
if (msg.isInstanceOf[DocPageGeneratedProgress]) {
val event = MsgBuilder.buildPresentationPageGeneratedPubMsg(msg.asInstanceOf[DocPageGeneratedProgress])
msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event))
} else if (msg.isInstanceOf[OfficeDocConversionProgress]) {