Perform upload upon breakout room timeout

This commit is contained in:
Daniel Petri Rocha 2022-09-19 19:22:29 +02:00
parent 7c086c3ea2
commit edb2ff39cc
11 changed files with 30 additions and 19 deletions

View File

@ -109,7 +109,7 @@ case class EjectUserFromBreakoutInternalMsg(parentId: String, breakoutId: String
* @param parentMeetingId
* @param allSlides
*/
case class CapturePresentationReqInternalMsg(userId: String, parentMeetingId: String, allPages: Boolean = false) extends InMessage
case class CapturePresentationReqInternalMsg(userId: String, parentMeetingId: String, allPages: Boolean = true) extends InMessage
// DeskShare
case class DeskShareStartedRequest(conferenceName: String, callerId: String, callerIdName: String) extends InMessage

View File

@ -1,7 +1,7 @@
package org.bigbluebutton.core.apps.breakout
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.api.{ EndBreakoutRoomInternalMsg, CapturePresentationReqInternalMsg }
import org.bigbluebutton.core.api.EndBreakoutRoomInternalMsg
import org.bigbluebutton.core.bus.BigBlueButtonEvent
import org.bigbluebutton.core.domain.{ MeetingEndReason, MeetingState2x }
import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter }
@ -24,12 +24,7 @@ trait EndAllBreakoutRoomsMsgHdlr extends RightsManagementTrait {
model <- state.breakout
} yield {
model.rooms.values.foreach { room =>
eventBus.publish(BigBlueButtonEvent(room.id, EndBreakoutRoomInternalMsg(props.breakoutProps.parentId, room.id, MeetingEndReason.BREAKOUT_ENDED_BY_MOD)))
if (room.capture) {
val event = BigBlueButtonEvent(room.id, CapturePresentationReqInternalMsg(msg.header.userId, meetingId))
eventBus.publish(event)
}
eventBus.publish(BigBlueButtonEvent(room.id, EndBreakoutRoomInternalMsg(meetingId, room.id, MeetingEndReason.BREAKOUT_ENDED_BY_MOD)))
}
val notifyEvent = MsgBuilder.buildNotifyAllInMeetingEvtMsg(

View File

@ -1,7 +1,7 @@
package org.bigbluebutton.core.apps.breakout
import org.bigbluebutton.core.api.EndBreakoutRoomInternalMsg
import org.bigbluebutton.core.bus.{ InternalEventBus }
import org.bigbluebutton.core.api.{ CapturePresentationReqInternalMsg, EndBreakoutRoomInternalMsg }
import org.bigbluebutton.core.bus.{ BigBlueButtonEvent, InternalEventBus }
import org.bigbluebutton.core.running.{ BaseMeetingActor, HandlerHelpers, LiveMeeting, OutMsgRouter }
trait EndBreakoutRoomInternalMsgHdlr extends HandlerHelpers {
@ -12,6 +12,12 @@ trait EndBreakoutRoomInternalMsgHdlr extends HandlerHelpers {
val eventBus: InternalEventBus
def handleEndBreakoutRoomInternalMsg(msg: EndBreakoutRoomInternalMsg): Unit = {
if (liveMeeting.props.breakoutProps.capture) {
val event = BigBlueButtonEvent(msg.breakoutId, CapturePresentationReqInternalMsg("system", msg.parentId))
eventBus.publish(event)
}
log.info("Breakout room {} ended by parent meeting {}.", msg.breakoutId, msg.parentId)
sendEndMeetingDueToExpiry(msg.reason, eventBus, outGW, liveMeeting, "system")
}

View File

@ -130,8 +130,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
val currentPres: Option[PresentationInPod] = presentationPods.flatMap(_.getCurrentPresentation()).headOption
if (liveMeeting.props.meetingProp.disabledFeatures.contains("importPresentationWithAnnotationsFromBreakoutRooms")) {
val reason = "Importing slides from breakout rooms disabled for this meeting."
PermissionCheck.ejectUserForFailedPermission(meetingId, userId, reason, bus.outGW, liveMeeting)
log.error(s"Capturing breakout rooms slides disabled in meeting ${meetingId}.")
} else if (currentPres.isEmpty) {
log.error(s"No presentation set in meeting ${meetingId}")
} else {

View File

@ -226,7 +226,7 @@ trait HandlerHelpers extends SystemConfiguration {
model <- state.breakout
} yield {
model.rooms.values.foreach { room =>
eventBus.publish(BigBlueButtonEvent(room.id, EndBreakoutRoomInternalMsg(liveMeeting.props.breakoutProps.parentId, room.id, reason)))
eventBus.publish(BigBlueButtonEvent(room.id, EndBreakoutRoomInternalMsg(liveMeeting.props.meetingProp.intId, room.id, reason)))
}
}

View File

@ -47,7 +47,7 @@ trait AppsTestFixtures {
val meetingLayout = ""
val metadata: collection.immutable.Map[String, String] = Map("foo" -> "bar", "bar" -> "baz", "baz" -> "foo")
val breakoutProps = BreakoutProps(parentId = parentMeetingId, sequence = sequence, freeJoin = false capture = false, breakoutRooms = Vector())
val breakoutProps = BreakoutProps(parentId = parentMeetingId, sequence = sequence, freeJoin = false, capture = false, breakoutRooms = Vector())
val meetingProp = MeetingProp(name = meetingName, extId = externalMeetingId, intId = meetingId,
meetingCameraCap = meetingCameraCap,

View File

@ -31,7 +31,6 @@ public class ApiParams {
public static final String DIAL_NUMBER = "dialNumber";
public static final String DURATION = "duration";
public static final String FREE_JOIN = "freeJoin";
public static final String CAPTURE = "capture";
public static final String FULL_NAME = "fullName";
public static final String GUEST_POLICY = "guestPolicy";
public static final String MEETING_LAYOUT = "meetingLayout";
@ -74,6 +73,7 @@ public class ApiParams {
public static final String DISABLED_FEATURES = "disabledFeatures";
public static final String NOTIFY_RECORDING_IS_ON = "notifyRecordingIsOn";
public static final String BREAKOUT_ROOMS_CAPTURE = "capture";
public static final String BREAKOUT_ROOMS_ENABLED = "breakoutRoomsEnabled";
public static final String BREAKOUT_ROOMS_RECORD = "breakoutRoomsRecord";
public static final String BREAKOUT_ROOMS_PRIVATE_CHAT_ENABLED = "breakoutRoomsPrivateChatEnabled";

View File

@ -377,6 +377,7 @@ public class MeetingService implements MessageListener {
breakoutMetadata.put("meetingId", m.getExternalId());
breakoutMetadata.put("sequence", m.getSequence().toString());
breakoutMetadata.put("freeJoin", m.isFreeJoin().toString());
breakoutMetadata.put("capture", m.isCaptured().toString());
breakoutMetadata.put("parentMeetingId", m.getParentMeetingId());
storeService.recordBreakoutInfo(m.getInternalId(), breakoutMetadata);
}
@ -388,6 +389,7 @@ public class MeetingService implements MessageListener {
if (m.isBreakout()) {
logData.put("sequence", m.getSequence());
logData.put("freeJoin", m.isFreeJoin());
logData.put("capture", m.isCaptured());
logData.put("parentMeetingId", m.getParentMeetingId());
}
logData.put("name", m.getName());
@ -660,7 +662,7 @@ public class MeetingService implements MessageListener {
params.put(ApiParams.IS_BREAKOUT, "true");
params.put(ApiParams.SEQUENCE, message.sequence.toString());
params.put(ApiParams.FREE_JOIN, message.freeJoin.toString());
params.put(ApiParams.CAPTURE, message.capture.toString());
params.put(ApiParams.BREAKOUT_ROOMS_CAPTURE, message.capture.toString());
params.put(ApiParams.ATTENDEE_PW, message.viewerPassword);
params.put(ApiParams.MODERATOR_PW, message.moderatorPassword);
params.put(ApiParams.DIAL_NUMBER, message.dialNumber);

View File

@ -263,7 +263,6 @@ public class ParamsProcessorUtil {
private BreakoutRoomsParams processBreakoutRoomsParams(Map<String, String> params) {
Boolean breakoutRoomsRecord = defaultBreakoutRoomsRecord;
Boolean breakoutRoomsCapture = defaultBreakoutRoomsCapture;
String breakoutRoomsRecordParam = params.get(ApiParams.BREAKOUT_ROOMS_RECORD);
if (!StringUtils.isEmpty(breakoutRoomsRecordParam)) {
breakoutRoomsRecord = Boolean.parseBoolean(breakoutRoomsRecordParam);
@ -275,6 +274,12 @@ public class ParamsProcessorUtil {
breakoutRoomsPrivateChatEnabled = Boolean.parseBoolean(breakoutRoomsPrivateChatEnabledParam);
}
Boolean breakoutRoomsCapture = defaultBreakoutRoomsCapture;
String breakoutRoomsCaptureParam = params.get(ApiParams.BREAKOUT_ROOMS_CAPTURE);
if (!StringUtils.isEmpty(breakoutRoomsCaptureParam)) {
breakoutRoomsCapture = Boolean.parseBoolean(breakoutRoomsCaptureParam);
}
return new BreakoutRoomsParams(breakoutRoomsRecord, breakoutRoomsPrivateChatEnabled, breakoutRoomsCapture);
}
@ -730,7 +735,7 @@ public class ParamsProcessorUtil {
if (isBreakout) {
meeting.setSequence(Integer.parseInt(params.get(ApiParams.SEQUENCE)));
meeting.setFreeJoin(Boolean.parseBoolean(params.get(ApiParams.FREE_JOIN)));
meeting.setCapture(Boolean.parseBoolean(params.get(ApiParams.CAPTURE)));
meeting.setCapture(Boolean.parseBoolean(params.get(ApiParams.BREAKOUT_ROOMS_CAPTURE)));
meeting.setParentMeetingId(parentMeetingId);
}

View File

@ -285,6 +285,10 @@ public class Meeting {
this.freeJoin = freeJoin;
}
public Boolean isCaptured() {
return capture;
}
public void setCapture(Boolean capture) {
this.capture = capture;
}

View File

@ -12,7 +12,7 @@ case class CreateBreakoutRoomMsg(meetingId: String, parentMeetingId: String,
name: String, sequence: Integer, freeJoin: Boolean, dialNumber: String,
voiceConfId: String, viewerPassword: String, moderatorPassword: String, duration: Int,
sourcePresentationId: String, sourcePresentationSlide: Int,
record: Boolean) extends ApiMsg
record: Boolean, capture: Boolean) extends ApiMsg
case class AddUserSession(token: String, session: UserSession)
case class RegisterUser(meetingId: String, intUserId: String, name: String, role: String,