Merge branch 'bbb-2x-mconf' into html5-2x-chat-messages

This commit is contained in:
Klaus 2017-07-12 16:29:07 -03:00
commit 2aa603d195
87 changed files with 1189 additions and 1865 deletions

View File

@ -1,59 +0,0 @@
package org.bigbluebutton.core.pubsub.receivers;
import com.google.gson.JsonParser;
import com.google.gson.JsonObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.bigbluebutton.common.messages.DeskShareStartedEventMessage;
import org.bigbluebutton.common.messages.DeskShareStoppedEventMessage;
import org.bigbluebutton.common.messages.DeskShareRTMPBroadcastStartedEventMessage;
import org.bigbluebutton.common.messages.DeskShareRTMPBroadcastStoppedEventMessage;
import org.bigbluebutton.common.messages.DeskShareGetInfoRequestMessage;
import org.bigbluebutton.common.messages.MessagingConstants;
import org.bigbluebutton.core.api.IBigBlueButtonInGW;
public class DeskShareMessageReceiver implements MessageHandler {
private IBigBlueButtonInGW bbbGW;
private static final Logger log = LoggerFactory.getLogger(DeskShareMessageReceiver.class);
public DeskShareMessageReceiver(IBigBlueButtonInGW bbbGW) {
this.bbbGW = bbbGW;
}
@Override
public void handleMessage(String pattern, String channel, String message) {
if (channel.equalsIgnoreCase(MessagingConstants.FROM_VOICE_CONF_SYSTEM_CHAN)) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DeskShareStartedEventMessage.DESKSHARE_STARTED_MESSAGE.equals(messageName)) {
DeskShareStartedEventMessage msg = DeskShareStartedEventMessage.fromJson(message);
log.info("^^^^^^^DESKSHARE STARTED^^^^^^");
bbbGW.deskShareStarted(msg.conferenceName, msg.callerId, msg.callerIdName);
} else if (DeskShareStoppedEventMessage.DESK_SHARE_STOPPED_MESSAGE.equals(messageName)) {
DeskShareStoppedEventMessage msg = DeskShareStoppedEventMessage.fromJson(message);
log.info("^^^^^^^DESKSHARE STOPPED^^^^^^");
bbbGW.deskShareStopped(msg.conferenceName, msg.callerId, msg.callerIdName);
} else if (DeskShareRTMPBroadcastStartedEventMessage.DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE.equals(messageName)) {
log.info("^^^^^^^DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE^^^^^^");
DeskShareRTMPBroadcastStartedEventMessage msg = DeskShareRTMPBroadcastStartedEventMessage.fromJson(message);
bbbGW.deskShareRTMPBroadcastStarted(msg.conferenceName, msg.streamname, msg.vw, msg.vh, msg.timestamp);
} else if (DeskShareRTMPBroadcastStoppedEventMessage.DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE.equals(messageName)) {
log.info("^^^^^^^DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE^^^^^^");
DeskShareRTMPBroadcastStoppedEventMessage msg = DeskShareRTMPBroadcastStoppedEventMessage.fromJson(message);
bbbGW.deskShareRTMPBroadcastStopped(msg.conferenceName, msg.streamname, msg.vw, msg.vh, msg.timestamp);
} else if (DeskShareGetInfoRequestMessage.GET_DESKTOP_SHARE_GET_INFO_REQUEST.equals(messageName)) {
log.info("^^^^^^^GET_DESKTOP_SHARE_INFO_REQUEST^^^^^^");
DeskShareGetInfoRequestMessage msg = DeskShareGetInfoRequestMessage.fromJson(message);
bbbGW.deskShareGetInfoRequest(msg.meetingId, msg.requesterId, msg.replyTo);
}
}
}
}
}
}

View File

@ -40,9 +40,6 @@ public class RedisMessageReceiver {
UsersMessageReceiver usersRx = new UsersMessageReceiver(bbbGW);
receivers.add(usersRx);
DeskShareMessageReceiver deskShareRx = new DeskShareMessageReceiver(bbbGW);
receivers.add(deskShareRx);
PollingMessageReceiver pollRx = new PollingMessageReceiver(bbbGW);
receivers.add(pollRx);

View File

@ -59,7 +59,7 @@ services {
}
red5 {
deskshareip="192.168.0.109"
deskshareip="10.130.218.89"
deskshareapp="video-broadcast"
}

View File

@ -12,7 +12,6 @@ import org.bigbluebutton.common.messages.StartRecordingVoiceConfRequestMessage
import org.bigbluebutton.common.messages.StopRecordingVoiceConfRequestMessage
import org.bigbluebutton.core.pubsub.senders.MeetingMessageToJsonConverter
import org.bigbluebutton.core.pubsub.senders.PesentationMessageToJsonConverter
import org.bigbluebutton.core.pubsub.senders.DeskShareMessageToJsonConverter
import org.bigbluebutton.common.messages.GetPresentationInfoReplyMessage
import org.bigbluebutton.common.messages.PresentationRemovedMessage
import org.bigbluebutton.common.messages.AllowUserToShareDesktopReply
@ -132,11 +131,6 @@ class MessageSenderActor(val service: MessageSender)
case msg: MeetingTimeRemainingUpdate => handleMeetingTimeRemainingUpdate(msg)
case msg: BreakoutRoomsTimeRemainingUpdateOutMessage => handleBreakoutRoomsTimeRemainingUpdate(msg)
case msg: DeskShareStartRTMPBroadcast => handleDeskShareStartRTMPBroadcast(msg)
case msg: DeskShareStopRTMPBroadcast => handleDeskShareStopRTMPBroadcast(msg)
case msg: DeskShareNotifyViewersRTMP => handleDeskShareNotifyViewersRTMP(msg)
case msg: DeskShareNotifyASingleViewer => handleDeskShareNotifyASingleViewer(msg)
case msg: DeskShareHangUp => handleDeskShareHangUp(msg)
case msg: GetGuestPolicyReply => handleGetGuestPolicyReply(msg)
case msg: GuestPolicyChanged => handleGuestPolicyChanged(msg)
case msg: GuestAccessDenied => handleGuestAccessDenied(msg)
@ -148,31 +142,6 @@ class MessageSenderActor(val service: MessageSender)
service.send(MessagingConstants.FROM_USERS_CHANNEL, m.toJson)
}
private def handleDeskShareHangUp(msg: DeskShareHangUp) {
val json = DeskShareMessageToJsonConverter.getDeskShareHangUpToJson(msg)
service.send(MessagingConstants.TO_VOICE_CONF_SYSTEM_CHAN, json)
}
private def handleDeskShareStopRTMPBroadcast(msg: DeskShareStopRTMPBroadcast) {
val json = DeskShareMessageToJsonConverter.getDeskShareStopRTMPBroadcastToJson(msg)
service.send(MessagingConstants.TO_VOICE_CONF_SYSTEM_CHAN, json)
}
private def handleDeskShareNotifyViewersRTMP(msg: DeskShareNotifyViewersRTMP) {
val json = DeskShareMessageToJsonConverter.getDeskShareNotifyViewersRTMPToJson(msg)
service.send(MessagingConstants.FROM_DESK_SHARE_CHANNEL, json)
}
def handleDeskShareNotifyASingleViewer(msg: DeskShareNotifyASingleViewer) {
val json = DeskShareMessageToJsonConverter.getDeskShareNotifyASingleViewerToJson(msg)
service.send(MessagingConstants.FROM_DESK_SHARE_CHANNEL, json)
}
private def handleDeskShareStartRTMPBroadcast(msg: DeskShareStartRTMPBroadcast) {
val json = DeskShareMessageToJsonConverter.getDeskShareStartRTMPBroadcastToJson(msg)
service.send(MessagingConstants.TO_VOICE_CONF_SYSTEM_CHAN, json)
}
private def handleStartRecordingVoiceConf(msg: StartRecordingVoiceConf) {
val m = new StartRecordingVoiceConfRequestMessage(msg.meetingID, msg.voiceConfId)
service.send(MessagingConstants.TO_VOICE_CONF_SYSTEM_CHAN, m.toJson())

View File

@ -1,115 +0,0 @@
package org.bigbluebutton.core.apps
object DeskshareModel {
def resetDesktopSharingParams(status: DeskshareModel) = {
status.broadcastingRTMP = false
status.deskShareStarted = false
status.rtmpBroadcastingUrl = ""
status.desktopShareVideoWidth = 0
status.desktopShareVideoHeight = 0
}
def getDeskShareStarted(status: DeskshareModel): Boolean = {
return status.deskShareStarted
}
def setDeskShareStarted(status: DeskshareModel, b: Boolean) {
status.deskShareStarted = b
}
def setDesktopShareVideoWidth(status: DeskshareModel, videoWidth: Int) {
status.desktopShareVideoWidth = videoWidth
}
def setDesktopShareVideoHeight(status: DeskshareModel, videoHeight: Int) {
status.desktopShareVideoHeight = videoHeight
}
def getDesktopShareVideoWidth(status: DeskshareModel): Int = {
status.desktopShareVideoWidth
}
def getDesktopShareVideoHeight(status: DeskshareModel): Int = {
status.desktopShareVideoHeight
}
def broadcastingRTMPStarted(status: DeskshareModel) {
status.broadcastingRTMP = true
}
def isBroadcastingRTMP(status: DeskshareModel): Boolean = {
status.broadcastingRTMP
}
def broadcastingRTMPStopped(status: DeskshareModel) {
status.broadcastingRTMP = false
}
def setRTMPBroadcastingUrl(status: DeskshareModel, path: String) {
status.rtmpBroadcastingUrl = path
}
def getRTMPBroadcastingUrl(status: DeskshareModel): String = {
status.rtmpBroadcastingUrl
}
}
class DeskshareModel {
private var rtmpBroadcastingUrl: String = ""
private var deskShareStarted = false
private var desktopShareVideoWidth = 0
private var desktopShareVideoHeight = 0
private var broadcastingRTMP = false
private def resetDesktopSharingParams() = {
broadcastingRTMP = false
deskShareStarted = false
rtmpBroadcastingUrl = ""
desktopShareVideoWidth = 0
desktopShareVideoHeight = 0
}
private def getDeskShareStarted(): Boolean = {
return deskShareStarted
}
private def setDeskShareStarted(b: Boolean) {
deskShareStarted = b
}
private def setDesktopShareVideoWidth(videoWidth: Int) {
desktopShareVideoWidth = videoWidth
}
private def setDesktopShareVideoHeight(videoHeight: Int) {
desktopShareVideoHeight = videoHeight
}
private def getDesktopShareVideoWidth(): Int = {
desktopShareVideoWidth
}
private def getDesktopShareVideoHeight(): Int = {
desktopShareVideoHeight
}
private def broadcastingRTMPStarted() {
broadcastingRTMP = true
}
private def isBroadcastingRTMP(): Boolean = {
broadcastingRTMP
}
private def broadcastingRTMPStopped() {
broadcastingRTMP = false
}
private def setRTMPBroadcastingUrl(path: String) {
rtmpBroadcastingUrl = path
}
private def getRTMPBroadcastingUrl(): String = {
rtmpBroadcastingUrl
}
}

View File

@ -0,0 +1,115 @@
package org.bigbluebutton.core.apps
object ScreenshareModel {
def resetDesktopSharingParams(status: ScreenshareModel) = {
status.broadcastingRTMP = false
status.screenshareStarted = false
status.rtmpBroadcastingUrl = ""
status.screenshareVideoWidth = 0
status.screenshareVideoHeight = 0
}
def getScreenshareStarted(status: ScreenshareModel): Boolean = {
return status.screenshareStarted
}
def setScreenshareStarted(status: ScreenshareModel, b: Boolean) {
status.screenshareStarted = b
}
def setScreenshareVideoWidth(status: ScreenshareModel, videoWidth: Int) {
status.screenshareVideoWidth = videoWidth
}
def setScreenshareVideoHeight(status: ScreenshareModel, videoHeight: Int) {
status.screenshareVideoHeight = videoHeight
}
def getScreenshareVideoWidth(status: ScreenshareModel): Int = {
status.screenshareVideoWidth
}
def getScreenshareVideoHeight(status: ScreenshareModel): Int = {
status.screenshareVideoHeight
}
def broadcastingRTMPStarted(status: ScreenshareModel) {
status.broadcastingRTMP = true
}
def isBroadcastingRTMP(status: ScreenshareModel): Boolean = {
status.broadcastingRTMP
}
def broadcastingRTMPStopped(status: ScreenshareModel) {
status.broadcastingRTMP = false
}
def setRTMPBroadcastingUrl(status: ScreenshareModel, path: String) {
status.rtmpBroadcastingUrl = path
}
def getRTMPBroadcastingUrl(status: ScreenshareModel): String = {
status.rtmpBroadcastingUrl
}
}
class ScreenshareModel {
private var rtmpBroadcastingUrl: String = ""
private var screenshareStarted = false
private var screenshareVideoWidth = 0
private var screenshareVideoHeight = 0
private var broadcastingRTMP = false
private def resetDesktopSharingParams() = {
broadcastingRTMP = false
screenshareStarted = false
rtmpBroadcastingUrl = ""
screenshareVideoWidth = 0
screenshareVideoHeight = 0
}
private def getScreenshareStarted(): Boolean = {
return screenshareStarted
}
private def setScreenshareStarted(b: Boolean) {
screenshareStarted = b
}
private def setScreenshareVideoWidth(videoWidth: Int) {
screenshareVideoWidth = videoWidth
}
private def setScreenshareVideoHeight(videoHeight: Int) {
screenshareVideoHeight = videoHeight
}
private def getScreenshareVideoWidth(): Int = {
screenshareVideoWidth
}
private def getScreenshareVideoHeight(): Int = {
screenshareVideoHeight
}
private def broadcastingRTMPStarted() {
broadcastingRTMP = true
}
private def isBroadcastingRTMP(): Boolean = {
broadcastingRTMP
}
private def broadcastingRTMPStopped() {
broadcastingRTMP = false
}
private def setRTMPBroadcastingUrl(path: String) {
rtmpBroadcastingUrl = path
}
private def getRTMPBroadcastingUrl(): String = {
rtmpBroadcastingUrl
}
}

View File

@ -1,17 +0,0 @@
package org.bigbluebutton.core.apps.deskshare
import akka.actor.ActorContext
import akka.event.Logging
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.LiveMeeting
class DeskshareApp2x(val liveMeeting: LiveMeeting,
val outGW: OutMessageGateway)(implicit val context: ActorContext)
extends DeskshareStartedVoiceConfEvtMsgHdlr
with DeskshareStoppedVoiceConfEvtMsgHdlr
with DeskshareRtmpBroadcastStartedVoiceConfEvtMsgHdlr
with DeskshareRtmpBroadcastStoppedVoiceConfEvtMsgHdlr {
val log = Logging(context.system, getClass)
}

View File

@ -1,47 +0,0 @@
package org.bigbluebutton.core.apps.deskshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.DeskshareModel
trait DeskshareRtmpBroadcastStartedVoiceConfEvtMsgHdlr {
this: DeskshareApp2x =>
val outGW: OutMessageGateway
def handleDeskshareRtmpBroadcastStartedVoiceConfEvtMsg(msg: DeskshareRtmpBroadcastStartedVoiceConfEvtMsg): Unit = {
def broadcastEvent(msg: DeskshareRtmpBroadcastStartedVoiceConfEvtMsg): Unit = {
/*
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(ClearPublicChatHistoryEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(ClearPublicChatHistoryEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)
val body = ClearPublicChatHistoryEvtMsgBody()
val event = ClearPublicChatHistoryEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
*/
//record(event)
}
log.info("handleDeskShareRTMPBroadcastStartedRequest: isBroadcastingRTMP=" +
DeskshareModel.isBroadcastingRTMP(liveMeeting.deskshareModel) +
" URL:" + DeskshareModel.getRTMPBroadcastingUrl(liveMeeting.deskshareModel))
// only valid if not broadcasting yet
if (!DeskshareModel.isBroadcastingRTMP(liveMeeting.deskshareModel)) {
DeskshareModel.setRTMPBroadcastingUrl(liveMeeting.deskshareModel, msg.body.stream)
DeskshareModel.broadcastingRTMPStarted(liveMeeting.deskshareModel)
DeskshareModel.setDesktopShareVideoWidth(liveMeeting.deskshareModel, msg.body.vidHeight)
DeskshareModel.setDesktopShareVideoHeight(liveMeeting.deskshareModel, msg.body.vidHeight)
log.info("START broadcast ALLOWED when isBroadcastingRTMP=false")
// Notify viewers in the meeting that there's an rtmp stream to view
//outGW.send(new DeskShareNotifyViewersRTMP(props.meetingProp.intId, msg.streamname, msg.videoWidth, msg.videoHeight, true))
broadcastEvent(msg)
} else {
log.info("START broadcast NOT ALLOWED when isBroadcastingRTMP=true")
}
}
}

View File

@ -1,46 +0,0 @@
package org.bigbluebutton.core.apps.deskshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.DeskshareModel
trait DeskshareRtmpBroadcastStoppedVoiceConfEvtMsgHdlr {
this: DeskshareApp2x =>
val outGW: OutMessageGateway
def handleDeskshareRtmpBroadcastStoppedVoiceConfEvtMsg(msg: DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg): Unit = {
def broadcastEvent(msg: DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg): Unit = {
/*
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(ClearPublicChatHistoryEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(ClearPublicChatHistoryEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)
val body = ClearPublicChatHistoryEvtMsgBody()
val event = ClearPublicChatHistoryEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
*/
//record(event)
}
log.info("handleDeskShareRTMPBroadcastStoppedRequest: isBroadcastingRTMP=" +
DeskshareModel.isBroadcastingRTMP(liveMeeting.deskshareModel) + " URL:" +
DeskshareModel.getRTMPBroadcastingUrl(liveMeeting.deskshareModel))
// only valid if currently broadcasting
if (DeskshareModel.isBroadcastingRTMP(liveMeeting.deskshareModel)) {
log.info("STOP broadcast ALLOWED when isBroadcastingRTMP=true")
DeskshareModel.broadcastingRTMPStopped(liveMeeting.deskshareModel)
// notify viewers that RTMP broadcast stopped
//outGW.send(new DeskShareNotifyViewersRTMP(props.meetingProp.intId,
// DeskshareModel.getRTMPBroadcastingUrl(liveMeeting.deskshareModel),
// msg.videoWidth, msg.videoHeight, false))
broadcastEvent(msg)
} else {
log.info("STOP broadcast NOT ALLOWED when isBroadcastingRTMP=false")
}
}
}

View File

@ -1,43 +0,0 @@
package org.bigbluebutton.core.apps.deskshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.DeskshareModel
trait DeskshareStartedVoiceConfEvtMsgHdlr {
this: DeskshareApp2x =>
val outGW: OutMessageGateway
def handleDeskshareStartedVoiceConfEvtMsg(msg: DeskshareStartedVoiceConfEvtMsg): Unit = {
def broadcastEvent(msg: DeskshareStartedVoiceConfEvtMsg): Unit = {
/*
val routing = Routing.addMsgToClientRouting(MessageTypes.SYSTEM, liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(DeskshareStartRtmpBroadcastVoiceConfMsg.NAME, routing)
val header = BbbClientMsgHeader(DeskshareStartRtmpBroadcastVoiceConfMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)
val body = DeskshareStartRtmpBroadcastVoiceConfMsgBody()
val event = DeskshareStartRtmpBroadcastVoiceConfMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
*/
//record(event)
}
log.info("handleDeskShareStartedRequest: dsStarted=" + DeskshareModel.getDeskShareStarted(liveMeeting.deskshareModel))
if (!DeskshareModel.getDeskShareStarted(liveMeeting.deskshareModel)) {
val timestamp = System.currentTimeMillis().toString
val streamPath = "rtmp://" + liveMeeting.props.screenshareProps.red5ScreenshareIp + "/" + liveMeeting.props.screenshareProps.red5ScreenshareApp +
"/" + liveMeeting.props.meetingProp.intId + "/" + liveMeeting.props.meetingProp.intId + "-" + timestamp
log.info("handleDeskShareStartedRequest: streamPath=" + streamPath)
// Tell FreeSwitch to broadcast to RTMP
broadcastEvent(msg)
//outGW.send(new DeskShareStartRTMPBroadcast(msg.conferenceName, streamPath))
DeskshareModel.setDeskShareStarted(liveMeeting.deskshareModel, true)
}
}
}

View File

@ -1,39 +0,0 @@
package org.bigbluebutton.core.apps.deskshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.DeskshareModel
trait DeskshareStoppedVoiceConfEvtMsgHdlr {
this: DeskshareApp2x =>
val outGW: OutMessageGateway
def handleDeskshareStoppedVoiceConfEvtMsg(msg: DeskshareStoppedVoiceConfEvtMsg): Unit = {
def broadcastEvent(msg: DeskshareStoppedVoiceConfEvtMsg): Unit = {
/*
val routing = Routing.addMsgToClientRouting(MessageTypes.SYSTEM, liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(DeskshareStopRtmpBroadcastVoiceConfMsg.NAME, routing)
val header = BbbClientMsgHeader(DeskshareStopRtmpBroadcastVoiceConfMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)
val body = DeskshareStopRtmpBroadcastVoiceConfMsgBody()
val event = DeskshareStopRtmpBroadcastVoiceConfMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
*/
//record(event)
}
log.info("handleDeskShareStoppedRequest: dsStarted=" +
DeskshareModel.getDeskShareStarted(liveMeeting.deskshareModel) +
" URL:" + DeskshareModel.getRTMPBroadcastingUrl(liveMeeting.deskshareModel))
// Tell FreeSwitch to stop broadcasting to RTMP
broadcastEvent(msg)
//outGW.send(new DeskShareStopRTMPBroadcast(msg.conferenceName,
// DeskshareModel.getRTMPBroadcastingUrl(liveMeeting.deskshareModel)))
DeskshareModel.setDeskShareStarted(liveMeeting.deskshareModel, false)
}
}

View File

@ -0,0 +1,17 @@
package org.bigbluebutton.core.apps.screenshare
import akka.actor.ActorContext
import akka.event.Logging
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.LiveMeeting
class ScreenshareApp2x(val liveMeeting: LiveMeeting,
val outGW: OutMessageGateway)(implicit val context: ActorContext)
extends ScreenshareStartedVoiceConfEvtMsgHdlr
with ScreenshareStoppedVoiceConfEvtMsgHdlr
with ScreenshareRtmpBroadcastStartedVoiceConfEvtMsgHdlr
with ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsgHdlr {
val log = Logging(context.system, getClass)
}

View File

@ -0,0 +1,49 @@
package org.bigbluebutton.core.apps.screenshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.ScreenshareModel
trait ScreenshareRtmpBroadcastStartedVoiceConfEvtMsgHdlr {
this: ScreenshareApp2x =>
val outGW: OutMessageGateway
def handleScreenshareRtmpBroadcastStartedVoiceConfEvtMsg(msg: ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg): Unit = {
def broadcastEvent(voiceConf: String, screenshareConf: String, stream: String, vidWidth: Int, vidHeight: Int,
timestamp: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, "not-used")
val envelope = BbbCoreEnvelope(ScreenshareRtmpBroadcastStartedEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(ScreenshareRtmpBroadcastStartedEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, "not-used")
val body = ScreenshareRtmpBroadcastStartedEvtMsgBody(voiceConf, screenshareConf,
stream, vidWidth, vidHeight, timestamp)
val event = ScreenshareRtmpBroadcastStartedEvtMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
log.info("handleScreenshareRTMPBroadcastStartedRequest: isBroadcastingRTMP=" +
ScreenshareModel.isBroadcastingRTMP(liveMeeting.screenshareModel) +
" URL:" + ScreenshareModel.getRTMPBroadcastingUrl(liveMeeting.screenshareModel))
// only valid if not broadcasting yet
if (!ScreenshareModel.isBroadcastingRTMP(liveMeeting.screenshareModel)) {
ScreenshareModel.setRTMPBroadcastingUrl(liveMeeting.screenshareModel, msg.body.stream)
ScreenshareModel.broadcastingRTMPStarted(liveMeeting.screenshareModel)
ScreenshareModel.setScreenshareVideoWidth(liveMeeting.screenshareModel, msg.body.vidWidth)
ScreenshareModel.setScreenshareVideoHeight(liveMeeting.screenshareModel, msg.body.vidHeight)
log.info("START broadcast ALLOWED when isBroadcastingRTMP=false")
// Notify viewers in the meeting that there's an rtmp stream to view
val msgEvent = broadcastEvent(msg.body.voiceConf, msg.body.screenshareConf, msg.body.stream,
msg.body.vidWidth, msg.body.vidHeight, msg.body.timestamp)
outGW.send(msgEvent)
} else {
log.info("START broadcast NOT ALLOWED when isBroadcastingRTMP=true")
}
}
}

View File

@ -0,0 +1,48 @@
package org.bigbluebutton.core.apps.screenshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.ScreenshareModel
trait ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsgHdlr {
this: ScreenshareApp2x =>
val outGW: OutMessageGateway
def handleScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg(msg: ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg): Unit = {
def broadcastEvent(voiceConf: String, screenshareConf: String,
stream: String, vidWidth: Int, vidHeight: Int,
timestamp: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, "not-used")
val envelope = BbbCoreEnvelope(ScreenshareRtmpBroadcastStoppedEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(ScreenshareRtmpBroadcastStoppedEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, "not-used")
val body = ScreenshareRtmpBroadcastStoppedEvtMsgBody(voiceConf, screenshareConf,
stream, vidWidth, vidHeight, timestamp)
val event = ScreenshareRtmpBroadcastStoppedEvtMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
log.info("handleScreenshareRTMPBroadcastStoppedRequest: isBroadcastingRTMP=" +
ScreenshareModel.isBroadcastingRTMP(liveMeeting.screenshareModel) + " URL:" +
ScreenshareModel.getRTMPBroadcastingUrl(liveMeeting.screenshareModel))
// only valid if currently broadcasting
if (ScreenshareModel.isBroadcastingRTMP(liveMeeting.screenshareModel)) {
log.info("STOP broadcast ALLOWED when isBroadcastingRTMP=true")
ScreenshareModel.broadcastingRTMPStopped(liveMeeting.screenshareModel)
// notify viewers that RTMP broadcast stopped
val msgEvent = broadcastEvent(msg.body.voiceConf, msg.body.screenshareConf, msg.body.stream,
msg.body.vidWidth, msg.body.vidHeight, msg.body.timestamp)
outGW.send(msgEvent)
} else {
log.info("STOP broadcast NOT ALLOWED when isBroadcastingRTMP=false")
}
}
}

View File

@ -0,0 +1,44 @@
package org.bigbluebutton.core.apps.screenshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.ScreenshareModel
trait ScreenshareStartedVoiceConfEvtMsgHdlr {
this: ScreenshareApp2x =>
val outGW: OutMessageGateway
def handleScreenshareStartedVoiceConfEvtMsg(msg: ScreenshareStartedVoiceConfEvtMsg): Unit = {
def broadcastEvent(voiceConf: String, screenshareConf: String, url: String, timestamp: String): BbbCommonEnvCoreMsg = {
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(ScreenshareStartRtmpBroadcastVoiceConfMsg.NAME, routing)
val header = BbbCoreHeaderWithMeetingId(ScreenshareStartRtmpBroadcastVoiceConfMsg.NAME,
liveMeeting.props.meetingProp.intId)
val body = ScreenshareStartRtmpBroadcastVoiceConfMsgBody(voiceConf: String, screenshareConf: String, url: String, timestamp: String)
val event = ScreenshareStartRtmpBroadcastVoiceConfMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
log.info("handleScreenshareStartedRequest: dsStarted=" + ScreenshareModel.getScreenshareStarted(liveMeeting.screenshareModel))
if (!ScreenshareModel.getScreenshareStarted(liveMeeting.screenshareModel)) {
val timestamp = System.currentTimeMillis().toString
val streamPath = "rtmp://" + liveMeeting.props.screenshareProps.red5ScreenshareIp + "/" +
liveMeeting.props.screenshareProps.red5ScreenshareApp +
"/" + liveMeeting.props.meetingProp.intId + "/" + liveMeeting.props.meetingProp.intId + "-" + timestamp
log.info("handleScreenshareStartedRequest: streamPath=" + streamPath)
// Tell FreeSwitch to broadcast to RTMP
val msgEvent = broadcastEvent(msg.body.voiceConf, msg.body.screenshareConf, streamPath, timestamp)
outGW.send(msgEvent)
ScreenshareModel.setScreenshareStarted(liveMeeting.screenshareModel, true)
}
}
}

View File

@ -0,0 +1,38 @@
package org.bigbluebutton.core.apps.screenshare
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.ScreenshareModel
trait ScreenshareStoppedVoiceConfEvtMsgHdlr {
this: ScreenshareApp2x =>
val outGW: OutMessageGateway
def handleScreenshareStoppedVoiceConfEvtMsg(msg: ScreenshareStoppedVoiceConfEvtMsg): Unit = {
def broadcastEvent(voiceConf: String, screenshareConf: String, url: String, timestamp: String): BbbCommonEnvCoreMsg = {
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(ScreenshareStopRtmpBroadcastVoiceConfMsg.NAME, routing)
val header = BbbCoreHeaderWithMeetingId(ScreenshareStopRtmpBroadcastVoiceConfMsg.NAME,
liveMeeting.props.meetingProp.intId)
val body = ScreenshareStopRtmpBroadcastVoiceConfMsgBody(voiceConf, screenshareConf, url, timestamp)
val event = ScreenshareStopRtmpBroadcastVoiceConfMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
log.info("handleScreenshareStoppedRequest: dsStarted=" +
ScreenshareModel.getScreenshareStarted(liveMeeting.screenshareModel) +
" URL:" + ScreenshareModel.getRTMPBroadcastingUrl(liveMeeting.screenshareModel))
val timestamp = System.currentTimeMillis().toString
// Tell FreeSwitch to stop broadcasting to RTMP
val msgEvent = broadcastEvent(msg.body.voiceConf, msg.body.screenshareConf,
ScreenshareModel.getRTMPBroadcastingUrl(liveMeeting.screenshareModel), timestamp)
outGW.send(msgEvent)
ScreenshareModel.setScreenshareStarted(liveMeeting.screenshareModel, false)
}
}

View File

@ -16,7 +16,7 @@ trait AssignPresenterReqMsgHdlr {
val headerUnassign = BbbClientMsgHeader(PresenterUnassignedEvtMsg.NAME, this.liveMeeting.props.meetingProp.intId,
oldPres.intId)
val bodyUnassign = PresenterUnassignedEvtMsgBody(oldPres.intId, oldPres.name, msg.body.assignedBy) // TODO make sure assignedBy is a userID
val bodyUnassign = PresenterUnassignedEvtMsgBody(oldPres.intId, oldPres.name, msg.body.assignedBy)
val eventUnassign = PresenterUnassignedEvtMsg(headerUnassign, bodyUnassign)
val msgEventUnassign = BbbCommonEnvCoreMsg(envelopeUnassign, eventUnassign)
outGW.send(msgEventUnassign)
@ -28,7 +28,7 @@ trait AssignPresenterReqMsgHdlr {
val headerAssign = BbbClientMsgHeader(PresenterAssignedEvtMsg.NAME, this.liveMeeting.props.meetingProp.intId,
newPres.intId)
val bodyAssign = PresenterAssignedEvtMsgBody(newPres.intId, newPres.name, msg.body.assignedBy) // TODO make sure assignedBy is a userID
val bodyAssign = PresenterAssignedEvtMsgBody(newPres.intId, newPres.name, msg.body.assignedBy)
val eventAssign = PresenterAssignedEvtMsg(headerAssign, bodyAssign)
val msgEventAssign = BbbCommonEnvCoreMsg(envelopeAssign, eventAssign)
outGW.send(msgEventAssign)

View File

@ -0,0 +1,50 @@
package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
import org.bigbluebutton.core2.message.senders.MsgBuilder
trait EjectUserFromMeetingCmdMsgHdlr {
this: BaseMeetingActor =>
val liveMeeting: LiveMeeting
val outGW: OutMessageGateway
def handleEjectUserFromMeetingCmdMsg(msg: EjectUserFromMeetingCmdMsg) {
for {
user <- Users2x.ejectFromMeeting(liveMeeting.users2x, msg.body.userId)
} yield {
RegisteredUsers.remove(msg.body.userId, liveMeeting.registeredUsers)
// send a message to client
val ejectFromMeetingClientEvent = MsgBuilder.buildUserEjectedFromMeetingEvtMsg(liveMeeting.props.meetingProp.intId,
user.intId, msg.body.ejectedBy)
outGW.send(ejectFromMeetingClientEvent)
log.info("Ejecting user from meeting (client msg). meetingId=" + liveMeeting.props.meetingProp.intId +
" userId=" + msg.body.userId)
// send a system message to force disconnection
val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg(liveMeeting.props.meetingProp.intId, user.intId)
outGW.send(ejectFromMeetingSystemEvent)
log.info("Ejecting user from meeting (system msg). meetingId=" + liveMeeting.props.meetingProp.intId +
" userId=" + msg.body.userId)
// send a user left event for the clients to update
val userLeftMeetingEvent = MsgBuilder.buildUserLeftMeetingEvtMsg(liveMeeting.props.meetingProp.intId, user.intId)
outGW.send(userLeftMeetingEvent)
log.info("User left meetingId=" + liveMeeting.props.meetingProp.intId + " userId=" + msg.body.userId)
for {
vu <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId)
} yield {
val ejectFromVoiceEvent = MsgBuilder.buildEjectUserFromVoiceConfSysMsg(liveMeeting.props.meetingProp.intId,
liveMeeting.props.voiceProp.voiceConf, vu.voiceUserId)
outGW.send(ejectFromVoiceEvent)
log.info("Ejecting user from voice. meetingId=" + liveMeeting.props.meetingProp.intId + " userId=" + vu.intId)
}
}
}
}

View File

@ -1,26 +0,0 @@
package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs.EjectUserFromMeetingCmdMsg
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
trait EjectUserFromMeetingHdlr {
this: BaseMeetingActor =>
val liveMeeting: LiveMeeting
val outGW: OutMessageGateway
def handleEjectUserFromMeetingCmdMsg(msg: EjectUserFromMeetingCmdMsg) {
for {
user <- Users2x.ejectFromMeeting(liveMeeting.users2x, msg.body.userId)
regUser <- RegisteredUsers.remove(msg.body.userId, liveMeeting.registeredUsers)
vu <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId)
} yield {
log.info("Ejecting user from meeting. meetingId=" + liveMeeting.props.meetingProp.intId + " userId=" + msg.body.userId)
}
}
}

View File

@ -4,6 +4,7 @@ import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Users2x
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.message.senders.MsgBuilder
trait UserLeaveReqMsgHdlr {
this: MeetingActor =>
@ -19,17 +20,12 @@ trait UserLeaveReqMsgHdlr {
captionApp2x.handleUserLeavingMsg(msg.body.userId)
liveMeeting.startCheckingIfWeNeedToEndVoiceConf()
stopAutoStartedRecording()
sendUserLeftMeetingEvtMsg(outGW, props.meetingProp.intId, msg.body.userId)
// send a user left event for the clients to update
val userLeftMeetingEvent = MsgBuilder.buildUserLeftMeetingEvtMsg(liveMeeting.props.meetingProp.intId, u.intId)
outGW.send(userLeftMeetingEvent)
log.info("User left meetingId=" + liveMeeting.props.meetingProp.intId + " userId=" + msg.body.userId)
}
}
def sendUserLeftMeetingEvtMsg(outGW: OutMessageGateway, meetingId: String, userId: String): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId)
val envelope = BbbCoreEnvelope(UserLeftMeetingEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UserLeftMeetingEvtMsg.NAME, meetingId, userId)
val body = UserLeftMeetingEvtMsgBody(userId)
val event = UserLeftMeetingEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
}
}

View File

@ -14,7 +14,7 @@ trait UsersApp2x
with SetRecordingStatusCmdMsgHdlr
with GetRecordingStatusReqMsgHdlr
with AssignPresenterReqMsgHdlr
with EjectUserFromMeetingHdlr
with EjectUserFromMeetingCmdMsgHdlr
with ChangeUserEmojiCmdMsgHdlr {
this: MeetingActor =>

View File

@ -17,13 +17,13 @@ trait UserMutedInVoiceConfEvtMsgHdlr {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId,
vu.intId)
val envelope = BbbCoreEnvelope(UserMutedToClientEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UserMutedToClientEvtMsg.NAME,
val envelope = BbbCoreEnvelope(UserMutedVoiceEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UserMutedVoiceEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, vu.intId)
val body = UserMutedToClientEvtMsgBody(intId = vu.intId, voiceUserId = vu.intId, vu.muted)
val body = UserMutedVoiceEvtMsgBody(intId = vu.intId, voiceUserId = vu.intId, vu.muted)
val event = UserMutedToClientEvtMsg(header, body)
val event = UserMutedVoiceEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
}

View File

@ -17,13 +17,13 @@ trait UserTalkingInVoiceConfEvtMsgHdlr {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId,
vu.intId)
val envelope = BbbCoreEnvelope(UserTalkingToClientEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UserTalkingToClientEvtMsg.NAME,
val envelope = BbbCoreEnvelope(UserTalkingVoiceEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UserTalkingVoiceEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, vu.intId)
val body = UserTalkingToClientEvtMsgBody(intId = vu.intId, voiceUserId = vu.intId, vu.talking)
val body = UserTalkingVoiceEvtMsgBody(intId = vu.intId, voiceUserId = vu.intId, vu.talking)
val event = UserTalkingToClientEvtMsg(header, body)
val event = UserTalkingVoiceEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
}

View File

@ -1,39 +0,0 @@
package org.bigbluebutton.core.pubsub.senders
import org.bigbluebutton.core.api._
import org.bigbluebutton.common.messages.DeskShareStartRTMPBroadcastEventMessage
import org.bigbluebutton.common.messages.DeskShareStopRTMPBroadcastEventMessage
import org.bigbluebutton.common.messages.DeskShareNotifyViewersRTMPEventMessage
import org.bigbluebutton.common.messages.DeskShareNotifyASingleViewerEventMessage
import org.bigbluebutton.common.messages.DeskShareHangUpEventMessage
object DeskShareMessageToJsonConverter {
def getDeskShareHangUpToJson(msg: DeskShareHangUp): String = {
val newMsg = new DeskShareHangUpEventMessage(msg.meetingID, msg.fsConferenceName, TimestampGenerator.getCurrentTime.toString())
newMsg.toJson()
}
def getDeskShareNotifyASingleViewerToJson(msg: DeskShareNotifyASingleViewer): String = {
val newMsg = new DeskShareNotifyASingleViewerEventMessage(msg.meetingID, msg.userID,
msg.streamPath, msg.broadcasting, msg.videoWidth, msg.videoHeight, TimestampGenerator.getCurrentTime.toString())
newMsg.toJson()
}
def getDeskShareStartRTMPBroadcastToJson(msg: DeskShareStartRTMPBroadcast): String = {
val newMsg = new DeskShareStartRTMPBroadcastEventMessage(msg.conferenceName, msg.streamPath,
TimestampGenerator.getCurrentTime.toString())
newMsg.toJson()
}
def getDeskShareStopRTMPBroadcastToJson(msg: DeskShareStopRTMPBroadcast): String = {
val newMsg = new DeskShareStopRTMPBroadcastEventMessage(msg.conferenceName, msg.streamPath,
TimestampGenerator.getCurrentTime.toString())
newMsg.toJson()
}
def getDeskShareNotifyViewersRTMPToJson(msg: DeskShareNotifyViewersRTMP): String = {
val newMsg = new DeskShareNotifyViewersRTMPEventMessage(msg.meetingID, msg.streamPath,
msg.broadcasting, msg.videoWidth, msg.videoHeight, TimestampGenerator.getCurrentTime.toString())
newMsg.toJson()
}
}

View File

@ -105,6 +105,8 @@ class ReceivedJsonMsgHandlerActor(
routeGenericMsg[MuteUserCmdMsg](envelope, jsonNode)
case MuteAllExceptPresentersCmdMsg.NAME =>
routeGenericMsg[MuteAllExceptPresentersCmdMsg](envelope, jsonNode)
case EjectUserFromMeetingCmdMsg.NAME =>
routeGenericMsg[EjectUserFromMeetingCmdMsg](envelope, jsonNode)
// Breakout rooms
case BreakoutRoomsListMsg.NAME =>
@ -263,15 +265,15 @@ class ReceivedJsonMsgHandlerActor(
case ChangeLockSettingsInMeetingCmdMsg.NAME =>
routeGenericMsg[ChangeLockSettingsInMeetingCmdMsg](envelope, jsonNode)
// Deskshare
case DeskshareRtmpBroadcastStartedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[DeskshareRtmpBroadcastStartedVoiceConfEvtMsg](envelope, jsonNode)
case DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg](envelope, jsonNode)
case DeskshareStartedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[DeskshareStartedVoiceConfEvtMsg](envelope, jsonNode)
case DeskshareStoppedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[DeskshareStoppedVoiceConfEvtMsg](envelope, jsonNode)
// Screenshare
case ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg](envelope, jsonNode)
case ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg](envelope, jsonNode)
case ScreenshareStartedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[ScreenshareStartedVoiceConfEvtMsg](envelope, jsonNode)
case ScreenshareStoppedVoiceConfEvtMsg.NAME =>
routeVoiceMsg[ScreenshareStoppedVoiceConfEvtMsg](envelope, jsonNode)
case _ =>
log.error("Cannot route envelope name " + envelope.name)

View File

@ -11,7 +11,7 @@ import org.bigbluebutton.core2.MeetingStatus2x
class LiveMeeting(val props: DefaultProps,
val status: MeetingStatus2x,
val deskshareModel: DeskshareModel,
val screenshareModel: ScreenshareModel,
val chatModel: ChatModel,
val layoutModel: LayoutModel,
val layouts: Layouts,

View File

@ -10,7 +10,7 @@ import org.bigbluebutton.core.api._
import org.bigbluebutton.core.apps._
import org.bigbluebutton.core.apps.caption.CaptionApp2x
import org.bigbluebutton.core.apps.chat.ChatApp2x
import org.bigbluebutton.core.apps.deskshare.DeskshareApp2x
import org.bigbluebutton.core.apps.screenshare.ScreenshareApp2x
import org.bigbluebutton.core.apps.presentation.PresentationApp2x
import org.bigbluebutton.core.apps.meeting._
import org.bigbluebutton.core.apps.users.UsersApp2x
@ -89,7 +89,7 @@ class MeetingActor(val props: DefaultProps,
eventBus.subscribe(actorMonitor, props.screenshareProps.screenshareConf)
val presentationApp2x = new PresentationApp2x(liveMeeting, outGW = outGW)
val deskshareApp2x = new DeskshareApp2x(liveMeeting, outGW = outGW)
val screenshareApp2x = new ScreenshareApp2x(liveMeeting, outGW = outGW)
val captionApp2x = new CaptionApp2x(liveMeeting, outGW = outGW)
val sharedNotesApp2x = new SharedNotesApp2x(liveMeeting, outGW = outGW)
val chatApp2x = new ChatApp2x(liveMeeting, outGW = outGW)
@ -122,7 +122,7 @@ class MeetingActor(val props: DefaultProps,
case msg: ExtendMeetingDuration => handleExtendMeetingDuration(msg)
case msg: SendTimeRemainingUpdate => handleSendTimeRemainingUpdate(msg)
// Deskshare
// Screenshare
case msg: DeskShareGetDeskShareInfoRequest => handleDeskShareGetDeskShareInfoRequest(msg)
// Guest
@ -147,6 +147,7 @@ class MeetingActor(val props: DefaultProps,
case m: SetRecordingStatusCmdMsg => handleSetRecordingStatusCmdMsg(m)
case m: GetRecordingStatusReqMsg => handleGetRecordingStatusReqMsg(m)
case m: ChangeUserEmojiCmdMsg => handleChangeUserEmojiCmdMsg(m)
case m: EjectUserFromMeetingCmdMsg => handleEjectUserFromMeetingCmdMsg(m)
// Whiteboard
case m: SendCursorPositionPubMsg => handleSendCursorPositionPubMsg(m)
@ -182,6 +183,11 @@ class MeetingActor(val props: DefaultProps,
case m: UserMutedInVoiceConfEvtMsg => handleUserMutedInVoiceConfEvtMsg(m)
case m: UserTalkingInVoiceConfEvtMsg => handleUserTalkingInVoiceConfEvtMsg(m)
case m: RecordingStartedVoiceConfEvtMsg => handleRecordingStartedVoiceConfEvtMsg(m)
case m: MuteUserCmdMsg => handleMuteUserCmdMsg(m)
case m: MuteAllExceptPresentersCmdMsg => handleMuteAllExceptPresentersCmdMsg(m)
case m: EjectUserFromVoiceCmdMsg => handleEjectUserFromVoiceCmdMsg(m)
case m: IsMeetingMutedReqMsg => handleIsMeetingMutedReqMsg(m)
case m: MuteMeetingCmdMsg => handleMuteMeetingCmdMsg(m)
// Layout
case m: GetCurrentLayoutReqMsg => handleGetCurrentLayoutReqMsg(m)
@ -224,11 +230,11 @@ class MeetingActor(val props: DefaultProps,
case m: SendPrivateMessagePubMsg => chatApp2x.handleSendPrivateMessagePubMsg(m)
case m: ClearPublicChatHistoryPubMsg => chatApp2x.handleClearPublicChatHistoryPubMsg(m)
// Deskshare
case m: DeskshareStartedVoiceConfEvtMsg => deskshareApp2x.handleDeskshareStartedVoiceConfEvtMsg(m)
case m: DeskshareStoppedVoiceConfEvtMsg => deskshareApp2x.handleDeskshareStoppedVoiceConfEvtMsg(m)
case m: DeskshareRtmpBroadcastStartedVoiceConfEvtMsg => deskshareApp2x.handleDeskshareRtmpBroadcastStartedVoiceConfEvtMsg(m)
case m: DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg => deskshareApp2x.handleDeskshareRtmpBroadcastStoppedVoiceConfEvtMsg(m)
// Screenshare
case m: ScreenshareStartedVoiceConfEvtMsg => screenshareApp2x.handleScreenshareStartedVoiceConfEvtMsg(m)
case m: ScreenshareStoppedVoiceConfEvtMsg => screenshareApp2x.handleScreenshareStoppedVoiceConfEvtMsg(m)
case m: ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg => screenshareApp2x.handleScreenshareRtmpBroadcastStartedVoiceConfEvtMsg(m)
case m: ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg => screenshareApp2x.handleScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg(m)
case _ => log.warning("***** Cannot handle " + msg.envelope.name)
}
@ -263,10 +269,10 @@ class MeetingActor(val props: DefaultProps,
def handleDeskShareGetDeskShareInfoRequest(msg: DeskShareGetDeskShareInfoRequest): Unit = {
log.info("handleDeskShareGetDeskShareInfoRequest: " + msg.conferenceName + "isBroadcasting="
+ DeskshareModel.isBroadcastingRTMP(liveMeeting.deskshareModel) + " URL:" +
DeskshareModel.getRTMPBroadcastingUrl(liveMeeting.deskshareModel))
+ ScreenshareModel.isBroadcastingRTMP(liveMeeting.screenshareModel) + " URL:" +
ScreenshareModel.getRTMPBroadcastingUrl(liveMeeting.screenshareModel))
if (DeskshareModel.isBroadcastingRTMP(liveMeeting.deskshareModel)) {
if (ScreenshareModel.isBroadcastingRTMP(liveMeeting.screenshareModel)) {
// if the meeting has an ongoing WebRTC Deskshare session, send a notification
//outGW.send(new DeskShareNotifyASingleViewer(props.meetingProp.intId, msg.requesterID,
// DeskshareModel.getRTMPBroadcastingUrl(liveMeeting.deskshareModel),

View File

@ -33,7 +33,7 @@ class RunningMeeting(val props: DefaultProps, val outGW: OutMessageGateway,
val users2x = new Users2x
val polls2x = new Polls
val guestsWaiting = new GuestsWaiting
val deskshareModel = new DeskshareModel
val deskshareModel = new ScreenshareModel
// meetingModel.setGuestPolicy(props.usersProp.guestPolicy)

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2
import akka.actor.{ Actor, ActorLogging, Props }
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.msgs.{ BbbCommonEnvCoreMsg, SyncGetMeetingInfoRespMsg, SyncGetPresentationInfoRespMsg, SyncGetUsersMeetingRespMsg }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.common2.util.JsonUtil
import org.bigbluebutton.core.MessageSender
@ -25,6 +25,27 @@ class FromAkkaAppsMsgSenderActor(msgSender: MessageSender)
case SyncGetPresentationInfoRespMsg.NAME => msgSender.send(toHTML5RedisChannel, json)
case SyncGetMeetingInfoRespMsg.NAME => msgSender.send(toHTML5RedisChannel, json)
case SyncGetUsersMeetingRespMsg.NAME => msgSender.send(toHTML5RedisChannel, json)
// Sent to FreeSWITCH
case ScreenshareStartRtmpBroadcastVoiceConfMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case ScreenshareStopRtmpBroadcastVoiceConfMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case EjectAllFromVoiceConfMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case GetUsersInVoiceConfSysMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case EjectUserFromVoiceConfSysMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case MuteUserInVoiceConfSysMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case StartRecordingVoiceConfSysMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case StopRecordingVoiceConfSysMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case TransferUserToVoiceConfSysMsg.NAME =>
msgSender.send(toVoiceConfRedisChannel, json)
case _ => msgSender.send(fromAkkaAppsRedisChannel, json)
}
}

View File

@ -11,7 +11,7 @@ trait EjectUserFromVoiceCmdMsgHdlr {
val outGW: OutMessageGateway
def handleEjectUserRequest(msg: EjectUserFromVoiceCmdMsg) {
def handleEjectUserFromVoiceCmdMsg(msg: EjectUserFromVoiceCmdMsg) {
log.info("Received eject user request. meetingId=" + msg.header.meetingId + " userId=" + msg.body.userId)
for {

View File

@ -15,12 +15,13 @@ trait RecordingStartedVoiceConfEvtMsgHdlr {
if (msg.body.recording) {
MeetingStatus2x.setVoiceRecordingFilename(liveMeeting.status, msg.body.stream)
def buildVoiceRecordingStartedEvtMsg(meetingId: String, stream: String, timestamp: String, voiceConf: String): BbbCommonEnvCoreMsg = {
def buildVoiceRecordingStartedEvtMsg(meetingId: String, stream: String, timestamp: String,
voiceConf: String): BbbCommonEnvCoreMsg = {
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(VoiceRecordingStartedEvtMsg.NAME, routing)
val body = VoiceRecordingStartedEvtMsgBody(meetingId, stream, timestamp, voiceConf)
val header = BbbCoreVoiceConfHeader(VoiceRecordingStartedEvtMsg.NAME, meetingId)
val header = BbbClientMsgHeader(VoiceRecordingStartedEvtMsg.NAME, meetingId, "not-used")
val event = VoiceRecordingStartedEvtMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
@ -32,12 +33,13 @@ trait RecordingStartedVoiceConfEvtMsgHdlr {
} else {
MeetingStatus2x.setVoiceRecordingFilename(liveMeeting.status, "")
def buildVoiceRecordingStoppedEvtMsg(meetingId: String, stream: String, timestamp: String, voiceConf: String): BbbCommonEnvCoreMsg = {
def buildVoiceRecordingStoppedEvtMsg(meetingId: String, stream: String, timestamp: String,
voiceConf: String): BbbCommonEnvCoreMsg = {
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(VoiceRecordingStoppedEvtMsg.NAME, routing)
val body = VoiceRecordingStoppedEvtMsgBody(meetingId, stream, timestamp, voiceConf)
val header = BbbCoreVoiceConfHeader(VoiceRecordingStoppedEvtMsg.NAME, meetingId)
val header = BbbClientMsgHeader(VoiceRecordingStoppedEvtMsg.NAME, meetingId, "not-used")
val event = VoiceRecordingStoppedEvtMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)

View File

@ -166,6 +166,37 @@ object MsgBuilder {
BbbCommonEnvCoreMsg(envelope, event)
}
def buildUserEjectedFromMeetingEvtMsg(meetingId: String, userId: String, ejectedBy: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, userId)
val envelope = BbbCoreEnvelope(UserEjectedFromMeetingEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UserEjectedFromMeetingEvtMsg.NAME, meetingId, userId)
val body = UserEjectedFromMeetingEvtMsgBody(userId, ejectedBy)
val event = UserEjectedFromMeetingEvtMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
def buildDisconnectClientSysMsg(meetingId: String, userId: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.SYSTEM, meetingId, userId)
val envelope = BbbCoreEnvelope(DisconnectClientSysMsg.NAME, routing)
val header = BbbCoreHeaderWithMeetingId(DisconnectClientSysMsg.NAME, meetingId)
val body = DisconnectClientSysMsgBody(meetingId, userId)
val event = DisconnectClientSysMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
def buildUserLeftMeetingEvtMsg(meetingId: String, userId: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId)
val envelope = BbbCoreEnvelope(UserLeftMeetingEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UserLeftMeetingEvtMsg.NAME, meetingId, userId)
val body = UserLeftMeetingEvtMsgBody(userId)
val event = UserLeftMeetingEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
BbbCommonEnvCoreMsg(envelope, event)
}
def buildPubSubPongSysRespMsg(system: String, timestamp: Long): BbbCommonEnvCoreMsg = {
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(PubSubPongSysRespMsg.NAME, routing)

View File

@ -51,7 +51,7 @@ class AppsRedisSubscriberActor(msgReceiver: RedisMessageReceiver, jsonMsgBus: In
//log.error(s"SHOULD NOT BE RECEIVING: $message")
if (message.channel == toAkkaAppsRedisChannel || message.channel == fromVoiceConfRedisChannel) {
val receivedJsonMessage = new ReceivedJsonMessage(message.channel, message.data.utf8String)
// log.debug(s"RECEIVED:\n [${receivedJsonMessage.channel}] \n ${receivedJsonMessage.data} \n")
//log.debug(s"RECEIVED:\n [${receivedJsonMessage.channel}] \n ${receivedJsonMessage.data} \n")
jsonMsgBus.publish(IncomingJsonMessage(toAkkaAppsJsonChannel, receivedJsonMessage))
}
}

View File

@ -1,129 +0,0 @@
package org.bigbluebutton.freeswitch.pubsub.receivers;
import org.bigbluebutton.common.messages.EjectAllUsersFromVoiceConfRequestMessage;
import org.bigbluebutton.common.messages.EjectUserFromVoiceConfRequestMessage;
import org.bigbluebutton.common.messages.GetUsersFromVoiceConfRequestMessage;
import org.bigbluebutton.common.messages.MuteUserInVoiceConfRequestMessage;
import org.bigbluebutton.common.messages.StartRecordingVoiceConfRequestMessage;
import org.bigbluebutton.common.messages.StopRecordingVoiceConfRequestMessage;
import org.bigbluebutton.common.messages.TransferUserToVoiceConfRequestMessage;
import org.bigbluebutton.common.messages.DeskShareStartRTMPBroadcastEventMessage;
import org.bigbluebutton.common.messages.DeskShareStopRTMPBroadcastEventMessage;
import org.bigbluebutton.common.messages.DeskShareHangUpEventMessage;
import org.bigbluebutton.freeswitch.voice.freeswitch.FreeswitchApplication;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class RedisMessageReceiver {
public static final String TO_VOICE_CONF_CHANNEL = "bigbluebutton:to-voice-conf";
public static final String TO_VOICE_CONF_PATTERN = TO_VOICE_CONF_CHANNEL + ":*";
public static final String TO_VOICE_CONF_SYSTEM_CHAN = TO_VOICE_CONF_CHANNEL + ":system";
private final FreeswitchApplication fsApp;
public RedisMessageReceiver(FreeswitchApplication fsApp) {
this.fsApp = fsApp;
}
public void handleMessage(String pattern, String channel, String message) {
if (channel.equalsIgnoreCase(TO_VOICE_CONF_SYSTEM_CHAN)) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
switch (messageName) {
case EjectAllUsersFromVoiceConfRequestMessage.EJECT_ALL_VOICE_USERS_REQUEST:
processEjectAllVoiceUsersRequestMessage(message);
break;
case EjectUserFromVoiceConfRequestMessage.EJECT_VOICE_USER_REQUEST:
processEjectVoiceUserRequestMessage(message);
break;
case GetUsersFromVoiceConfRequestMessage.GET_VOICE_USERS_REQUEST:
processGetVoiceUsersRequestMessage(message);
break;
case MuteUserInVoiceConfRequestMessage.MUTE_VOICE_USER_REQUEST:
processMuteVoiceUserRequestMessage(message);
break;
case TransferUserToVoiceConfRequestMessage.TRANSFER_USER_TO_VOICE_CONF_REQUEST:
processTransferUserToVoiceConfRequestMessage(message);
break;
case StartRecordingVoiceConfRequestMessage.START_RECORD_VOICE_CONF_REQUEST:
processStartRecordingVoiceConfRequestMessage(message);
break;
case StopRecordingVoiceConfRequestMessage.STOP_RECORD_VOICE_CONF_REQUEST:
processStopRecordingVoiceConfRequestMessage(message);
break;
case DeskShareStartRTMPBroadcastEventMessage.DESKSHARE_START_RTMP_BROADCAST_MESSAGE:
System.out.println("RedisMessageReceiver got DESKSHARE_START_RTMP_BROADCAST_MESSAGE");
processDeskShareStartRTMPBroadcastEventMessage(message);
break;
case DeskShareStopRTMPBroadcastEventMessage.DESKSHARE_STOP_RTMP_BROADCAST_MESSAGE:
System.out.println("RedisMessageReceiver got DESKSHARE_STOP_RTMP_BROADCAST_MESSAGE");
processDeskShareStopRTMPBroadcastEventMessage(message);
break;
case DeskShareHangUpEventMessage.DESKSHARE_HANG_UP_MESSAGE:
System.out.println("RedisMessageReceiver got DESKSHARE_HANG_UP_MESSAGE");
processDeskShareHangUpEventMessage(message);
break;
}
}
}
}
}
private void processDeskShareStartRTMPBroadcastEventMessage(String json) {
DeskShareStartRTMPBroadcastEventMessage msg = DeskShareStartRTMPBroadcastEventMessage.fromJson(json);
fsApp.deskShareBroadcastRTMP(msg.conferenceName, msg.streamUrl, msg.timestamp, true);
}
private void processDeskShareStopRTMPBroadcastEventMessage(String json) {
DeskShareStopRTMPBroadcastEventMessage msg = DeskShareStopRTMPBroadcastEventMessage.fromJson(json);
fsApp.deskShareBroadcastRTMP(msg.conferenceName, msg.streamUrl, msg.timestamp, false);
}
private void processDeskShareHangUpEventMessage(String json) {
DeskShareHangUpEventMessage msg = DeskShareHangUpEventMessage.fromJson(json);
fsApp.deskShareHangUp(msg.conferenceName, msg.fsConferenceName, msg.timestamp);
}
private void processEjectAllVoiceUsersRequestMessage(String json) {
EjectAllUsersFromVoiceConfRequestMessage msg = EjectAllUsersFromVoiceConfRequestMessage.fromJson(json);
fsApp.ejectAll(msg.voiceConfId);
}
private void processEjectVoiceUserRequestMessage(String json) {
EjectUserFromVoiceConfRequestMessage msg = EjectUserFromVoiceConfRequestMessage.fromJson(json);
fsApp.eject(msg.voiceConfId, msg.voiceUserId);
}
private void processGetVoiceUsersRequestMessage(String json) {
GetUsersFromVoiceConfRequestMessage msg = GetUsersFromVoiceConfRequestMessage.fromJson(json);
fsApp.getAllUsers(msg.voiceConfId);
}
private void processMuteVoiceUserRequestMessage(String json) {
MuteUserInVoiceConfRequestMessage msg = MuteUserInVoiceConfRequestMessage.fromJson(json);
fsApp.muteUser(msg.voiceConfId, msg.voiceUserId, msg.mute);
}
private void processTransferUserToVoiceConfRequestMessage(String json) {
TransferUserToVoiceConfRequestMessage msg = TransferUserToVoiceConfRequestMessage.fromJson(json);
fsApp.transferUserToMeeting(msg.voiceConfId, msg.targetVoiceConfId, msg.voiceUserId);
}
private void processStartRecordingVoiceConfRequestMessage(String json) {
StartRecordingVoiceConfRequestMessage msg = StartRecordingVoiceConfRequestMessage.fromJson(json);
fsApp.startRecording(msg.voiceConfId, msg.meetingId);
}
private void processStopRecordingVoiceConfRequestMessage(String json) {
StopRecordingVoiceConfRequestMessage msg = StopRecordingVoiceConfRequestMessage.fromJson(json);
fsApp.stopRecording(msg.voiceConfId, msg.meetingId, msg.recordStream);
}
}

View File

@ -24,10 +24,10 @@ import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.bigbluebutton.freeswitch.voice.events.DeskShareStartedEvent;
import org.bigbluebutton.freeswitch.voice.events.ScreenshareStartedEvent;
import org.bigbluebutton.freeswitch.voice.events.DeskShareEndedEvent;
import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener;
import org.bigbluebutton.freeswitch.voice.events.DeskShareRTMPBroadcastEvent;
import org.bigbluebutton.freeswitch.voice.events.ScreenshareRTMPBroadcastEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceConferenceEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceUserJoinedEvent;
@ -81,22 +81,22 @@ public class FreeswitchConferenceEventListener implements ConferenceEventListene
VoiceStartRecordingEvent evt = (VoiceStartRecordingEvent) event;
System.out.println("************** FreeswitchConferenceEventListener VoiceStartRecordingEvent recording=[" + evt.startRecord() + "]");
vcs.voiceConfRecordingStarted(evt.getRoom(), evt.getRecordingFilename(), evt.startRecord(), evt.getTimestamp());
} else if (event instanceof DeskShareStartedEvent) {
DeskShareStartedEvent evt = (DeskShareStartedEvent) event;
System.out.println("************** FreeswitchConferenceEventListener DeskShareStartedEvent");
} else if (event instanceof ScreenshareStartedEvent) {
ScreenshareStartedEvent evt = (ScreenshareStartedEvent) event;
System.out.println("************** FreeswitchConferenceEventListener ScreenshareStartedEvent");
vcs.deskShareStarted(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName());
} else if (event instanceof DeskShareEndedEvent) {
DeskShareEndedEvent evt = (DeskShareEndedEvent) event;
System.out.println("************** FreeswitchConferenceEventListener DeskShareEndedEvent");
vcs.deskShareEnded(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName());
} else if (event instanceof DeskShareRTMPBroadcastEvent) {
if (((DeskShareRTMPBroadcastEvent) event).getBroadcast()) {
DeskShareRTMPBroadcastEvent evt = (DeskShareRTMPBroadcastEvent) event;
} else if (event instanceof ScreenshareRTMPBroadcastEvent) {
if (((ScreenshareRTMPBroadcastEvent) event).getBroadcast()) {
ScreenshareRTMPBroadcastEvent evt = (ScreenshareRTMPBroadcastEvent) event;
System.out.println("************** FreeswitchConferenceEventListener DeskShareRTMPBroadcastStartedEvent");
vcs.deskShareRTMPBroadcastStarted(evt.getRoom(), evt.getBroadcastingStreamUrl(),
evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp());
} else {
DeskShareRTMPBroadcastEvent evt = (DeskShareRTMPBroadcastEvent) event;
ScreenshareRTMPBroadcastEvent evt = (ScreenshareRTMPBroadcastEvent) event;
System.out.println("************** FreeswitchConferenceEventListener DeskShareRTMPBroadcastStoppedEvent");
vcs.deskShareRTMPBroadcastStopped(evt.getRoom(), evt.getBroadcastingStreamUrl(),
evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp());

View File

@ -18,7 +18,7 @@
*/
package org.bigbluebutton.freeswitch.voice.events;
public class DeskShareRTMPBroadcastEvent extends VoiceConferenceEvent {
public class ScreenshareRTMPBroadcastEvent extends VoiceConferenceEvent {
private String timestamp;
private boolean broadcast;
@ -26,10 +26,10 @@ public class DeskShareRTMPBroadcastEvent extends VoiceConferenceEvent {
private Integer vw;
private Integer vh;
private final String DESKSHARE_SUFFIX = "-DESKSHARE";
private final String SCREENSHARE_SUFFIX = "-SCREENSHARE";
public DeskShareRTMPBroadcastEvent(String room, boolean broadcast) {
public ScreenshareRTMPBroadcastEvent(String room, boolean broadcast) {
super(room);
this.broadcast = broadcast;
}
@ -56,8 +56,8 @@ public class DeskShareRTMPBroadcastEvent extends VoiceConferenceEvent {
public String getBroadcastingStreamUrl()
{
if (streamUrl.endsWith(DESKSHARE_SUFFIX)) {
streamUrl = streamUrl.replace(DESKSHARE_SUFFIX, "");
if (streamUrl.endsWith(SCREENSHARE_SUFFIX)) {
streamUrl = streamUrl.replace(SCREENSHARE_SUFFIX, "");
}
return streamUrl;
}

View File

@ -18,12 +18,12 @@
*/
package org.bigbluebutton.freeswitch.voice.events;
public class DeskShareStartedEvent extends VoiceConferenceEvent {
public class ScreenshareStartedEvent extends VoiceConferenceEvent {
private final String callerIdNum;
private final String callerIdName;
public DeskShareStartedEvent(String room, String callerIdNum, String callerIdName) {
public ScreenshareStartedEvent(String room, String callerIdNum, String callerIdName) {
super(room);
this.callerIdName = callerIdName;
this.callerIdNum = callerIdNum;

View File

@ -158,7 +158,7 @@ public class ConnectionManager {
}
}
public void broadcastRTMP(DeskShareBroadcastRTMPCommand rtmp) {
public void broadcastRTMP(ScreenshareBroadcastRTMPCommand rtmp) {
Client c = manager.getESLClient();
if (c.canSend()) {
System.out.println("ConnectionManager: send to FS: broadcastRTMP " + rtmp.getCommandArgs());
@ -167,7 +167,7 @@ public class ConnectionManager {
}
}
public void hangUp(DeskShareHangUpCommand huCmd) {
public void hangUp(ScreenshareHangUpCommand huCmd) {
Client c = manager.getESLClient();
if (c.canSend()) {
System.out.println("ConnectionManager: send to FS: hangUp " + huCmd.getCommandArgs());

View File

@ -6,16 +6,8 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener;
import org.bigbluebutton.freeswitch.voice.events.DeskShareEndedEvent;
import org.bigbluebutton.freeswitch.voice.events.DeskShareStartedEvent;
import org.bigbluebutton.freeswitch.voice.events.DeskShareRTMPBroadcastEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceConferenceEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceUserJoinedEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceUserLeftEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceUserMutedEvent;
import org.bigbluebutton.freeswitch.voice.events.VoiceUserTalkingEvent;
import org.bigbluebutton.freeswitch.voice.events.*;
import org.bigbluebutton.freeswitch.voice.events.ScreenshareStartedEvent;
import org.freeswitch.esl.client.IEslEventListener;
import org.freeswitch.esl.client.transport.event.EslEvent;
import org.jboss.netty.channel.ExceptionEvent;
@ -27,7 +19,7 @@ public class ESLEventListener implements IEslEventListener {
private static final String START_RECORDING_EVENT = "start-recording";
private static final String STOP_RECORDING_EVENT = "stop-recording";
private static final String DESKSHARE_CONFERENCE_NAME_SUFFIX = "-DESKSHARE";
private static final String SCREENSHARE_CONFERENCE_NAME_SUFFIX = "-SCREENSHARE";
private final ConferenceEventListener conferenceEventListener;
@ -72,12 +64,12 @@ public class ESLEventListener implements IEslEventListener {
return;
}
// (WebRTC) Deskstop sharing conferences' name is of the form ddddd-DESKSHARE
// (WebRTC) Deskstop sharing conferences' name is of the form ddddd-SCREENSHARE
// Voice conferences' name is of the form ddddd
if (confName.endsWith(DESKSHARE_CONFERENCE_NAME_SUFFIX)) {
if (confName.endsWith(SCREENSHARE_CONFERENCE_NAME_SUFFIX)) {
System.out.println("User joined deskshare conference, user=[" + callerIdName + "], " +
"conf=[" + confName + "] callerId=[" + callerId + "]");
DeskShareStartedEvent dsStart = new DeskShareStartedEvent(confName, callerId, callerIdName);
ScreenshareStartedEvent dsStart = new ScreenshareStartedEvent(confName, callerId, callerIdName);
conferenceEventListener.handleConferenceEvent(dsStart);
} else {
Matcher matcher = CALLERNAME_PATTERN.matcher(callerIdName);
@ -100,9 +92,9 @@ public class ESLEventListener implements IEslEventListener {
String callerId = this.getCallerIdFromEvent(event);
String callerIdName = this.getCallerIdNameFromEvent(event);
// (WebRTC) Deskstop sharing conferences' name is of the form ddddd-DESKSHARE
// (WebRTC) Deskstop sharing conferences' name is of the form ddddd-SCREENSHARE
// Voice conferences' name is of the form ddddd
if (confName.endsWith(DESKSHARE_CONFERENCE_NAME_SUFFIX)) {
if (confName.endsWith(SCREENSHARE_CONFERENCE_NAME_SUFFIX)) {
System.out.println("User left deskshare conference, user=[" + memberId.toString() +
"], " + "conf=[" + confName + "]");
DeskShareEndedEvent dsEnd = new DeskShareEndedEvent(confName, callerId, callerIdName);
@ -174,9 +166,9 @@ public class ESLEventListener implements IEslEventListener {
}
if (action.equals(START_RECORDING_EVENT)) {
if (confName.endsWith(DESKSHARE_CONFERENCE_NAME_SUFFIX)){
if (confName.endsWith(SCREENSHARE_CONFERENCE_NAME_SUFFIX)){
if (isRTMPStream(event)) {
DeskShareRTMPBroadcastEvent rtmp = new DeskShareRTMPBroadcastEvent(confName, true);
ScreenshareRTMPBroadcastEvent rtmp = new ScreenshareRTMPBroadcastEvent(confName, true);
rtmp.setBroadcastingStreamUrl(getStreamUrl(event));
rtmp.setVideoHeight(Integer.parseInt(getBroadcastParameter(event, "vh")));
rtmp.setVideoWidth(Integer.parseInt(getBroadcastParameter(event, "vw")));
@ -196,9 +188,9 @@ public class ESLEventListener implements IEslEventListener {
conferenceEventListener.handleConferenceEvent(sre);
}
} else if (action.equals(STOP_RECORDING_EVENT)) {
if (confName.endsWith(DESKSHARE_CONFERENCE_NAME_SUFFIX)){
if (confName.endsWith(SCREENSHARE_CONFERENCE_NAME_SUFFIX)){
if (isRTMPStream(event)) {
DeskShareRTMPBroadcastEvent rtmp = new DeskShareRTMPBroadcastEvent(confName, false);
ScreenshareRTMPBroadcastEvent rtmp = new ScreenshareRTMPBroadcastEvent(confName, false);
rtmp.setBroadcastingStreamUrl(getStreamUrl(event));
rtmp.setVideoHeight(Integer.parseInt(getBroadcastParameter(event, "vh")));
rtmp.setVideoWidth(Integer.parseInt(getBroadcastParameter(event, "vw")));
@ -229,8 +221,8 @@ public class ESLEventListener implements IEslEventListener {
@Override
public void eventReceived(EslEvent event) {
System.out.println("ESL Event Listener received event=[" + event.getEventName() + "]" +
event.getEventHeaders().toString());
// System.out.println("ESL Event Listener received event=[" + event.getEventName() + "]" +
// event.getEventHeaders().toString());
// if (event.getEventName().equals(FreeswitchHeartbeatMonitor.EVENT_HEARTBEAT)) {
//// setChanged();
// notifyObservers(event);

View File

@ -128,12 +128,13 @@ public class FreeswitchApplication {
}
public void deskShareBroadcastRTMP(String voiceConfId, String streamUrl, String timestamp, Boolean broadcast) {
DeskShareBroadcastRTMPCommand rtmp = new DeskShareBroadcastRTMPCommand(voiceConfId, USER, streamUrl, timestamp, broadcast);
ScreenshareBroadcastRTMPCommand rtmp = new ScreenshareBroadcastRTMPCommand(voiceConfId, USER,
streamUrl, timestamp, broadcast);
queueMessage(rtmp);
}
public void deskShareHangUp(String voiceConfId, String fsConferenceName, String timestamp) {
DeskShareHangUpCommand huCmd = new DeskShareHangUpCommand(voiceConfId, fsConferenceName, USER, timestamp);
ScreenshareHangUpCommand huCmd = new ScreenshareHangUpCommand(voiceConfId, fsConferenceName, USER, timestamp);
queueMessage(huCmd);
}
@ -163,10 +164,10 @@ public class FreeswitchApplication {
manager.tranfer(cmd);
} else if (command instanceof RecordConferenceCommand) {
manager.record((RecordConferenceCommand) command);
} else if (command instanceof DeskShareBroadcastRTMPCommand) {
manager.broadcastRTMP((DeskShareBroadcastRTMPCommand) command);
} else if (command instanceof DeskShareHangUpCommand) {
DeskShareHangUpCommand cmd = (DeskShareHangUpCommand) command;
} else if (command instanceof ScreenshareBroadcastRTMPCommand) {
manager.broadcastRTMP((ScreenshareBroadcastRTMPCommand) command);
} else if (command instanceof ScreenshareHangUpCommand) {
ScreenshareHangUpCommand cmd = (ScreenshareHangUpCommand) command;
manager.hangUp(cmd);
} else if (command instanceof BroadcastConferenceCommand) {
manager.broadcast((BroadcastConferenceCommand) command);

View File

@ -21,14 +21,14 @@ package org.bigbluebutton.freeswitch.voice.freeswitch.actions;
import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener;
import org.freeswitch.esl.client.transport.message.EslMessage;
public class DeskShareBroadcastRTMPCommand extends FreeswitchCommand {
public class ScreenshareBroadcastRTMPCommand extends FreeswitchCommand {
private String broadcastPath;
private boolean broadcast;
private String timestamp;
private final String DESKSHARE_SUFFIX = "-DESKSHARE";
private final String SCREENSHARE_SUFFIX = "-SCREENSHARE";
public DeskShareBroadcastRTMPCommand(String room, String requesterId, String broadcastPath, String timestamp, boolean broadcast){
public ScreenshareBroadcastRTMPCommand(String room, String requesterId, String broadcastPath, String timestamp, boolean broadcast){
super(room, requesterId);
this.broadcastPath = broadcastPath;
this.broadcast = broadcast;
@ -44,8 +44,8 @@ public class DeskShareBroadcastRTMPCommand extends FreeswitchCommand {
}
String room = getRoom();
if (!room.endsWith(DESKSHARE_SUFFIX)) {
room = room + DESKSHARE_SUFFIX;
if (!room.endsWith(SCREENSHARE_SUFFIX)) {
room = room + SCREENSHARE_SUFFIX;
}
return SPACE + room + SPACE + action + SPACE + broadcastPath;
@ -53,6 +53,6 @@ public class DeskShareBroadcastRTMPCommand extends FreeswitchCommand {
public void handleResponse(EslMessage response, ConferenceEventListener eventListener) {
//Test for Known Conference
System.out.println("\nDeskShareBroadcastRTMPCommand\n");
System.out.println("\nScreenshareBroadcastRTMPCommand\n");
}
}

View File

@ -6,12 +6,12 @@ import org.freeswitch.esl.client.transport.message.EslMessage;
/**
* Created by anton on 07/01/16.
*/
public class DeskShareHangUpCommand extends FreeswitchCommand {
public class ScreenshareHangUpCommand extends FreeswitchCommand {
private String timestamp;
private String fsConferenceName;
private final String DESKSHARE_SUFFIX = "-DESKSHARE";
private final String SCREENSHARE_SUFFIX = "-SCREENSHARE";
public DeskShareHangUpCommand(String room, String fsConferenceName, String requesterId, String timestamp){
public ScreenshareHangUpCommand(String room, String fsConferenceName, String requesterId, String timestamp){
super(room, requesterId);
this.timestamp = timestamp;
this.fsConferenceName = fsConferenceName;
@ -22,14 +22,14 @@ public class DeskShareHangUpCommand extends FreeswitchCommand {
public String getCommandArgs() {
String action = "kick all";
if(!fsConferenceName.endsWith(DESKSHARE_SUFFIX)) {
fsConferenceName = fsConferenceName + DESKSHARE_SUFFIX;
if(!fsConferenceName.endsWith(SCREENSHARE_SUFFIX)) {
fsConferenceName = fsConferenceName + SCREENSHARE_SUFFIX;
}
return SPACE + fsConferenceName + SPACE + action;
}
public void handleResponse(EslMessage response, ConferenceEventListener eventListener) {
System.out.println("\nDeskShareHangUpCommand\n");
System.out.println("\nScreenshareHangUpCommand\n");
}
}

View File

@ -21,12 +21,12 @@ package org.bigbluebutton.freeswitch.voice.freeswitch.actions;
import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener;
import org.freeswitch.esl.client.transport.message.EslMessage;
public class DeskShareRecordCommand extends FreeswitchCommand {
public class ScreenshareRecordCommand extends FreeswitchCommand {
private String recordPath;
private boolean record;
public DeskShareRecordCommand(String room, String requesterId, boolean record, String recordPath){
public ScreenshareRecordCommand(String room, String requesterId, boolean record, String recordPath){
super(room, requesterId);
this.recordPath = recordPath;
this.record = record;
@ -39,7 +39,7 @@ public class DeskShareRecordCommand extends FreeswitchCommand {
if (record)
action = "record";
System.out.println("\n\n\n\n\n DESKSHARE RECORD " + record + "\n\n\n\n");
System.out.println("\n\n\n\n\n SCREENSHARE RECORD " + record + "\n\n\n\n");
return SPACE + getRoom() + SPACE + action + SPACE + recordPath;
}

View File

@ -7,7 +7,6 @@ import org.bigbluebutton.freeswitch.{ RxJsonMsgHdlrActor, VoiceConferenceService
import org.bigbluebutton.freeswitch.bus.InsonMsgBus
import org.bigbluebutton.freeswitch.voice.FreeswitchConferenceEventListener
import org.bigbluebutton.freeswitch.voice.freeswitch.{ ConnectionManager, ESLEventListener, FreeswitchApplication }
import org.bigbluebutton.freeswitch.pubsub.receivers.RedisMessageReceiver
import org.freeswitch.esl.client.manager.DefaultManagerConnection
object Boot extends App with SystemConfiguration {
@ -31,12 +30,10 @@ object Boot extends App with SystemConfiguration {
val fsApplication = new FreeswitchApplication(connManager, fsProfile)
fsApplication.start()
val redisMsgReceiver = new RedisMessageReceiver(fsApplication)
val inJsonMsgBus = new InsonMsgBus
val redisMessageHandlerActor = system.actorOf(RxJsonMsgHdlrActor.props(fsApplication))
inJsonMsgBus.subscribe(redisMessageHandlerActor, toFsAppsJsonChannel)
val redisSubscriberActor = system.actorOf(AppsRedisSubscriberActor.props(system, redisMsgReceiver, inJsonMsgBus), "redis-subscriber")
val redisSubscriberActor = system.actorOf(AppsRedisSubscriberActor.props(system, inJsonMsgBus), "redis-subscriber")
}

View File

@ -7,7 +7,6 @@ import java.net.InetSocketAddress
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.DurationInt
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.freeswitch.pubsub.receivers.RedisMessageReceiver
import akka.actor.ActorSystem
import akka.actor.OneForOneStrategy
import akka.actor.Props
@ -20,16 +19,16 @@ import redis.api.servers.ClientSetname
object AppsRedisSubscriberActor extends SystemConfiguration {
val channels = Seq("time")
val channels = Seq(toVoiceConfRedisChannel)
val patterns = Seq("bigbluebutton:to-voice-conf:*", "bigbluebutton:from-bbb-apps:*")
def props(system: ActorSystem, msgReceiver: RedisMessageReceiver, inJsonMgBus: InsonMsgBus): Props =
Props(classOf[AppsRedisSubscriberActor], system, msgReceiver, inJsonMgBus,
def props(system: ActorSystem, inJsonMgBus: InsonMsgBus): Props =
Props(classOf[AppsRedisSubscriberActor], system, inJsonMgBus,
redisHost, redisPort,
channels, patterns).withDispatcher("akka.rediscala-subscriber-worker-dispatcher")
}
class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessageReceiver,
class AppsRedisSubscriberActor(val system: ActorSystem,
inJsonMgBus: InsonMsgBus, redisHost: String,
redisPort: Int,
channels: Seq[String] = Nil, patterns: Seq[String] = Nil)
@ -64,7 +63,6 @@ class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessag
}
def onMessage(message: Message) {
log.debug(s"message received: $message")
if (message.channel == toVoiceConfRedisChannel) {
val receivedJsonMessage = new ReceivedJsonMsg(message.channel, message.data.utf8String)
log.debug(s"RECEIVED:\n [${receivedJsonMessage.channel}] \n ${receivedJsonMessage.data} \n")
@ -74,8 +72,6 @@ class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessag
def onPMessage(pmessage: PMessage) {
// log.debug(s"pattern message received: $pmessage")
msgReceiver.handleMessage(pmessage.patternMatched, pmessage.channel, pmessage.data.utf8String)
}
def handleMessage(msg: String) {

View File

@ -9,6 +9,60 @@ trait RxJsonMsgDeserializer {
object JsonDeserializer extends Deserializer
def routeDeskshareStartRtmpBroadcastVoiceConfMsg(envelope: BbbCoreEnvelope, jsonNode: JsonNode): Unit = {
def deserialize(jsonNode: JsonNode): Option[ScreenshareStartRtmpBroadcastVoiceConfMsg] = {
val (result, error) = JsonDeserializer.toBbbCommonMsg[ScreenshareStartRtmpBroadcastVoiceConfMsg](jsonNode)
result match {
case Some(msg) => Some(msg.asInstanceOf[ScreenshareStartRtmpBroadcastVoiceConfMsg])
case None =>
log.error("Failed to deserialize message: error: {} \n msg: {}", error, jsonNode)
None
}
}
for {
m <- deserialize(jsonNode)
} yield {
fsApp.deskShareBroadcastRTMP(m.body.screenshareConf, m.body.url, m.body.timestamp, true)
}
}
def routeDeskshareStopRtmpBroadcastVoiceConfMsg(envelope: BbbCoreEnvelope, jsonNode: JsonNode): Unit = {
def deserialize(jsonNode: JsonNode): Option[ScreenshareStopRtmpBroadcastVoiceConfMsg] = {
val (result, error) = JsonDeserializer.toBbbCommonMsg[ScreenshareStopRtmpBroadcastVoiceConfMsg](jsonNode)
result match {
case Some(msg) => Some(msg.asInstanceOf[ScreenshareStopRtmpBroadcastVoiceConfMsg])
case None =>
log.error("Failed to deserialize message: error: {} \n msg: {}", error, jsonNode)
None
}
}
for {
m <- deserialize(jsonNode)
} yield {
fsApp.deskShareBroadcastRTMP(m.body.screenshareConf, m.body.url, m.body.timestamp, false)
}
}
def routeGetUsersInVoiceConfSysMsg(envelope: BbbCoreEnvelope, jsonNode: JsonNode): Unit = {
def deserialize(jsonNode: JsonNode): Option[GetUsersInVoiceConfSysMsg] = {
val (result, error) = JsonDeserializer.toBbbCommonMsg[GetUsersInVoiceConfSysMsg](jsonNode)
result match {
case Some(msg) => Some(msg.asInstanceOf[GetUsersInVoiceConfSysMsg])
case None =>
log.error("Failed to deserialize message: error: {} \n msg: {}", error, jsonNode)
None
}
}
for {
m <- deserialize(jsonNode)
} yield {
fsApp.getAllUsers(m.body.voiceConf)
}
}
def routeEjectAllFromVoiceConfMsg(envelope: BbbCoreEnvelope, jsonNode: JsonNode): Unit = {
def deserialize(jsonNode: JsonNode): Option[EjectAllFromVoiceConfMsg] = {
val (result, error) = JsonDeserializer.toBbbCommonMsg[EjectAllFromVoiceConfMsg](jsonNode)
@ -59,7 +113,7 @@ trait RxJsonMsgDeserializer {
for {
m <- deserialize(jsonNode)
} yield {
fsApp.eject(m.body.voiceConf, m.body.voiceUserId)
fsApp.muteUser(m.body.voiceConf, m.body.voiceUserId, m.body.mute)
}
}

View File

@ -30,6 +30,8 @@ class RxJsonMsgHdlrActor(val fsApp: FreeswitchApplication) extends Actor with Ac
def handle(envelope: BbbCoreEnvelope, jsonNode: JsonNode): Unit = {
log.debug("Route envelope name " + envelope.name)
envelope.name match {
case GetUsersInVoiceConfSysMsg.NAME =>
routeGetUsersInVoiceConfSysMsg(envelope, jsonNode)
case EjectAllFromVoiceConfMsg.NAME =>
routeEjectAllFromVoiceConfMsg(envelope, jsonNode)
case EjectUserFromVoiceConfSysMsg.NAME =>
@ -42,6 +44,10 @@ class RxJsonMsgHdlrActor(val fsApp: FreeswitchApplication) extends Actor with Ac
routeStartRecordingVoiceConfMsg(envelope, jsonNode)
case StopRecordingVoiceConfSysMsg.NAME =>
routeStopRecordingVoiceConfMsg(envelope, jsonNode)
case ScreenshareStopRtmpBroadcastVoiceConfMsg.NAME =>
routeDeskshareStopRtmpBroadcastVoiceConfMsg(envelope, jsonNode)
case ScreenshareStartRtmpBroadcastVoiceConfMsg.NAME =>
routeDeskshareStartRtmpBroadcastVoiceConfMsg(envelope, jsonNode)
case _ => // do nothing
}
}

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.freeswitch
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common.messages.{ DeskShareRTMPBroadcastStartedEventMessage, DeskShareRTMPBroadcastStoppedEventMessage, DeskShareStartedEventMessage, DeskShareStoppedEventMessage }
import org.bigbluebutton.freeswitch.voice.IVoiceConferenceService
import org.bigbluebutton.endpoint.redis.RedisPublisher
import org.bigbluebutton.common2.msgs._
@ -94,12 +93,12 @@ class VoiceConferenceService(sender: RedisPublisher) extends IVoiceConferenceSer
def deskShareStarted(voiceConfId: String, callerIdNum: String, callerIdName: String) {
println("******** FreeswitchConferenceService send deskShareStarted to BBB " + voiceConfId)
val header = BbbCoreVoiceConfHeader(DeskshareStartedVoiceConfEvtMsg.NAME, voiceConfId)
val body = DeskshareStartedVoiceConfEvtMsgBody(voiceConf = voiceConfId, deskshareConf = voiceConfId,
val header = BbbCoreVoiceConfHeader(ScreenshareStartedVoiceConfEvtMsg.NAME, voiceConfId)
val body = ScreenshareStartedVoiceConfEvtMsgBody(voiceConf = voiceConfId, screenshareConf = voiceConfId,
callerIdNum = callerIdNum, callerIdName = callerIdName)
val envelope = BbbCoreEnvelope(DeskshareStartedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val envelope = BbbCoreEnvelope(ScreenshareStartedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val msg = new DeskshareStartedVoiceConfEvtMsg(header, body)
val msg = new ScreenshareStartedVoiceConfEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, msg)
val json = JsonUtil.toJson(msgEvent)
@ -109,12 +108,12 @@ class VoiceConferenceService(sender: RedisPublisher) extends IVoiceConferenceSer
def deskShareEnded(voiceConfId: String, callerIdNum: String, callerIdName: String) {
println("******** FreeswitchConferenceService send deskShareStopped to BBB " + voiceConfId)
val header = BbbCoreVoiceConfHeader(DeskshareStoppedVoiceConfEvtMsg.NAME, voiceConfId)
val body = DeskshareStoppedVoiceConfEvtMsgBody(voiceConf = voiceConfId, deskshareConf = voiceConfId,
val header = BbbCoreVoiceConfHeader(ScreenshareStoppedVoiceConfEvtMsg.NAME, voiceConfId)
val body = ScreenshareStoppedVoiceConfEvtMsgBody(voiceConf = voiceConfId, screenshareConf = voiceConfId,
callerIdNum = callerIdNum, callerIdName = callerIdName)
val envelope = BbbCoreEnvelope(DeskshareStoppedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val envelope = BbbCoreEnvelope(ScreenshareStoppedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val msg = new DeskshareStoppedVoiceConfEvtMsg(header, body)
val msg = new ScreenshareStoppedVoiceConfEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, msg)
val json = JsonUtil.toJson(msgEvent)
@ -124,13 +123,13 @@ class VoiceConferenceService(sender: RedisPublisher) extends IVoiceConferenceSer
def deskShareRTMPBroadcastStarted(voiceConfId: String, streamname: String, vw: java.lang.Integer, vh: java.lang.Integer, timestamp: String) {
println("******** FreeswitchConferenceService send deskShareRTMPBroadcastStarted to BBB " + voiceConfId)
val header = BbbCoreVoiceConfHeader(DeskshareRtmpBroadcastStartedVoiceConfEvtMsg.NAME, voiceConfId)
val body = DeskshareRtmpBroadcastStartedVoiceConfEvtMsgBody(voiceConf = voiceConfId, deskshareConf = voiceConfId,
val header = BbbCoreVoiceConfHeader(ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg.NAME, voiceConfId)
val body = ScreenshareRtmpBroadcastStartedVoiceConfEvtMsgBody(voiceConf = voiceConfId, screenshareConf = voiceConfId,
stream = streamname, vidWidth = vw.intValue(), vidHeight = vh.intValue(),
timestamp)
val envelope = BbbCoreEnvelope(DeskshareRtmpBroadcastStartedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val envelope = BbbCoreEnvelope(ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val msg = new DeskshareRtmpBroadcastStartedVoiceConfEvtMsg(header, body)
val msg = new ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, msg)
val json = JsonUtil.toJson(msgEvent)
@ -141,13 +140,13 @@ class VoiceConferenceService(sender: RedisPublisher) extends IVoiceConferenceSer
def deskShareRTMPBroadcastStopped(voiceConfId: String, streamname: String, vw: java.lang.Integer, vh: java.lang.Integer, timestamp: String) {
println("******** FreeswitchConferenceService send deskShareRTMPBroadcastStopped to BBB " + voiceConfId)
val header = BbbCoreVoiceConfHeader(DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg.NAME, voiceConfId)
val body = DeskshareRtmpBroadcastStoppedVoiceConfEvtMsgBody(voiceConf = voiceConfId, deskshareConf = voiceConfId,
val header = BbbCoreVoiceConfHeader(ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg.NAME, voiceConfId)
val body = ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsgBody(voiceConf = voiceConfId, screenshareConf = voiceConfId,
stream = streamname, vidWidth = vw.intValue(), vidHeight = vh.intValue(),
timestamp)
val envelope = BbbCoreEnvelope(DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val envelope = BbbCoreEnvelope(ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg.NAME, Map("voiceConf" -> voiceConfId))
val msg = new DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg(header, body)
val msg = new ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, msg)
val json = JsonUtil.toJson(msgEvent)

View File

@ -1,84 +0,0 @@
package org.bigbluebutton.red5.client;
import java.util.HashMap;
import java.util.Map;
import org.bigbluebutton.common.messages.DeskShareNotifyASingleViewerEventMessage;
import org.bigbluebutton.common.messages.DeskShareNotifyViewersRTMPEventMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class DeskShareMessageSender {
private IConnectionInvokerService service;
public DeskShareMessageSender(IConnectionInvokerService service) {
this.service = service;
}
public void handleDeskShareMessage(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
switch (messageName) {
case DeskShareNotifyViewersRTMPEventMessage.DESK_SHARE_NOTIFY_VIEWERS_RTMP:
DeskShareNotifyViewersRTMPEventMessage rtmp = DeskShareNotifyViewersRTMPEventMessage.fromJson(message);
if (rtmp != null) {
processDeskShareNotifyViewersRTMPEventMessage(rtmp);
}
break;
case DeskShareNotifyASingleViewerEventMessage.DESK_SHARE_NOTIFY_A_SINGLE_VIEWER:
DeskShareNotifyASingleViewerEventMessage singleViewerMsg = DeskShareNotifyASingleViewerEventMessage.fromJson(message);
if (singleViewerMsg != null) {
processDeskShareNotifyASingleViewerEventMessage(singleViewerMsg);
}
}
}
}
}
private void processDeskShareNotifyViewersRTMPEventMessage(DeskShareNotifyViewersRTMPEventMessage msg) {
Map<String, Object> messageInfo = new HashMap<String, Object>();
// split the string streamPath if there are params in the format:
// {channels=2,samplerate=48000,vw=1920,vh=1080,fps=5.00}rtmp://192.168.23.3/video-broadcast/.../..."
String fullPathString = msg.streamPath;
String delims = "[,{}]+";
String[] arr = fullPathString.split(delims);
String rtmpStreamPath = arr[arr.length -1];
messageInfo.put("rtmpUrl", rtmpStreamPath);
messageInfo.put("broadcasting", msg.broadcasting);
messageInfo.put("width", msg.vw);
messageInfo.put("height", msg.vh);
BroadcastClientMessage m = new BroadcastClientMessage(msg.meetingId, "DeskShareRTMPBroadcastNotification", messageInfo);
service.sendMessage(m);
}
private void processDeskShareNotifyASingleViewerEventMessage(DeskShareNotifyASingleViewerEventMessage msg) {
Map<String, Object> messageInfo = new HashMap<String, Object>();
messageInfo.put("rtmpUrl", msg.streamPath);
messageInfo.put("broadcasting", msg.broadcasting);
messageInfo.put("width", msg.vw);
messageInfo.put("height", msg.vh);
String toUserId = msg.userId;
DirectClientMessage receiver = new DirectClientMessage(msg.meetingId, toUserId,
"DeskShareRTMPBroadcastNotification", messageInfo);
service.sendMessage(receiver);
}
}

View File

@ -0,0 +1,17 @@
package org.bigbluebutton.red5.client.messaging;
public class CloseConnectionMsg implements ClientMessage {
public final String meetingId;
public final String connId;
public CloseConnectionMsg(String meetingId, String connId) {
this.meetingId = meetingId;
this.connId = connId;
}
public String getMessageName() {
return "CloseConnectionMsg";
}
}

View File

@ -0,0 +1,15 @@
package org.bigbluebutton.red5.client.messaging;
public class CloseMeetingAllConnectionsMsg implements ClientMessage {
public final String meetingId;
public CloseMeetingAllConnectionsMsg(String meetingId) {
this.meetingId = meetingId;
}
public String getMessageName() {
return "CloseMeetingAllConnectionsMsg";
}
}

View File

@ -1,6 +1,6 @@
package org.bigbluebutton.client
import org.bigbluebutton.red5.client.messaging.{BroadcastToMeetingMsg, DirectToClientMsg, IConnectionInvokerService}
import org.bigbluebutton.red5.client.messaging.{BroadcastToMeetingMsg, DirectToClientMsg, ClientMessage, IConnectionInvokerService}
sealed trait SystemMessage
case class DisconnectConnection(connId: String) extends SystemMessage
@ -18,7 +18,7 @@ class MsgToClientGW(val connInvokerService: IConnectionInvokerService) {
connInvokerService.sendMessage(msg)
}
def handleSystemMessage(msg: SystemMessage): Unit = {
def systemMessage(msg: ClientMessage): Unit = {
connInvokerService.sendMessage(msg)
}
}

View File

@ -1,9 +1,9 @@
package org.bigbluebutton.client
import akka.actor.{Actor, ActorLogging, Props}
import org.bigbluebutton.client.bus.{BroadcastMsgToMeeting, DirectMsgToClient}
import org.bigbluebutton.client.bus._
import org.bigbluebutton.common2.util.JsonUtil
import org.bigbluebutton.red5.client.messaging.{BroadcastToMeetingMsg, DirectToClientMsg}
import org.bigbluebutton.red5.client.messaging._
object MsgToClientJsonActor {
@ -16,6 +16,8 @@ class MsgToClientJsonActor(msgToClientGW: MsgToClientGW) extends Actor with Acto
def receive = {
case msg: BroadcastMsgToMeeting => handleBroadcastMsg(msg)
case msg: DirectMsgToClient => handleDirectMsg(msg)
case msg: DisconnectClientMsg => handleDisconnectClientMsg(msg)
case msg: DisconnectAllMeetingClientsMsg => hsndleDisconnectAllMeetingClientsMsg(msg)
}
@ -39,4 +41,19 @@ class MsgToClientJsonActor(msgToClientGW: MsgToClientGW) extends Actor with Acto
val direct = new DirectToClientMsg(meetingId, connId, msgName, json)
msgToClientGW.directToClient(direct)
}
def handleDisconnectClientMsg(msg: DisconnectClientMsg): Unit = {
println("Received DisconnectClientMsg " + msg)
val meetingId = msg.meetingId
val connId = msg.connId
msgToClientGW.systemMessage(new CloseConnectionMsg(meetingId, connId))
}
def hsndleDisconnectAllMeetingClientsMsg(msg: DisconnectAllMeetingClientsMsg): Unit = {
println("Received DisconnectAllMeetingClientsMsg " + msg)
val meetingId = msg.meetingId
msgToClientGW.systemMessage(new CloseMeetingAllConnectionsMsg(meetingId))
}
}

View File

@ -7,7 +7,8 @@ import org.bigbluebutton.common2.msgs.BbbCommonEnvJsNodeMsg
sealed trait ToConnectionMsg
case class BroadcastMsgToMeeting(meetingId: String, data: BbbCommonEnvJsNodeMsg) extends ToConnectionMsg
case class DirectMsgToClient(meetingId: String, connId: String, data: BbbCommonEnvJsNodeMsg) extends ToConnectionMsg
case class SystemMsgToClient(meetingId: String, connId: String, data: BbbCommonEnvJsNodeMsg) extends ToConnectionMsg
case class DisconnectClientMsg(meetingId: String, connId: String) extends ToConnectionMsg
case class DisconnectAllMeetingClientsMsg(meetingId: String) extends ToConnectionMsg
case class MsgToClientBusMsg(val topic: String, payload: ToConnectionMsg)

View File

@ -3,7 +3,7 @@ package org.bigbluebutton.client.meeting
import akka.actor.{Actor, ActorLogging, Props}
import org.bigbluebutton.client.SystemConfiguration
import org.bigbluebutton.client.bus._
import org.bigbluebutton.common2.msgs.{BbbCommonEnvJsNodeMsg, MessageTypes}
import org.bigbluebutton.common2.msgs.{BbbCommonEnvJsNodeMsg, DisconnectAllClientsSysMsg, MessageTypes}
object MeetingActor {
def props(meetingId: String, msgToAkkaAppsEventBus: MsgToAkkaAppsEventBus,
@ -101,6 +101,11 @@ class MeetingActor(val meetingId: String, msgToAkkaAppsEventBus: MsgToAkkaAppsEv
def handleSystemMessage(msg: BbbCommonEnvJsNodeMsg): Unit = {
// In case we want to handle specific messages. We can do it here.
forwardToUser(msg)
msg.envelope.name match {
case DisconnectAllClientsSysMsg.NAME =>
msgToClientEventBus.publish(MsgToClientBusMsg(toClientChannel, DisconnectAllMeetingClientsMsg(meetingId)))
case _ => forwardToUser(msg)
}
}
}

View File

@ -150,8 +150,10 @@ class UserActor(val userId: String,
for {
conn <- Connections.findActiveConnection(conns)
} yield {
val json = JsonUtil.toJson(msg.core)
msgToClientEventBus.publish(MsgToClientBusMsg(toClientChannel, SystemMsgToClient(meetingId, conn.connId, msg)))
msg.envelope.name match {
case DisconnectClientSysMsg.NAME =>
msgToClientEventBus.publish(MsgToClientBusMsg(toClientChannel, DisconnectClientMsg(meetingId, conn.connId)))
}
}
}
}

View File

@ -1,61 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
/**
* Created by anton on 21/12/15.
*/
public class DeskShareGetInfoRequestMessage {
public static final String GET_DESKTOP_SHARE_GET_INFO_REQUEST = "desktop_share_get_info_request";
public static final String VERSION = "0.0.1";
public final String meetingId;
public final String requesterId;
public final String replyTo;
public DeskShareGetInfoRequestMessage(String meetingId, String requesterId, String replyTo) {
this.meetingId = meetingId;
this.requesterId = requesterId;
this.replyTo = replyTo;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(Constants.MEETING_ID, meetingId);
payload.put(Constants.REQUESTER_ID, requesterId);
payload.put(Constants.REPLY_TO, replyTo);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(GET_DESKTOP_SHARE_GET_INFO_REQUEST, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareGetInfoRequestMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (GET_DESKTOP_SHARE_GET_INFO_REQUEST.equals(messageName)) {
if (payload.has(Constants.MEETING_ID)
&& payload.has(Constants.REPLY_TO)
&& payload.has(Constants.REQUESTER_ID)) {
String id = payload.get(Constants.MEETING_ID).getAsString();
String requesterId = payload.get(Constants.REQUESTER_ID).getAsString();
String replyTo = payload.get(Constants.REPLY_TO).getAsString();
return new DeskShareGetInfoRequestMessage(id, requesterId, replyTo);
}
}
}
}
return null;
}
}

View File

@ -1,68 +0,0 @@
package org.bigbluebutton.common.messages;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.HashMap;
/**
* Created by anton on 07/01/16.
*/
// akka-bbb-apps to akka-bbb-fsesl
public class DeskShareHangUpEventMessage {
public static final String DESKSHARE_HANG_UP_MESSAGE = "deskshare_hang_up_message";
public static final String VERSION = "0.0.1";
public static final String CONFERENCE_NAME = "conference_name";
public static final String FS_CONFERENCE_NAME = "fs_conference_name";
public static final String TIMESTAMP = "timestamp";
public final String conferenceName;
public final String timestamp;
public final String fsConferenceName;
public DeskShareHangUpEventMessage(String conferenceName, String fsConferenceName, String timestamp) {
this.conferenceName = conferenceName;
this.fsConferenceName = fsConferenceName;
this.timestamp = timestamp;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(CONFERENCE_NAME, conferenceName);
payload.put(FS_CONFERENCE_NAME, fsConferenceName);
payload.put(TIMESTAMP, timestamp);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESKSHARE_HANG_UP_MESSAGE, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareHangUpEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_HANG_UP_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME)
&& payload.has(FS_CONFERENCE_NAME)
&& payload.has(TIMESTAMP)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String fsConferenceName = payload.get(FS_CONFERENCE_NAME).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
return new DeskShareHangUpEventMessage(conferenceName, fsConferenceName, timestamp);
}
}
}
}
return null;
}
}

View File

@ -1,93 +0,0 @@
package org.bigbluebutton.common.messages;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.HashMap;
//Message from bbb-akka-apps to bigbluebutton-apps (in red5)
public class DeskShareNotifyASingleViewerEventMessage {
public static final String DESK_SHARE_NOTIFY_A_SINGLE_VIEWER = "desk_share_notify_a_single_viewer";
public static final String VERSION = "0.0.1";
public static final String MEETING_ID = "meeting_id";
public static final String USER_ID = "userid";
public static final String STREAM_PATH = "stream_path";
public static final String BROADCASTING = "broadcasting";
public static final String TIMESTAMP = "timestamp";
public static final String VIDEO_WIDTH = "vw";
public static final String VIDEO_HEIGHT = "vh";
public final String meetingId;
public final String userId;
public final String streamPath;
public final boolean broadcasting;
public final String timestamp;
public final int vw;
public final int vh;
public DeskShareNotifyASingleViewerEventMessage(String meetingId, String userId, String streamPath,
boolean broadcasting, int vw, int vh, String timestamp) {
this.meetingId = meetingId;
this.userId=userId;
this.streamPath = streamPath;
this.broadcasting = broadcasting;
this.timestamp = timestamp;
this.vw = vw;
this.vh = vh;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(MEETING_ID, meetingId);
payload.put(USER_ID, userId);
payload.put(STREAM_PATH, streamPath);
payload.put(BROADCASTING, broadcasting);
payload.put(TIMESTAMP, timestamp);
payload.put(VIDEO_HEIGHT, vh);
payload.put(VIDEO_WIDTH, vw);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESK_SHARE_NOTIFY_A_SINGLE_VIEWER, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareNotifyASingleViewerEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESK_SHARE_NOTIFY_A_SINGLE_VIEWER.equals(messageName)) {
if (payload.has(MEETING_ID)
&& payload.has(USER_ID)
&& payload.has(BROADCASTING)
&& payload.has(TIMESTAMP)
&& payload.has(VIDEO_HEIGHT)
&& payload.has(VIDEO_WIDTH)
&& payload.has(STREAM_PATH)) {
String meetingId = payload.get(MEETING_ID).getAsString();
String userId = payload.get(USER_ID).getAsString();
String streamPath = payload.get(STREAM_PATH).getAsString();
boolean broadcasting = payload.get(BROADCASTING).getAsBoolean();
String timestamp = payload.get(TIMESTAMP).getAsString();
int vh = payload.get(VIDEO_HEIGHT).getAsInt();
int vw = payload.get(VIDEO_WIDTH).getAsInt();
return new DeskShareNotifyASingleViewerEventMessage(meetingId, userId, streamPath,
broadcasting, vw, vh, timestamp);
}
}
}
}
return null;
}
}

View File

@ -1,83 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
//Message from bbb-akka-apps to bbb-apps-red5
public class DeskShareNotifyViewersRTMPEventMessage {
public static final String DESK_SHARE_NOTIFY_VIEWERS_RTMP = "desk_share_notify_viewers_rtmp";
public static final String VERSION = "0.0.1";
public static final String MEETING_ID = "meeting_id";
public static final String STREAM_PATH = "stream_path";
public static final String BROADCASTING = "broadcasting";
public static final String VIDEO_WIDTH = "vw";
public static final String VIDEO_HEIGHT = "vh";
public static final String TIMESTAMP = "timestamp";
public final String meetingId;
public final String streamPath;
public final boolean broadcasting;
public final String timestamp;
public final int vw;
public final int vh;
public DeskShareNotifyViewersRTMPEventMessage(String meetingId, String streamPath,
boolean broadcasting, int vw, int vh, String timestamp) {
this.meetingId = meetingId;
this.streamPath = streamPath;
this.broadcasting = broadcasting;
this.timestamp = timestamp;
this.vw = vw;
this.vh = vh;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(MEETING_ID, meetingId);
payload.put(STREAM_PATH, streamPath);
payload.put(BROADCASTING, broadcasting);
payload.put(TIMESTAMP, timestamp);
payload.put(VIDEO_HEIGHT, vh);
payload.put(VIDEO_WIDTH, vw);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESK_SHARE_NOTIFY_VIEWERS_RTMP, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareNotifyViewersRTMPEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESK_SHARE_NOTIFY_VIEWERS_RTMP.equals(messageName)) {
if (payload.has(MEETING_ID)
&& payload.has(BROADCASTING)
&& payload.has(TIMESTAMP)
&& payload.has(VIDEO_HEIGHT)
&& payload.has(VIDEO_WIDTH)
&& payload.has(STREAM_PATH)) {
String meetingId = payload.get(MEETING_ID).getAsString();
String streamPath = payload.get(STREAM_PATH).getAsString();
boolean broadcasting = payload.get(BROADCASTING).getAsBoolean();
String timestamp = payload.get(TIMESTAMP).getAsString();
int vh = payload.get(VIDEO_HEIGHT).getAsInt();
int vw = payload.get(VIDEO_WIDTH).getAsInt();
return new DeskShareNotifyViewersRTMPEventMessage(meetingId, streamPath, broadcasting, vw, vh, timestamp);
}
}
}
}
return null;
}
}

View File

@ -1,75 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class DeskShareRTMPBroadcastStartedEventMessage {
public static final String DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE = "deskshare_rtmp_broadcast_started_message";
public static final String VERSION = "0.0.1";
public static final String CONFERENCE_NAME = "conference_name";
public static final String STREAMNAME = "streamname";
public static final String TIMESTAMP = "timestamp";
public static final String VIDEO_WIDTH = "vw";
public static final String VIDEO_HEIGHT = "vh";
public final String conferenceName;
public final String streamname;
public final String timestamp;
public final int vw;
public final int vh;
public DeskShareRTMPBroadcastStartedEventMessage(String conferenceName, String streamname, int vw, int vh, String timestamp) {
this.conferenceName = conferenceName;
this.streamname = streamname;
this.timestamp = timestamp;
this.vw = vw;
this.vh = vh;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(CONFERENCE_NAME, conferenceName);
payload.put(STREAMNAME, streamname);
payload.put(TIMESTAMP, timestamp);
payload.put(VIDEO_HEIGHT, vh);
payload.put(VIDEO_WIDTH, vw);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareRTMPBroadcastStartedEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME)
&& payload.has(TIMESTAMP)
&& payload.has(VIDEO_HEIGHT)
&& payload.has(VIDEO_WIDTH)
&& payload.has(STREAMNAME)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String streamname = payload.get(STREAMNAME).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
int vh = payload.get(VIDEO_HEIGHT).getAsInt();
int vw = payload.get(VIDEO_WIDTH).getAsInt();
return new DeskShareRTMPBroadcastStartedEventMessage(conferenceName, streamname, vw, vh, timestamp);
}
}
}
}
return null;
}
}

View File

@ -1,76 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class DeskShareRTMPBroadcastStoppedEventMessage {
public static final String DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE = "deskshare_rtmp_broadcast_stopped_message";
public static final String VERSION = "0.0.1";
public static final String CONFERENCE_NAME = "conference_name";
public static final String STREAMNAME = "streamname";
public static final String TIMESTAMP = "timestamp";
public static final String VIDEO_WIDTH = "vw";
public static final String VIDEO_HEIGHT = "vh";
public final String conferenceName;
public final String streamname;
public final String timestamp;
public final int vw;
public final int vh;
public DeskShareRTMPBroadcastStoppedEventMessage(String conferenceName, String streamname, int vw, int vh, String timestamp) {
this.conferenceName = conferenceName;
this.streamname = streamname;
this.timestamp = timestamp;
this.vw = vw;
this.vh = vh;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(CONFERENCE_NAME, conferenceName);
payload.put(STREAMNAME, streamname);
payload.put(TIMESTAMP, timestamp);
payload.put(VIDEO_HEIGHT, vh);
payload.put(VIDEO_WIDTH, vw);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareRTMPBroadcastStoppedEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME)
&& payload.has(TIMESTAMP)
&& payload.has(VIDEO_HEIGHT)
&& payload.has(VIDEO_WIDTH)
&& payload.has(STREAMNAME)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String streamname = payload.get(STREAMNAME).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
int vh = payload.get(VIDEO_HEIGHT).getAsInt();
int vw = payload.get(VIDEO_WIDTH).getAsInt();
return new DeskShareRTMPBroadcastStoppedEventMessage(conferenceName, streamname, vw, vh, timestamp);
}
}
}
}
return null;
}
}

View File

@ -1,63 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class DeskShareStartRTMPBroadcastEventMessage {
public static final String DESKSHARE_START_RTMP_BROADCAST_MESSAGE = "deskshare_start_rtmp_broadcast_message";
public static final String VERSION = "0.0.1";
public static final String CONFERENCE_NAME = "conference_name";
public static final String STREAMURL = "stream_url";
public static final String TIMESTAMP = "timestamp";
public final String conferenceName;
public final String streamUrl;
public final String timestamp;
public DeskShareStartRTMPBroadcastEventMessage(String conferenceName, String streamUrl, String timestamp) {
this.conferenceName = conferenceName;
this.streamUrl = streamUrl;
this.timestamp = timestamp;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(CONFERENCE_NAME, conferenceName);
payload.put(STREAMURL, streamUrl);
payload.put(TIMESTAMP, timestamp);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESKSHARE_START_RTMP_BROADCAST_MESSAGE, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareStartRTMPBroadcastEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_START_RTMP_BROADCAST_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME)
&& payload.has(TIMESTAMP)
&& payload.has(STREAMURL)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String streamUrl = payload.get(STREAMURL).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
return new DeskShareStartRTMPBroadcastEventMessage(conferenceName, streamUrl, timestamp);
}
}
}
}
return null;
}
}

View File

@ -1,63 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
//Message from FreeSwitch to bbb-akka-apps
public class DeskShareStartedEventMessage {
public static final String DESKSHARE_STARTED_MESSAGE = "deskshare_start_message";
public static final String VERSION = "0.0.1";
public static final String CONFERENCE_NAME = "conference_name";
public static final String CALLER_ID = "caller_id";
public static final String CALLER_ID_NAME = "caller_id_name";
public final String conferenceName;
public final String callerId;
public final String callerIdName;
public DeskShareStartedEventMessage(String conferenceName, String callerId, String callerIdName) {
this.conferenceName = conferenceName;
this.callerId = callerId;
this.callerIdName = callerIdName;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(CONFERENCE_NAME, conferenceName);
payload.put(CALLER_ID_NAME, callerIdName);
payload.put(CALLER_ID, callerId);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESKSHARE_STARTED_MESSAGE, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareStartedEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_STARTED_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME)
&& payload.has(CALLER_ID)
&& payload.has(CALLER_ID_NAME)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String callerId = payload.get(CALLER_ID_NAME).getAsString();
String callerIdName = payload.get(CALLER_ID_NAME).getAsString();
return new DeskShareStartedEventMessage(conferenceName, callerId, callerIdName);
}
}
}
}
return null;
}
}

View File

@ -1,63 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class DeskShareStopRTMPBroadcastEventMessage {
public static final String DESKSHARE_STOP_RTMP_BROADCAST_MESSAGE = "deskshare_stop_rtmp_broadcast_message";
public static final String VERSION = "0.0.1";
public static final String CONFERENCE_NAME = "conference_name";
public static final String STREAMURL = "stream_url";
public static final String TIMESTAMP = "timestamp";
public final String conferenceName;
public final String streamUrl;
public final String timestamp;
public DeskShareStopRTMPBroadcastEventMessage(String conferenceName, String streamUrl, String timestamp) {
this.conferenceName = conferenceName;
this.streamUrl = streamUrl;
this.timestamp = timestamp;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(CONFERENCE_NAME, conferenceName);
payload.put(STREAMURL, streamUrl);
payload.put(TIMESTAMP, timestamp);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESKSHARE_STOP_RTMP_BROADCAST_MESSAGE, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareStopRTMPBroadcastEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_STOP_RTMP_BROADCAST_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME)
&& payload.has(TIMESTAMP)
&& payload.has(STREAMURL)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String streamUrl = payload.get(STREAMURL).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
return new DeskShareStopRTMPBroadcastEventMessage(conferenceName, streamUrl, timestamp);
}
}
}
}
return null;
}
}

View File

@ -1,63 +0,0 @@
package org.bigbluebutton.common.messages;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
//Message from FreeSwitch to bbb-akka-apps
public class DeskShareStoppedEventMessage {
public static final String DESK_SHARE_STOPPED_MESSAGE = "desk_share_stopped_message";
public static final String VERSION = "0.0.1";
public static final String CONFERENCE_NAME = "conference_name";
public static final String CALLER_ID = "caller_id";
public static final String CALLER_ID_NAME = "caller_id_name";
public final String conferenceName;
public final String callerId;
public final String callerIdName;
public DeskShareStoppedEventMessage(String conferenceName, String callerId, String callerIdName) {
this.conferenceName = conferenceName;
this.callerId = callerId;
this.callerIdName = callerIdName;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(CONFERENCE_NAME, conferenceName);
payload.put(CALLER_ID_NAME, callerIdName);
payload.put(CALLER_ID, callerId);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(DESK_SHARE_STOPPED_MESSAGE, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static DeskShareStoppedEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESK_SHARE_STOPPED_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME)
&& payload.has(CALLER_ID)
&& payload.has(CALLER_ID_NAME)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String callerId = payload.get(CALLER_ID_NAME).getAsString();
String callerIdName = payload.get(CALLER_ID_NAME).getAsString();
return new DeskShareStoppedEventMessage(conferenceName, callerId, callerIdName);
}
}
}
}
return null;
}
}

View File

@ -55,6 +55,11 @@ case class DisconnectAllClientsSysMsg(header: BbbCoreHeaderWithMeetingId,
body: DisconnectAllClientsSysMsgBody) extends BbbCoreMsg
case class DisconnectAllClientsSysMsgBody(meetingId: String)
object DisconnectClientSysMsg { val NAME = "DisconnectClientSysMsg"}
case class DisconnectClientSysMsg(header: BbbCoreHeaderWithMeetingId,
body: DisconnectClientSysMsgBody) extends BbbCoreMsg
case class DisconnectClientSysMsgBody(meetingId: String, userId: String)
object EndAndKickAllSysMsg { val NAME = "EndAndKickAllSysMsg"}
case class EndAndKickAllSysMsg(header: BbbCoreHeaderWithMeetingId,
body: EndAndKickAllSysMsgBody) extends BbbCoreMsg

View File

@ -115,6 +115,13 @@ object UserEmojiChangedEvtMsg { val NAME = "UserEmojiChangedEvtMsg" }
case class UserEmojiChangedEvtMsg(header: BbbClientMsgHeader, body: UserEmojiChangedEvtMsgBody) extends BbbCoreMsg
case class UserEmojiChangedEvtMsgBody(userId: String, emoji: String)
/**
* Sent to all clients about a user ejected (kicked) from the meeting
*/
object UserEjectedFromMeetingEvtMsg { val NAME = "UserEjectedFromMeetingEvtMsg" }
case class UserEjectedFromMeetingEvtMsg(header: BbbClientMsgHeader, body: UserEjectedFromMeetingEvtMsgBody) extends StandardMsg
case class UserEjectedFromMeetingEvtMsgBody(userId: String, ejectedBy: String)
object AssignPresenterReqMsg { val NAME = "AssignPresenterReqMsg"}
case class AssignPresenterReqMsg(header: BbbClientMsgHeader, body: AssignPresenterReqMsgBody) extends StandardMsg
case class AssignPresenterReqMsgBody(requesterId: String, newPresenterId: String, newPresenterName: String, assignedBy: String)
@ -127,7 +134,7 @@ case class MeetingActivityResponseCmdMsg(header: BbbClientMsgHeader, body: Meeti
case class MeetingActivityResponseCmdMsgBody(respondedBy: String)
/**
* Sent from client to change the rolr of the user the user in the meeting.
* Sent from client to change the role of the user in the meeting.
*/
object ChangeUserRoleCmdMsg { val NAME = "ChangeUserRoleCmdMsg" }
case class ChangeUserRoleCmdMsg(header: BbbClientMsgHeader, body: ChangeUserRoleCmdMsgBody) extends StandardMsg

View File

@ -7,49 +7,91 @@ trait VoiceStandardMsg extends BbbCoreMsg {
def header: BbbCoreVoiceConfHeader
}
object DeskshareHangUpVoiceConfMsg { val NAME = "DeskshareHangUpVoiceConfMsg" }
case class DeskshareHangUpVoiceConfMsg(header: BbbCoreHeaderWithMeetingId,
body: DeskshareHangUpVoiceConfMsgBody) extends BbbCoreMsg
case class DeskshareHangUpVoiceConfMsgBody(voiceConf: String, deskshareConf: String, timestamp: String)
object ScreenshareHangUpVoiceConfMsg { val NAME = "ScreenshareHangUpVoiceConfMsg" }
case class ScreenshareHangUpVoiceConfMsg(header: BbbCoreHeaderWithMeetingId,
body: ScreenshareHangUpVoiceConfMsgBody) extends BbbCoreMsg
case class ScreenshareHangUpVoiceConfMsgBody(voiceConf: String, screenshareConf: String, timestamp: String)
object DeskshareRtmpBroadcastStartedVoiceConfEvtMsg { val NAME = "DeskshareRtmpBroadcastStartedVoiceConfEvtMsg"}
case class DeskshareRtmpBroadcastStartedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: DeskshareRtmpBroadcastStartedVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class DeskshareRtmpBroadcastStartedVoiceConfEvtMsgBody(voiceConf: String, deskshareConf: String,
/**
* Sent from FS that RTMP stream has started.
*/
object ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg { val NAME = "ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg"}
case class ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: ScreenshareRtmpBroadcastStartedVoiceConfEvtMsgBody)
extends VoiceStandardMsg
case class ScreenshareRtmpBroadcastStartedVoiceConfEvtMsgBody(voiceConf: String, screenshareConf: String,
stream: String, vidWidth: Int, vidHeight: Int,
timestamp: String)
object DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg { val NAME = "DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg"}
case class DeskshareRtmpBroadcastStoppedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: DeskshareRtmpBroadcastStoppedVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class DeskshareRtmpBroadcastStoppedVoiceConfEvtMsgBody(voiceConf: String, deskshareConf: String,
/**
* Sent to clients to notify them of an RTMP stream starting.
*/
object ScreenshareRtmpBroadcastStartedEvtMsg { val NAME = "ScreenshareRtmpBroadcastStartedEvtMsg"}
case class ScreenshareRtmpBroadcastStartedEvtMsg(header: BbbClientMsgHeader,
body: ScreenshareRtmpBroadcastStartedEvtMsgBody)
extends BbbCoreMsg
case class ScreenshareRtmpBroadcastStartedEvtMsgBody(voiceConf: String, screenshareConf: String,
stream: String, vidWidth: Int, vidHeight: Int,
timestamp: String)
/**
* Send by FS that RTMP stream has stopped.
*/
object ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg { val NAME = "ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg"}
case class ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsgBody(voiceConf: String, screenshareConf: String,
stream: String, vidWidth: Int, vidHeight: Int,
timestamp: String)
object DeskshareStartedVoiceConfEvtMsg { val NAME = "DeskshareStartedVoiceConfEvtMsg" }
case class DeskshareStartedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: DeskshareStartedVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class DeskshareStartedVoiceConfEvtMsgBody(voiceConf: String, deskshareConf: String,
/**
* Sent to clients to notify them of an RTMP stream stopping.
*/
object ScreenshareRtmpBroadcastStoppedEvtMsg { val NAME = "ScreenshareRtmpBroadcastStoppedEvtMsg"}
case class ScreenshareRtmpBroadcastStoppedEvtMsg(header: BbbClientMsgHeader,
body: ScreenshareRtmpBroadcastStoppedEvtMsgBody)
extends BbbCoreMsg
case class ScreenshareRtmpBroadcastStoppedEvtMsgBody(voiceConf: String, screenshareConf: String,
stream: String, vidWidth: Int, vidHeight: Int,
timestamp: String)
/**
* Sent by FS that screenshare has started.
*/
object ScreenshareStartedVoiceConfEvtMsg { val NAME = "ScreenshareStartedVoiceConfEvtMsg" }
case class ScreenshareStartedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: ScreenshareStartedVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class ScreenshareStartedVoiceConfEvtMsgBody(voiceConf: String, screenshareConf: String,
callerIdNum: String, callerIdName: String)
object DeskshareStartRtmpBroadcastVoiceConfMsg { val NAME = "DeskshareStartRtmpBroadcastVoiceConfMsg" }
case class DeskshareStartRtmpBroadcastVoiceConfMsg(header: BbbCoreHeaderWithMeetingId,
body: DeskshareStartRtmpBroadcastVoiceConfMsgBody) extends BbbCoreMsg
case class DeskshareStartRtmpBroadcastVoiceConfMsgBody(voiceConf: String, deskshareConf: String, url: String, timestamp: String)
/**
* Sent to FS to broadcast ans RTMP stream to Red5.
*/
object ScreenshareStartRtmpBroadcastVoiceConfMsg { val NAME = "ScreenshareStartRtmpBroadcastVoiceConfMsg" }
case class ScreenshareStartRtmpBroadcastVoiceConfMsg(header: BbbCoreHeaderWithMeetingId,
body: ScreenshareStartRtmpBroadcastVoiceConfMsgBody) extends BbbCoreMsg
case class ScreenshareStartRtmpBroadcastVoiceConfMsgBody(voiceConf: String, screenshareConf: String, url: String, timestamp: String)
object DeskshareStoppedVoiceConfEvtMsg { val NAME = "DeskshareStoppedVoiceConfEvtMsg"}
case class DeskshareStoppedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: DeskshareStoppedVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class DeskshareStoppedVoiceConfEvtMsgBody(voiceConf: String, deskshareConf: String,
/**
* Sent by FS that screenshare has stopped.
*/
object ScreenshareStoppedVoiceConfEvtMsg { val NAME = "ScreenshareStoppedVoiceConfEvtMsg"}
case class ScreenshareStoppedVoiceConfEvtMsg(header: BbbCoreVoiceConfHeader,
body: ScreenshareStoppedVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class ScreenshareStoppedVoiceConfEvtMsgBody(voiceConf: String, screenshareConf: String,
callerIdNum: String, callerIdName: String)
object DeskshareStopRtmpBroadcastVoiceConfMsg { val NAME = "DeskshareStopRtmpBroadcastVoiceConfMsg" }
case class DeskshareStopRtmpBroadcastVoiceConfMsg(header: BbbCoreHeaderWithMeetingId,
body: DeskshareStopRtmpBroadcastVoiceConfMsgBody) extends BbbCoreMsg
case class DeskshareStopRtmpBroadcastVoiceConfMsgBody(voiceConf: String, deskshareConf: String, url: String, timestamp: String)
/**
* Sent to FS to stop broadcasting RTMP stream to Red5.
*/
object ScreenshareStopRtmpBroadcastVoiceConfMsg { val NAME = "ScreenshareStopRtmpBroadcastVoiceConfMsg" }
case class ScreenshareStopRtmpBroadcastVoiceConfMsg(header: BbbCoreHeaderWithMeetingId,
body: ScreenshareStopRtmpBroadcastVoiceConfMsgBody) extends BbbCoreMsg
case class ScreenshareStopRtmpBroadcastVoiceConfMsgBody(voiceConf: String, screenshareConf: String, url: String, timestamp: String)
/**
* Sent to FS to eject all users from the voice conference.
*/
object EjectAllFromVoiceConfMsg { val NAME = "EjectAllFromVoiceConfMsg" }
case class EjectAllFromVoiceConfMsg(header: BbbCoreHeaderWithMeetingId,
body: EjectAllFromVoiceConfMsgBody) extends BbbCoreMsg
@ -204,9 +246,9 @@ case class MeetingMutedEvtMsgBody(muted: Boolean, mutedBy: String)
/**
* Sent to client that user has been muted in the voice conference.
*/
object UserMutedToClientEvtMsg { val NAME = "UserMutedToClientEvtMsg" }
case class UserMutedToClientEvtMsg(header: BbbClientMsgHeader, body: UserMutedToClientEvtMsgBody) extends BbbCoreMsg
case class UserMutedToClientEvtMsgBody(intId: String, voiceUserId: String, muted: Boolean)
object UserMutedVoiceEvtMsg { val NAME = "UserMutedVoiceEvtMsg" }
case class UserMutedVoiceEvtMsg(header: BbbClientMsgHeader, body: UserMutedVoiceEvtMsgBody) extends BbbCoreMsg
case class UserMutedVoiceEvtMsgBody(intId: String, voiceUserId: String, muted: Boolean)
/**
* Received from FS that user has been muted in voice conference.
@ -221,9 +263,9 @@ case class MeetingMutedEvtMsgBody(muted: Boolean, mutedBy: String)
* Sent to client that user is talking in voice conference.
*/
object UserTalkingToClientEvtMsg { val NAME = "UserTalkingToClientEvtMsg" }
case class UserTalkingToClientEvtMsg(header: BbbClientMsgHeader, body: UserTalkingToClientEvtMsgBody) extends BbbCoreMsg
case class UserTalkingToClientEvtMsgBody(intId: String, voiceUserId: String, talking: Boolean)
object UserTalkingVoiceEvtMsg { val NAME = "UserTalkingVoiceEvtMsg" }
case class UserTalkingVoiceEvtMsg(header: BbbClientMsgHeader, body: UserTalkingVoiceEvtMsgBody) extends BbbCoreMsg
case class UserTalkingVoiceEvtMsgBody(intId: String, voiceUserId: String, talking: Boolean)
/**
* Received from FS that user is talking in voice conference.
@ -233,14 +275,19 @@ case class MeetingMutedEvtMsgBody(muted: Boolean, mutedBy: String)
body: UserTalkingInVoiceConfEvtMsgBody) extends VoiceStandardMsg
case class UserTalkingInVoiceConfEvtMsgBody(voiceConf: String, voiceUserId: String, talking: Boolean)
/**
* Sent to clients that voice conf is being recorded.
*/
object VoiceRecordingStartedEvtMsg { val NAME = "VoiceRecordingStartedEvtMsg" }
case class VoiceRecordingStartedEvtMsg(header: BbbCoreVoiceConfHeader,
case class VoiceRecordingStartedEvtMsg(header: BbbClientMsgHeader,
body: VoiceRecordingStartedEvtMsgBody) extends BbbCoreMsg
case class VoiceRecordingStartedEvtMsgBody(meetingId: String, stream: String, timestamp: String, voiceConf: String)
/**
* Sent to clients that voice conf is no longer being recorded.
*/
object VoiceRecordingStoppedEvtMsg { val NAME = "VoiceRecordingStoppedEvtMsg" }
case class VoiceRecordingStoppedEvtMsg(header: BbbCoreVoiceConfHeader,
case class VoiceRecordingStoppedEvtMsg(header: BbbClientMsgHeader,
body: VoiceRecordingStoppedEvtMsgBody) extends BbbCoreMsg
case class VoiceRecordingStoppedEvtMsgBody(meetingId: String, stream: String, timestamp: String, voiceConf: String)

View File

@ -13,7 +13,10 @@ import org.bigbluebutton.presentation.messages._
import scala.concurrent.duration._
class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW) 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")
@ -98,8 +101,9 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW) extends IBb
val usersProp = UsersProp(maxUsers = maxUsers.intValue(), webcamsOnlyForModerator = webcamsOnlyForModerator.booleanValue(),
guestPolicy = guestPolicy)
val metadataProp = MetadataProp(mapAsScalaMap(metadata).toMap)
val screenshareProps = ScreenshareProps(screenshareConf = "FixMe!", red5ScreenshareIp = "fixMe!",
red5ScreenshareApp = "fixMe!")
val screenshareProps = ScreenshareProps(screenshareConf = voiceBridge + screenshareConfSuffix,
red5ScreenshareIp = screenshareRtmpServer,
red5ScreenshareApp = screenshareRtmpBroadcastApp)
val defaultProps = DefaultProps(meetingProp, breakoutProps, durationProps, password, recordProp, welcomeProp, voiceProp,
usersProp, metadataProp, screenshareProps)

View File

@ -112,15 +112,55 @@ public class ConnectionInvokerService implements IConnectionInvokerService {
} else if (message instanceof SharedObjectClientMessage) {
sendSharedObjectMessage((SharedObjectClientMessage) message);
} else if (message instanceof DisconnectClientMessage) {
handlDisconnectClientMessage((DisconnectClientMessage) message);
handleDisconnectClientMessage((DisconnectClientMessage) message);
} else if (message instanceof DisconnectAllClientsMessage) {
handleDisconnectAllClientsMessage((DisconnectAllClientsMessage) message);
} else if (message instanceof DisconnectAllMessage) {
handleDisconnectAllMessage((DisconnectAllMessage) message);
} else if (message instanceof DirectToClientMsg) {
}
// New messages for 2.0
else if (message instanceof DirectToClientMsg) {
handleDirectToClientMsg((DirectToClientMsg) message);
} else if (message instanceof BroadcastToMeetingMsg) {
handleBroadcastToMeetingMsg((BroadcastToMeetingMsg) message);
} else if (message instanceof CloseConnectionMsg) {
handleCloseConnectionMsg((CloseConnectionMsg) message);
} else if (message instanceof CloseMeetingAllConnectionsMsg) {
handleCloseMeetingAllConnectionsMsg((CloseMeetingAllConnectionsMsg) message);
}
}
private void handleCloseConnectionMsg(CloseConnectionMsg msg) {
if (log.isTraceEnabled()) {
log.trace("Handle direct message: " + msg.getMessageName() + " conn=" + msg.connId);
}
IScope meetingScope = getScope(msg.meetingId);
if (meetingScope != null) {
String connId = msg.connId;
IConnection conn = getConnectionWithConnId(meetingScope, connId);
if (conn != null) {
if (conn.isConnected()) {
log.info("Closing conn=[{}] from meeting=[{}]", msg.connId, msg.meetingId);
conn.close();
}
}
}
}
private void handleCloseMeetingAllConnectionsMsg(CloseMeetingAllConnectionsMsg msg) {
IScope meetingScope = getScope(msg.meetingId);
if (meetingScope != null) {
Set<IConnection> conns = meetingScope.getClientConnections();
for (IConnection conn : conns) {
if (conn.isConnected()) {
String connId = (String) conn.getAttribute("INTERNAL_USER_ID");
log.info("Disconnecting client=[{}] from meeting=[{}]", connId, msg.meetingId);
conn.close();
}
}
}
}
@ -256,7 +296,7 @@ public class ConnectionInvokerService implements IConnectionInvokerService {
}
}
private void handlDisconnectClientMessage(DisconnectClientMessage msg) {
private void handleDisconnectClientMessage(DisconnectClientMessage msg) {
IScope meetingScope = getScope(msg.getMeetingId());
if (meetingScope != null) {
String userId = msg.getUserId();

View File

@ -233,11 +233,6 @@ public class MessagePublisher {
sender.send(MessagingConstants.TO_USERS_CHANNEL, msg.toJson());
}
public void requestDeskShareInfo(String meetingID, String requesterID, String replyTo) {
DeskShareGetInfoRequestMessage msg = new DeskShareGetInfoRequestMessage(meetingID, requesterID, replyTo);
sender.send(MessagingConstants.FROM_VOICE_CONF_SYSTEM_CHAN, msg.toJson());
}
public void lockLayout(String meetingID, String setById, boolean lock, boolean viewersOnly, String layout) {
LockLayoutRequestMessage msg = new LockLayoutRequestMessage(meetingID, setById, lock, viewersOnly, layout);
sender.send(MessagingConstants.TO_USERS_CHANNEL, msg.toJson());

View File

@ -6,7 +6,6 @@ import org.bigbluebutton.red5.client.PollingClientMessageSender;
import org.bigbluebutton.red5.client.PresentationClientMessageSender;
import org.bigbluebutton.red5.client.UserClientMessageSender;
import org.bigbluebutton.red5.client.WhiteboardClientMessageSender;
import org.bigbluebutton.red5.client.DeskShareMessageSender;
import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.monitoring.BbbAppsIsKeepAliveHandler;
import org.slf4j.Logger;
@ -18,7 +17,6 @@ public class RedisPubSubMessageHandler implements MessageHandler {
private MeetingClientMessageSender meetingMessageSender;
private PresentationClientMessageSender presentationMessageSender;
private WhiteboardClientMessageSender whiteboardMessageSender;
private DeskShareMessageSender deskShareMessageSender;
//private BbbAppsIsKeepAliveHandler bbbAppsIsKeepAliveHandler;
private PollingClientMessageSender pollingMessageSender;
@ -28,7 +26,6 @@ public class RedisPubSubMessageHandler implements MessageHandler {
meetingMessageSender = new MeetingClientMessageSender(service);
presentationMessageSender = new PresentationClientMessageSender(service);
whiteboardMessageSender = new WhiteboardClientMessageSender(service);
deskShareMessageSender = new DeskShareMessageSender(service);
pollingMessageSender = new PollingClientMessageSender(service);
}
@ -49,8 +46,6 @@ public class RedisPubSubMessageHandler implements MessageHandler {
whiteboardMessageSender.handleWhiteboardMessage(message);
} else if (channel.equalsIgnoreCase(MessagingConstants.FROM_SYSTEM_CHANNEL)) {
//bbbAppsIsKeepAliveHandler.handleKeepAliveMessage(message);
} else if (channel.equalsIgnoreCase(MessagingConstants.FROM_DESK_SHARE_CHANNEL)) {
deskShareMessageSender.handleDeskShareMessage(message);
} else if (channel.equalsIgnoreCase(MessagingConstants.FROM_POLLING_CHANNEL)) {
pollingMessageSender.handlePollMessage(message);
}

View File

@ -42,6 +42,5 @@ public class DesktopSharingService {
String replyTo = meetingID + "/" + requesterID;
System.out.println("\nDESKTOP SHARING SERVICE _ on the way to bbb-core\n");
red5BBBInGw.requestDeskShareInfo(meetingID, requesterID, replyTo);
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties analytics="false" mainApplicationPath="BigBlueButton.mxml" projectUUID="e523e78c-d93e-4765-a6e3-8e9bfcd14e2f" version="11">
<actionScriptProperties analytics="false" mainApplicationPath="BigBlueButton.mxml" projectUUID="d0ee1158-6eb2-478c-9e78-b5aa55d7b59c" version="11">
<compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" useFlashSDK="false" verifyDigests="true" warn="true">
<compilerSourcePath/>
<libraryPath defaultLinkType="0">
@ -13,18 +13,8 @@
</libraryPath>
<sourceAttachmentPath/>
</compiler>
<theme themeIsDefault="false" themeIsSDK="true" themeLocation="${SDK_THEMES_DIR}/frameworks/themes/Halo"/>
<applications>
<application path="BigBlueButtonTest.mxml"/>
<application path="CameraCheck.mxml"/>
<application path="BigBlueButton.mxml"/>
<application path="BigBlueButtonUnitTests.mxml"/>
<application path="MicrophoneCheck.mxml"/>
<application path="WebcamPreviewStandalone.mxml"/>
<application path="org/red5/flash/bwcheck/app/BandwidthDetectionApp.as"/>
<application path="WebcamViewStandalone.mxml"/>
<application path="RTMPConnCheck.mxml"/>
<application path="ScreenshareStandalone.mxml"/>
</applications>
<modules/>
<workers/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>v-bbb-client</name>
<name>z-bbb-client</name>
<comment></comment>
<projects>
</projects>

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@ Verto = function (
onFail = null,
chromeExtension = null) {
voiceBridge += "-DESKSHARE";
voiceBridge += "-SCREENSHARE";
this.cur_call = null;
this.share_call = null;
this.vertoHandle;
@ -346,13 +346,9 @@ Verto.prototype.makeShare = function () {
var screenInfo = null;
if (!!navigator.mozGetUserMedia) {
return this.onFail();
/*screenInfo = {
mozMediaSource: 'window',
mediaSource: 'window',
};
this.doShare(screenInfo);*/
// no screen parameters for FF, just screenShare: true down below
screenInfo = {};
this.doShare(screenInfo);
} else if (!!window.chrome) {
var _this = this;
if (!_this.chromeExtension) {
@ -396,11 +392,6 @@ Verto.prototype.doShare = function (screenConstraints) {
videoParams: screenConstraints,
useVideo: true,
screenShare: true,
useCamera: this.useCamera,
useMic: this.useMic,
useSpeak: 'any',
dedEnc: true,
mirrorInput: false,
tag: this.renderTag,

View File

@ -268,7 +268,7 @@ package org.bigbluebutton.main.model.users
public function assignPresenter(e:RoleChangeEvent):void{
var assignTo:String = e.userid;
var name:String = e.username;
sender.assignPresenter(assignTo, name, LiveMeeting.inst().me.id);
sender.assignPresenter(assignTo, name, UsersUtil.getMyUserID());
}
public function muteUnmuteUser(command:VoiceConfEvent):void {
@ -288,8 +288,8 @@ package org.bigbluebutton.main.model.users
}
public function ejectUser(command:VoiceConfEvent):void {
sender.ejectUser(command.userid);
}
if (this.isModerator()) sender.ejectUserFromVoice(command.userid);
}
//Lock events
public function lockAllUsers(command:LockControlEvent):void {

View File

@ -111,11 +111,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<EventHandlers type="{BBBEvent.ACTIVITY_RESPONSE_EVENT}">
<MethodInvoker generator="{UserService}" method="activityResponse" />
</EventHandlers>
<EventHandlers type="{KickUserEvent.KICK_USER}" >
<MethodInvoker generator="{UserService}" method="kickUser" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{TokenValidEvent.TOKEN_VALID_EVENT}" >
<MethodInvoker generator="{UserService}" method="tokenValidEventHandler" arguments="{event}" />
</EventHandlers>

View File

@ -103,10 +103,10 @@ package org.bigbluebutton.modules.users.services
case "UserLeftVoiceConfToClientEvtMsg":
handleUserLeftVoiceConfToClientEvtMsg(message);
break;
case "UserTalkingEvtMsg":
case "UserTalkingVoiceEvtMsg":
handleUserTalkingEvtMsg(message);
break;
case "UserMutedEvtMsg":
case "UserMutedVoiceEvtMsg":
handleUserMutedEvtMsg(message);
break;
case "GuestsWaitingForApprovalEvtMsg":
@ -173,11 +173,14 @@ package org.bigbluebutton.modules.users.services
case "BreakoutRoomClosedEvtMsg":
handleBreakoutRoomClosed(message);
break;
case "userEjectedFromMeeting":
case "UserEjectedFromMeetingEvtMsg":
handleUserEjectedFromMeeting(message);
break;
case "DeskShareRTMPBroadcastNotification":
handleDeskShareRTMPBroadcastNotification(message);
case "ScreenshareRtmpBroadcastStartedEvtMsg":
handleScreenshareRtmpBroadcastStartedEvtMsg(message);
break;
case "ScreenshareRtmpBroadcastStoppedEvtMsg":
handleScreenshareRtmpBroadcastStoppedEvtMsg(message);
break;
case "get_guest_policy_reply":
handleGetGuestPolicyReply(message);
@ -412,30 +415,48 @@ package org.bigbluebutton.modules.users.services
}
}
private function handleDeskShareRTMPBroadcastNotification(msg:Object):void {
var event:WebRTCViewStreamEvent;
if (msg.broadcasting) {
event = new WebRTCViewStreamEvent(WebRTCViewStreamEvent.START);
} else {
event = new WebRTCViewStreamEvent(WebRTCViewStreamEvent.STOP);
}
event.videoWidth = msg.width;
event.videoHeight = msg.height;
event.rtmp = msg.rtmpUrl;
private function handleScreenshareRtmpBroadcastStartedEvtMsg(msg:Object):void {
var body: Object = msg.body as Object
var stream: String = body.stream as String;
var vidWidth: Number = body.vidWidth as Number;
var vidHeight: Number = body.vidHeight as Number;
var event:WebRTCViewStreamEvent = new WebRTCViewStreamEvent(WebRTCViewStreamEvent.START);
event.videoWidth = vidWidth;
event.videoHeight = vidHeight;
event.rtmp = stream;
dispatcher.dispatchEvent(event);
}
private function handleScreenshareRtmpBroadcastStoppedEvtMsg(msg:Object):void {
var body: Object = msg.body as Object
var stream: String = body.stream as String;
var vidWidth: Number = body.vidWidth as Number;
var vidHeight: Number = body.vidHeight as Number;
var event:WebRTCViewStreamEvent = new WebRTCViewStreamEvent(WebRTCViewStreamEvent.STOP);
event.videoWidth = vidWidth;
event.videoHeight = vidHeight;
event.rtmp = stream;
dispatcher.dispatchEvent(event);
}
private function handleUserEjectedFromMeeting(msg: Object):void {
UsersUtil.setUserEjected();
var logData:Object = UsersUtil.initLogData();
logData.tags = ["users"];
logData.status = "user_ejected";
logData.message = "User ejected from meeting.";
var body: Object = msg.body as Object;
var userId:String = body.userId as String;
LOGGER.info(JSON.stringify(logData));
UsersUtil.setUserEjected();
var logData:Object = UsersUtil.initLogData();
logData.tags = ["users"];
logData.status = "user_ejected";
logData.message = "User ejected from meeting.";
LOGGER.info(JSON.stringify(logData));
}
private function handleUserLocked(msg:Object):void {

View File

@ -39,28 +39,8 @@ package org.bigbluebutton.modules.users.services
import org.bigbluebutton.core.managers.ConnectionManager;
public class MessageSender {
private static const LOGGER:ILogger = getClassLogger(MessageSender);
private static const LOGGER:ILogger = getClassLogger(MessageSender);
public function kickUser(userID:String):void {
var message:Object = new Object();
message["userId"] = userID;
message["ejectedBy"] = UsersUtil.getMyUserID();
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("participants.ejectUserFromMeeting",
function(result:String):void { // On successful result
},
function(status:String):void { // status - On error occurred
var logData:Object = UsersUtil.initLogData();
logData.tags = ["apps"];
logData.userId = userID;
logData.message = "Error occured ejecting user.";
LOGGER.info(JSON.stringify(logData));
},
message
);
}
public function queryForParticipants():void {
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("participants.getParticipants",
@ -360,16 +340,16 @@ package org.bigbluebutton.modules.users.services
function(status:String):void { // status - On error occurred
var logData:Object = UsersUtil.initLogData();
logData.tags = ["apps"];
logData.message = "Error occured muting user.";
logData.message = "Error occurred muting user.";
LOGGER.info(JSON.stringify(logData));
},
JSON.stringify(message)
);
);
}
public function ejectUser(userid:String):void {
public function ejectUserFromVoice(userid:String):void {
var message:Object = {
header: {name: "EjectUserFromMeetingCmdMsg", meetingId: UsersUtil.getInternalMeetingID(),
header: {name: "EjectUserFromVoiceCmdMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()},
body: {userId: userid, ejectedBy: UsersUtil.getMyUserID()}
};
@ -381,14 +361,30 @@ package org.bigbluebutton.modules.users.services
function(status:String):void { // status - On error occurred
var logData:Object = UsersUtil.initLogData();
logData.tags = ["apps"];
logData.message = "Error occured ejecting user.";
logData.message = "Error occurred ejecting user from voice.";
LOGGER.info(JSON.stringify(logData));
},
JSON.stringify(message)
);
}
public function getRoomMuteState():void{
public function kickUser(userID:String):void {
var message:Object = {
header: {name: "EjectUserFromMeetingCmdMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
body: {userId: userID, ejectedBy: UsersUtil.getMyUserID()}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage2x(function(result:String):void { // On successful result
}, function(status:String):void { // status - On error occurred
var logData:Object = UsersUtil.initLogData();
logData.tags = ["apps"];
logData.message = "Error occurred kicking a user - ejecting from meeting.";
LOGGER.info(JSON.stringify(logData));
}, JSON.stringify(message));
}
public function getRoomMuteState():void{
var message:Object = {
header: {name: "IsMeetingMutedReqMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()},

View File

@ -1,171 +0,0 @@
import Users from '/imports/api/2.0/users';
import Meetings from '/imports/api/1.1/meetings';
import { logger } from '/imports/startup/server/logger';
const presenter = {
switchSlide: true,
// poll
subscribePoll: true,
subscribeAnswers: true,
};
// holds the values for whether the moderator user is allowed to perform an action (true)
// or false if not allowed. Some actions have dynamic values depending on the current lock settings
const moderator = {
// audio listen only
joinListenOnly: true,
leaveListenOnly: true,
// join audio with mic cannot be controlled on the server side as it is
// a client side only functionality
// raising/lowering hand
raiseOwnHand: true,
lowerOwnHand: true,
// muting
muteSelf: true,
unmuteSelf: true,
muteOther: true,
unmuteOther: true,
logoutSelf: true,
// subscribing
subscribeUsers: true,
subscribeChat: true,
// chat
chatPublic: true,
chatPrivate: true,
// poll
subscribePoll: true,
subscribeAnswers: false,
// emojis
setEmojiStatus: true,
clearEmojiStatus: true,
// user control
kickUser: true,
setPresenter: true,
// captions
subscribeCaptions: true,
};
// holds the values for whether the viewer user is allowed to perform an action (true)
// or false if not allowed. Some actions have dynamic values depending on the current lock settings
const viewer = function (meetingId, userId) {
let meeting;
let user;
return {
// listen only
joinListenOnly: true,
leaveListenOnly: true,
// join audio with mic cannot be controlled on the server side as it is
// a client side only functionality
// raising/lowering hand
raiseOwnHand: true,
lowerOwnHand: true,
// muting
muteSelf: true,
unmuteSelf:
!((meeting = Meetings.findOne({ meetingId })) != null &&
meeting.roomLockSettings.disableMic) ||
!((user = Users.findOne({ meetingId, userId })) != null &&
user.user.locked),
logoutSelf: true,
// subscribing
subscribeUsers: true,
subscribeChat: true,
// chat
chatPublic: !((meeting = Meetings.findOne({ meetingId })) != null &&
meeting.roomLockSettings.disablePublicChat) ||
!((user = Users.findOne({ meetingId, userId })) != null &&
user.user.locked) ||
(user != null && user.user.presenter),
chatPrivate: !((meeting = Meetings.findOne({ meetingId })) != null &&
meeting.roomLockSettings.disablePrivateChat) ||
!((user = Users.findOne({ meetingId, userId })) != null &&
user.user.locked) ||
(user != null && user.user.presenter),
// poll
subscribePoll: true,
subscribeAnswers: false,
// emojis
setEmojiStatus: true,
clearEmojiStatus: true,
// captions
subscribeCaptions: true,
};
};
// carries out the decision making for actions affecting users. For the list of
// actions and the default value - see 'viewer' and 'moderator' in the beginning of the file
export function isAllowedTo(action, credentials) {
const meetingId = credentials.meetingId;
const userId = credentials.requesterUserId;
const authToken = credentials.requesterToken;
const user = Users.findOne({
meetingId,
userId,
});
const allowedToInitiateRequest = user &&
user.authToken === authToken &&
user.validated &&
user.clientType === 'HTML5' &&
user.user &&
user.user.connection_status === 'online';
const listOfSafeActions = ['logoutSelf'];
const requestIsSafe = listOfSafeActions.includes(action);
if (requestIsSafe) {
logger.info(`permissions: requestIsSafe for ${action} by userId=${userId} allowed`);
return true;
}
if (allowedToInitiateRequest) {
let result = false;
// check role specific actions
if (user.user.role === 'MODERATOR') {
logger.debug('user permissions moderator case');
result = result || moderator[action];
} else if (user.user.role === 'VIEWER') {
logger.debug('user permissions viewer case');
result = result || viewer(meetingId, userId)[action];
}
// check presenter actions
if (user.user.presenter) {
logger.debug('user permissions presenter case');
result = result || presenter[action];
}
logger.debug(`attempt from userId=${userId} to perform:${action}, allowed=${result}`);
return result;
}
logger.error(`FAILED due to permissions:${action} ${JSON.stringify(credentials)}`);
return false;
}

View File

@ -131,10 +131,13 @@ const isChatLocked = (receiverID) => {
const isPublic = receiverID === PUBLIC_CHAT_ID;
const currentUser = getUser(Auth.userID);
const lockSettings = {
const lockSettings = false;
//FIX ME
/*meeting.roomLockSettings || {
disablePublicChat: false,
disablePrivateChat: false,
};
};*/
if (!currentUser.isLocked || currentUser.isPresenter) {
return false;

View File

@ -300,11 +300,17 @@ class UserListItem extends Component {
userNameSub = userNameSub.join(' ');
/* const { disablePrivateChat,
//FIX ME
/*const { disablePrivateChat,
disableCam,
disableMic,
disablePublicChat } = meeting.roomLockSettings;*/
const disablePrivateChat = false;
const disableCam = false;
const disableMic = false;
const disablePublicChat = false; // = meeting.roomLockSettings;
return (
<div className={styles.userName}>
<span className={styles.userNameMain}>

View File

@ -134,7 +134,7 @@ webcamsOnlyForModerator=false
#----------------------------------------------------
# This URL is where the BBB client is accessible. When a user sucessfully
# enters a name and password, she is redirected here to load the client.
bigbluebutton.web.serverURL=http://192.168.211.128
bigbluebutton.web.serverURL=http://192.168.246.131
#----------------------------------------------------
@ -158,7 +158,7 @@ defaultConfigURL=${bigbluebutton.web.serverURL}/client/conf/config.xml
apiVersion=1.1
# Salt which is used by 3rd-party apps to authenticate api calls
securitySalt=7b57554fb27b009345de01664490c4e1
securitySalt=3838376f0c37f3d5eec9975a5ec95d4d
# Directory where we drop the <meeting-id-recorded>.done file
recordStatusDir=/var/bigbluebutton/recording/status/recorded
@ -213,3 +213,13 @@ accessControlAllowOrigin=${bigbluebutton.web.serverURL}
# The lapsus of seconds for polling the BBB Server in order to check if it's down.
# After 5 tries if there isn't response, it will be declared down
checkBBBServerEvery=10
# The Red5 server where FS will publish as RTMP stream
screenshareRtmpServer=192.168.246.131
# The Red5 app that receives the published RTMP stream
screenshareRtmpBroadcastApp=video-broadcast
# The suffix of our verto screenshare conference.
# Convention is {voiceConf}-SCREENSHARE
screenshareConfSuffix=-SCREENSHARE

View File

@ -51,6 +51,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<bean id="bbbWebApiGWApp" class="org.bigbluebutton.api2.BbbWebApiGWApp">
<constructor-arg index="0" ref="oldMessageReceivedGW"/>
<constructor-arg index="1" value="${screenshareRtmpServer}"/>
<constructor-arg index="2" value="${screenshareRtmpBroadcastApp}"/>
<constructor-arg index="3" value="${screenshareConfSuffix}"/>
</bean>
<bean id="redisStorageService" class="org.bigbluebutton.api.messaging.RedisStorageService"