ask akka-apps if allowed to start screenshare
This commit is contained in:
parent
5eccf9297b
commit
f7cb97737d
@ -40,6 +40,7 @@ public interface IBigBlueButtonInGW {
|
|||||||
void userLeft(String meetingID, String userID, String sessionId);
|
void userLeft(String meetingID, String userID, String sessionId);
|
||||||
void userJoin(String meetingID, String userID, String authToken);
|
void userJoin(String meetingID, String userID, String authToken);
|
||||||
void getCurrentPresenter(String meetingID, String requesterID);
|
void getCurrentPresenter(String meetingID, String requesterID);
|
||||||
|
void checkIfAllowedToShareDesktop(String meetingID, String userID);
|
||||||
void assignPresenter(String meetingID, String newPresenterID, String newPresenterName, String assignedBy);
|
void assignPresenter(String meetingID, String newPresenterID, String newPresenterName, String assignedBy);
|
||||||
void setRecordingStatus(String meetingId, String userId, Boolean recording);
|
void setRecordingStatus(String meetingId, String userId, Boolean recording);
|
||||||
void getRecordingStatus(String meetingId, String userId);
|
void getRecordingStatus(String meetingId, String userId);
|
||||||
|
@ -33,6 +33,9 @@ public class UsersMessageReceiver implements MessageHandler{
|
|||||||
case UserLeavingMessage.USER_LEAVING:
|
case UserLeavingMessage.USER_LEAVING:
|
||||||
processUserLeavingMessage(message);
|
processUserLeavingMessage(message);
|
||||||
break;
|
break;
|
||||||
|
case AllowUserToShareDesktopRequest.NAME:
|
||||||
|
processAllowUserToShareDesktopRequest(message);
|
||||||
|
break;
|
||||||
case AssignPresenterRequestMessage.ASSIGN_PRESENTER_REQUEST:
|
case AssignPresenterRequestMessage.ASSIGN_PRESENTER_REQUEST:
|
||||||
processAssignPresenterRequestMessage(message);
|
processAssignPresenterRequestMessage(message);
|
||||||
break;
|
break;
|
||||||
@ -193,7 +196,14 @@ public class UsersMessageReceiver implements MessageHandler{
|
|||||||
bbbInGW.userLeft(ulm.meetingId, ulm.userId, ulm.meetingId);
|
bbbInGW.userLeft(ulm.meetingId, ulm.userId, ulm.meetingId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void processAllowUserToShareDesktopRequest(String message) {
|
||||||
|
AllowUserToShareDesktopRequest msg = AllowUserToShareDesktopRequest.fromJson(message);
|
||||||
|
if (msg != null) {
|
||||||
|
bbbInGW.checkIfAllowedToShareDesktop(msg.meetingId, msg.userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void processAssignPresenterRequestMessage(String message) {
|
private void processAssignPresenterRequestMessage(String message) {
|
||||||
AssignPresenterRequestMessage apm = AssignPresenterRequestMessage.fromJson(message);
|
AssignPresenterRequestMessage apm = AssignPresenterRequestMessage.fromJson(message);
|
||||||
if (apm != null) {
|
if (apm != null) {
|
||||||
|
@ -242,6 +242,11 @@ class BigBlueButtonInGW(
|
|||||||
eventBus.publish(BigBlueButtonEvent(meetingID, new UserJoining(meetingID, userID, authToken)))
|
eventBus.publish(BigBlueButtonEvent(meetingID, new UserJoining(meetingID, userID, authToken)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def checkIfAllowedToShareDesktop(meetingID: String, userID: String): Unit = {
|
||||||
|
eventBus.publish(BigBlueButtonEvent(meetingID, AllowUserToShareDesktop(meetingID: String,
|
||||||
|
userID: String)))
|
||||||
|
}
|
||||||
|
|
||||||
def assignPresenter(meetingID: String, newPresenterID: String, newPresenterName: String, assignedBy: String): Unit = {
|
def assignPresenter(meetingID: String, newPresenterID: String, newPresenterName: String, assignedBy: String): Unit = {
|
||||||
eventBus.publish(BigBlueButtonEvent(meetingID, new AssignPresenter(meetingID, newPresenterID, newPresenterName, assignedBy)))
|
eventBus.publish(BigBlueButtonEvent(meetingID, new AssignPresenter(meetingID, newPresenterID, newPresenterName, assignedBy)))
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,16 @@ class LiveMeeting(val mProps: MeetingProperties,
|
|||||||
outGW.send(new DisconnectAllUsers(msg.meetingId))
|
outGW.send(new DisconnectAllUsers(msg.meetingId))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def handleAllowUserToShareDesktop(msg: AllowUserToShareDesktop): Unit = {
|
||||||
|
usersModel.getCurrentPresenter() match {
|
||||||
|
case Some(curPres) => {
|
||||||
|
val allowed = msg.userID equals (curPres.userID)
|
||||||
|
outGW.send(AllowUserToShareDesktopOut(msg.meetingID, msg.userID, allowed))
|
||||||
|
}
|
||||||
|
case None => // do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def handleVoiceConfRecordingStartedMessage(msg: VoiceConfRecordingStartedMessage) {
|
def handleVoiceConfRecordingStartedMessage(msg: VoiceConfRecordingStartedMessage) {
|
||||||
if (msg.recording) {
|
if (msg.recording) {
|
||||||
meetingModel.setVoiceRecordingFilename(msg.recordStream)
|
meetingModel.setVoiceRecordingFilename(msg.recordStream)
|
||||||
|
@ -105,6 +105,7 @@ class MeetingActor(val mProps: MeetingProperties,
|
|||||||
case msg: UserJoining => liveMeeting.handleUserJoin(msg)
|
case msg: UserJoining => liveMeeting.handleUserJoin(msg)
|
||||||
case msg: UserLeaving => liveMeeting.handleUserLeft(msg)
|
case msg: UserLeaving => liveMeeting.handleUserLeft(msg)
|
||||||
case msg: AssignPresenter => liveMeeting.handleAssignPresenter(msg)
|
case msg: AssignPresenter => liveMeeting.handleAssignPresenter(msg)
|
||||||
|
case msg: AllowUserToShareDesktop => liveMeeting.handleAllowUserToShareDesktop(msg)
|
||||||
case msg: GetUsers => liveMeeting.handleGetUsers(msg)
|
case msg: GetUsers => liveMeeting.handleGetUsers(msg)
|
||||||
case msg: ChangeUserStatus => liveMeeting.handleChangeUserStatus(msg)
|
case msg: ChangeUserStatus => liveMeeting.handleChangeUserStatus(msg)
|
||||||
case msg: EjectUserFromMeeting => liveMeeting.handleEjectUserFromMeeting(msg)
|
case msg: EjectUserFromMeeting => liveMeeting.handleEjectUserFromMeeting(msg)
|
||||||
|
@ -15,7 +15,9 @@ import org.bigbluebutton.core.pubsub.senders.CaptionMessageToJsonConverter
|
|||||||
import org.bigbluebutton.core.pubsub.senders.DeskShareMessageToJsonConverter
|
import org.bigbluebutton.core.pubsub.senders.DeskShareMessageToJsonConverter
|
||||||
import org.bigbluebutton.common.messages.GetPresentationInfoReplyMessage
|
import org.bigbluebutton.common.messages.GetPresentationInfoReplyMessage
|
||||||
import org.bigbluebutton.common.messages.PresentationRemovedMessage
|
import org.bigbluebutton.common.messages.PresentationRemovedMessage
|
||||||
|
import org.bigbluebutton.common.messages.AllowUserToShareDesktopReply
|
||||||
import org.bigbluebutton.core.apps.Page
|
import org.bigbluebutton.core.apps.Page
|
||||||
|
|
||||||
import collection.JavaConverters._
|
import collection.JavaConverters._
|
||||||
import scala.collection.JavaConversions._
|
import scala.collection.JavaConversions._
|
||||||
import org.bigbluebutton.core.apps.SimplePollResultOutVO
|
import org.bigbluebutton.core.apps.SimplePollResultOutVO
|
||||||
@ -31,6 +33,7 @@ import org.bigbluebutton.common.messages.LockLayoutMessage
|
|||||||
import org.bigbluebutton.core.pubsub.senders.WhiteboardMessageToJsonConverter
|
import org.bigbluebutton.core.pubsub.senders.WhiteboardMessageToJsonConverter
|
||||||
import org.bigbluebutton.common.converters.ToJsonEncoder
|
import org.bigbluebutton.common.converters.ToJsonEncoder
|
||||||
import org.bigbluebutton.common.messages.TransferUserToVoiceConfRequestMessage
|
import org.bigbluebutton.common.messages.TransferUserToVoiceConfRequestMessage
|
||||||
|
import org.bigbluebutton.core
|
||||||
|
|
||||||
object MessageSenderActor {
|
object MessageSenderActor {
|
||||||
def props(msgSender: MessageSender): Props =
|
def props(msgSender: MessageSender): Props =
|
||||||
@ -82,6 +85,7 @@ class MessageSenderActor(val service: MessageSender)
|
|||||||
case msg: MeetingMuted => handleMeetingMuted(msg)
|
case msg: MeetingMuted => handleMeetingMuted(msg)
|
||||||
case msg: MeetingState => handleMeetingState(msg)
|
case msg: MeetingState => handleMeetingState(msg)
|
||||||
case msg: DisconnectAllUsers => handleDisconnectAllUsers(msg)
|
case msg: DisconnectAllUsers => handleDisconnectAllUsers(msg)
|
||||||
|
case msg: AllowUserToShareDesktopOut => handleAllowUserToShareDesktopOut(msg)
|
||||||
case msg: DisconnectUser => handleDisconnectUser(msg)
|
case msg: DisconnectUser => handleDisconnectUser(msg)
|
||||||
case msg: PermissionsSettingInitialized => handlePermissionsSettingInitialized(msg)
|
case msg: PermissionsSettingInitialized => handlePermissionsSettingInitialized(msg)
|
||||||
case msg: NewPermissionsSetting => handleNewPermissionsSetting(msg)
|
case msg: NewPermissionsSetting => handleNewPermissionsSetting(msg)
|
||||||
@ -535,6 +539,13 @@ class MessageSenderActor(val service: MessageSender)
|
|||||||
service.send(MessagingConstants.FROM_MEETING_CHANNEL, json)
|
service.send(MessagingConstants.FROM_MEETING_CHANNEL, json)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private def handleAllowUserToShareDesktopOut(msg: AllowUserToShareDesktopOut): Unit = {
|
||||||
|
val obj = new AllowUserToShareDesktopReply(msg.meetingID, msg.userID, msg.allowed,
|
||||||
|
TimestampGenerator.generateTimestamp)
|
||||||
|
val json = obj.toJson()
|
||||||
|
service.send(MessagingConstants.FROM_MEETING_CHANNEL, json)
|
||||||
|
}
|
||||||
|
|
||||||
private def handlePermissionsSettingInitialized(msg: PermissionsSettingInitialized) {
|
private def handlePermissionsSettingInitialized(msg: PermissionsSettingInitialized) {
|
||||||
val json = UsersMessageToJsonConverter.permissionsSettingInitializedToJson(msg)
|
val json = UsersMessageToJsonConverter.permissionsSettingInitializedToJson(msg)
|
||||||
service.send(MessagingConstants.FROM_MEETING_CHANNEL, json)
|
service.send(MessagingConstants.FROM_MEETING_CHANNEL, json)
|
||||||
|
@ -90,6 +90,7 @@ case class ChangeUserStatus(meetingID: String, userID: String, status: String, v
|
|||||||
case class AssignPresenter(meetingID: String, newPresenterID: String, newPresenterName: String, assignedBy: String) extends InMessage
|
case class AssignPresenter(meetingID: String, newPresenterID: String, newPresenterName: String, assignedBy: String) extends InMessage
|
||||||
case class SetRecordingStatus(meetingID: String, userId: String, recording: Boolean) extends InMessage
|
case class SetRecordingStatus(meetingID: String, userId: String, recording: Boolean) extends InMessage
|
||||||
case class GetRecordingStatus(meetingID: String, userId: String) extends InMessage
|
case class GetRecordingStatus(meetingID: String, userId: String) extends InMessage
|
||||||
|
case class AllowUserToShareDesktop(meetingID: String, userID: String) extends InMessage
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
// Chat
|
// Chat
|
||||||
|
@ -73,6 +73,7 @@ case class EjectVoiceUser(meetingID: String, recorded: Boolean, requesterID: Str
|
|||||||
case class TransferUserToMeeting(voiceConfId: String, targetVoiceConfId: String, userId: String) extends IOutMessage
|
case class TransferUserToMeeting(voiceConfId: String, targetVoiceConfId: String, userId: String) extends IOutMessage
|
||||||
case class UserJoinedVoice(meetingID: String, recorded: Boolean, confNum: String, user: UserVO) extends IOutMessage
|
case class UserJoinedVoice(meetingID: String, recorded: Boolean, confNum: String, user: UserVO) extends IOutMessage
|
||||||
case class UserLeftVoice(meetingID: String, recorded: Boolean, confNum: String, user: UserVO) extends IOutMessage
|
case class UserLeftVoice(meetingID: String, recorded: Boolean, confNum: String, user: UserVO) extends IOutMessage
|
||||||
|
case class AllowUserToShareDesktopOut(meetingID: String, userID: String, allowed: Boolean) extends IOutMessage
|
||||||
|
|
||||||
// Voice
|
// Voice
|
||||||
case class IsMeetingMutedReply(meetingID: String, recorded: Boolean, requesterID: String, meetingMuted: Boolean) extends IOutMessage
|
case class IsMeetingMutedReply(meetingID: String, recorded: Boolean, requesterID: String, meetingMuted: Boolean) extends IOutMessage
|
||||||
|
@ -0,0 +1,66 @@
|
|||||||
|
package org.bigbluebutton.common.messages;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
public class AllowUserToShareDesktopReply implements ISubscribedMessage {
|
||||||
|
public static final String NAME = "AllowUserToShareDesktopReply";
|
||||||
|
public static final String VERSION = "0.0.1";
|
||||||
|
|
||||||
|
public static final String TIMESTAMP = "timestamp";
|
||||||
|
public static final String MEETING_ID = "meeting_id";
|
||||||
|
public static final String USER_ID = "user_id";
|
||||||
|
public static final String ALLOWED = "allowed";
|
||||||
|
|
||||||
|
public final Long timestamp;
|
||||||
|
public final String userId;
|
||||||
|
public final String meetingId;
|
||||||
|
public final Boolean allowed;
|
||||||
|
|
||||||
|
public AllowUserToShareDesktopReply(String meetingId, String userId,
|
||||||
|
Boolean allowed, Long timestamp) {
|
||||||
|
this.meetingId = meetingId;
|
||||||
|
this.userId = userId;
|
||||||
|
this.allowed = allowed;
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toJson() {
|
||||||
|
HashMap<String, Object> payload = new HashMap<String, Object>();
|
||||||
|
payload.put(TIMESTAMP, timestamp);
|
||||||
|
payload.put(MEETING_ID, meetingId);
|
||||||
|
payload.put(USER_ID, userId);
|
||||||
|
payload.put(ALLOWED, allowed);
|
||||||
|
|
||||||
|
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(NAME, VERSION, null);
|
||||||
|
return MessageBuilder.buildJson(header, payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AllowUserToShareDesktopReply 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 (NAME.equals(messageName)) {
|
||||||
|
|
||||||
|
if (payload.has(TIMESTAMP) && payload.has(MEETING_ID)
|
||||||
|
&& payload.has(USER_ID) && payload.has(ALLOWED)) {
|
||||||
|
Long timestamp = payload.get(TIMESTAMP).getAsLong();
|
||||||
|
String meetingId = payload.get(MEETING_ID).getAsString();
|
||||||
|
String userId = payload.get(USER_ID).getAsString();
|
||||||
|
Boolean allowed = payload.get(ALLOWED).getAsBoolean();
|
||||||
|
return new AllowUserToShareDesktopReply(meetingId, userId, allowed,
|
||||||
|
timestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -35,7 +35,7 @@ public class MessageReceiver {
|
|||||||
jedis = new Jedis(host, port);
|
jedis = new Jedis(host, port);
|
||||||
// Set the name of this client to be able to distinguish when doing
|
// Set the name of this client to be able to distinguish when doing
|
||||||
// CLIENT LIST on redis-cli
|
// CLIENT LIST on redis-cli
|
||||||
jedis.clientSetname("BbbRed5AppsSub");
|
jedis.clientSetname("bbb-screenshare");
|
||||||
|
|
||||||
Runnable messageReceiver = new Runnable() {
|
Runnable messageReceiver = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -1,75 +1,46 @@
|
|||||||
package org.bigbluebutton.app.screenshare.messaging.redis;
|
package org.bigbluebutton.app.screenshare.messaging.redis;
|
||||||
|
|
||||||
//import org.bigbluebutton.common.messages.MessagingConstants;
|
import com.google.gson.JsonObject;
|
||||||
//import org.bigbluebutton.red5.client.MeetingClientMessageSender;
|
import com.google.gson.JsonParser;
|
||||||
//import org.bigbluebutton.red5.client.PollingClientMessageSender;
|
import org.bigbluebutton.app.screenshare.red5.Red5AppHandler;
|
||||||
//import org.bigbluebutton.red5.client.PresentationClientMessageSender;
|
import org.bigbluebutton.common.messages.AllowUserToShareDesktopReply;
|
||||||
//import org.bigbluebutton.red5.client.UserClientMessageSender;
|
import org.bigbluebutton.common.messages.MessagingConstants;
|
||||||
//import org.bigbluebutton.red5.client.ChatClientMessageSender;
|
|
||||||
//import org.bigbluebutton.red5.client.WhiteboardClientMessageSender;
|
|
||||||
//import org.bigbluebutton.red5.client.CaptionClientMessageSender;
|
|
||||||
//import org.bigbluebutton.red5.client.DeskShareMessageSender;
|
|
||||||
//import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService;
|
|
||||||
//import org.bigbluebutton.red5.monitoring.BbbAppsIsKeepAliveHandler;
|
|
||||||
import org.red5.logging.Red5LoggerFactory;
|
import org.red5.logging.Red5LoggerFactory;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
public class RedisPubSubMessageHandler implements MessageHandler {
|
public class RedisPubSubMessageHandler implements MessageHandler {
|
||||||
private static Logger log = Red5LoggerFactory.getLogger(RedisPubSubMessageHandler.class, "bigbluebutton");
|
private static Logger log = Red5LoggerFactory.getLogger(RedisPubSubMessageHandler.class,
|
||||||
|
"screenshare");
|
||||||
|
private Red5AppHandler handler;
|
||||||
|
|
||||||
// private ConnectionInvokerService service;
|
|
||||||
// private UserClientMessageSender userMessageSender;
|
|
||||||
// private MeetingClientMessageSender meetingMessageSender;
|
|
||||||
// private ChatClientMessageSender chatMessageSender;
|
|
||||||
// private PresentationClientMessageSender presentationMessageSender;
|
|
||||||
// private WhiteboardClientMessageSender whiteboardMessageSender;
|
|
||||||
// private DeskShareMessageSender deskShareMessageSender;
|
|
||||||
// private BbbAppsIsKeepAliveHandler bbbAppsIsKeepAliveHandler;
|
|
||||||
// private PollingClientMessageSender pollingMessageSender;
|
|
||||||
// private CaptionClientMessageSender captionMessageSender;
|
|
||||||
|
|
||||||
// public void setConnectionInvokerService(ConnectionInvokerService s) {
|
|
||||||
// this.service = s;
|
|
||||||
// userMessageSender = new UserClientMessageSender(service);
|
|
||||||
// meetingMessageSender = new MeetingClientMessageSender(service);
|
|
||||||
// chatMessageSender = new ChatClientMessageSender(service);
|
|
||||||
// presentationMessageSender = new PresentationClientMessageSender(service);
|
|
||||||
// whiteboardMessageSender = new WhiteboardClientMessageSender(service);
|
|
||||||
// deskShareMessageSender = new DeskShareMessageSender(service);
|
|
||||||
// pollingMessageSender = new PollingClientMessageSender(service);
|
|
||||||
// captionMessageSender = new CaptionClientMessageSender(service);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setBbbAppsIsKeepAliveHandler(BbbAppsIsKeepAliveHandler handler) {
|
|
||||||
// bbbAppsIsKeepAliveHandler = handler;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(String pattern, String channel, String message) {
|
public void handleMessage(String pattern, String channel, String message) {
|
||||||
System.out.println("___RedisPubSubMessageHandler:::in red5 getting message: " + channel +
|
if (channel.equalsIgnoreCase(MessagingConstants.FROM_MEETING_CHANNEL)) {
|
||||||
" " + message);
|
JsonParser parser = new JsonParser();
|
||||||
log.info("___RedisPubSubMessageHandler:::in red5 getting message: " + channel + " " +
|
JsonObject obj = (JsonObject) parser.parse(message);
|
||||||
message);
|
if (obj.has("header") && obj.has("payload")) {
|
||||||
// if (channel.equalsIgnoreCase(MessagingConstants.FROM_CHAT_CHANNEL)) {
|
JsonObject header = (JsonObject) obj.get("header");
|
||||||
// chatMessageSender.handleChatMessage(message);
|
if (header.has("name")) {
|
||||||
// } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_PRESENTATION_CHANNEL)) {
|
String messageName = header.get("name").getAsString();
|
||||||
// presentationMessageSender.handlePresentationMessage(message);
|
|
||||||
// } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_MEETING_CHANNEL)) {
|
if (AllowUserToShareDesktopReply.NAME.equals(messageName)) {
|
||||||
// meetingMessageSender.handleMeetingMessage(message);
|
AllowUserToShareDesktopReply msg = AllowUserToShareDesktopReply.fromJson(message);
|
||||||
// } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_USERS_CHANNEL)) {
|
log.info("^^^^^^^AllowUserToShareDesktopReply in " +
|
||||||
// log.info("trace 0 : " + message);
|
"RedisPubSubMessageHandler::handleMessage^^^^^^allowed=" + msg.allowed);
|
||||||
// userMessageSender.handleUsersMessage(message);
|
handler.startShareRequest(msg.meetingId, msg.userId, msg.allowed);
|
||||||
// } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_WHITEBOARD_CHANNEL)) {
|
|
||||||
// whiteboardMessageSender.handleWhiteboardMessage(message);
|
} else {
|
||||||
// } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_SYSTEM_CHANNEL)) {
|
log.info("some other meeting message");
|
||||||
// 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);
|
|
||||||
// } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_CAPTION_CHANNEL)) {
|
|
||||||
// captionMessageSender.handleCaptionMessage(message);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAppHandler(Red5AppHandler handler) {
|
||||||
|
this.handler = handler;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,11 +41,13 @@ public class Red5AppHandler {
|
|||||||
sender.sendMessage(msg);
|
sender.sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startShareRequest(String meetingId, String userId, Boolean record) {
|
public void startShareRequest(String meetingId, String userId, Boolean allowed) {
|
||||||
StartShareRequestResponse resp = app.startShareRequest(meetingId, userId, record);
|
StartShareRequestResponse resp = app.startShareRequest(meetingId, userId, allowed);
|
||||||
|
|
||||||
Map<String, Object> data = new HashMap<String, Object>();
|
Map<String, Object> data = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
data.put("allowed", allowed);
|
||||||
|
|
||||||
if (resp.error != null) {
|
if (resp.error != null) {
|
||||||
data.put("error", resp.error.reason);
|
data.put("error", resp.error.reason);
|
||||||
} else {
|
} else {
|
||||||
|
@ -6,6 +6,9 @@ import java.util.Set;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.bigbluebutton.app.screenshare.messaging.redis.MessageSender;
|
import org.bigbluebutton.app.screenshare.messaging.redis.MessageSender;
|
||||||
|
//import org.bigbluebutton.app.screenshare.messaging.redis.MessagingConstants;
|
||||||
|
import org.bigbluebutton.common.messages.AllowUserToShareDesktopRequest;
|
||||||
|
import org.bigbluebutton.common.messages.MessagingConstants;
|
||||||
import org.red5.logging.Red5LoggerFactory;
|
import org.red5.logging.Red5LoggerFactory;
|
||||||
import org.red5.server.api.IConnection;
|
import org.red5.server.api.IConnection;
|
||||||
import org.red5.server.api.Red5;
|
import org.red5.server.api.Red5;
|
||||||
@ -98,10 +101,15 @@ public class Red5AppService {
|
|||||||
event.put("meetingId", meetingId);
|
event.put("meetingId", meetingId);
|
||||||
event.put("userID", userId);
|
event.put("userID", userId);
|
||||||
event.put("eventName", "AllowUserToShareDesktopRequest");
|
event.put("eventName", "AllowUserToShareDesktopRequest");
|
||||||
// red5RedisSender.record(meetingId, event);
|
// red5RedisSender.record(meetingId, event); TODO
|
||||||
|
|
||||||
|
AllowUserToShareDesktopRequest requestMsg = new AllowUserToShareDesktopRequest(meetingId,
|
||||||
|
userId,
|
||||||
|
genTimestamp());
|
||||||
|
red5RedisSender.send(MessagingConstants.TO_USERS_CHANNEL, requestMsg.toJson());
|
||||||
|
|
||||||
log.info("_______Red5AppService::startShareRequest");
|
log.info("_______Red5AppService::startShareRequest");
|
||||||
// handler.startShareRequest(meetingId, userId, record);
|
// handler.startShareRequest(meetingId, userId, record); //TODO REMOVE
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopShareRequest(Map<String, Object> msg) {
|
public void stopShareRequest(Map<String, Object> msg) {
|
||||||
|
@ -90,12 +90,17 @@ class ScreenShareApplication(val bus: IEventsMessageBus, val jnlpFile: String,
|
|||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("Received start share request on meeting=" + meetingId + "for user=" + userId + "]")
|
logger.debug("Received start share request on meeting=" + meetingId + "for user=" + userId + "]")
|
||||||
}
|
}
|
||||||
implicit val timeout = Timeout(3 seconds)
|
if (record) {
|
||||||
val future = screenshareManager ? StartShareRequestMessage(meetingId, userId, record)
|
implicit val timeout = Timeout(3 seconds)
|
||||||
val reply = Await.result(future, timeout.duration).asInstanceOf[StartShareRequestReplyMessage]
|
val future = screenshareManager ? StartShareRequestMessage(meetingId, userId, record)
|
||||||
|
val reply = Await.result(future, timeout.duration).asInstanceOf[StartShareRequestReplyMessage]
|
||||||
|
|
||||||
|
val response = new StartShareRequestResponse(reply.token, jnlpFile, null)
|
||||||
|
response
|
||||||
|
} else {
|
||||||
|
new StartShareRequestResponse("none", "none", null) // was not allowed to share desktop
|
||||||
|
}
|
||||||
|
|
||||||
val response = new StartShareRequestResponse(reply.token, jnlpFile, null)
|
|
||||||
response
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def stopShareRequest(meetingId: String, streamId: String) {
|
def stopShareRequest(meetingId: String, streamId: String) {
|
||||||
|
@ -223,6 +223,10 @@ class Screenshare(val sessionManager: ScreenshareManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private def handleStartShareRequestMessage(msg: StartShareRequestMessage) {
|
private def handleStartShareRequestMessage(msg: StartShareRequestMessage) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val token = RandomStringGenerator.randomAlphanumericString(16)
|
val token = RandomStringGenerator.randomAlphanumericString(16)
|
||||||
val streamId = msg.meetingId + "-" + System.currentTimeMillis()
|
val streamId = msg.meetingId + "-" + System.currentTimeMillis()
|
||||||
val session = ActiveSession(this, bus, meetingId, streamId, token, msg.record, msg.userId)
|
val session = ActiveSession(this, bus, meetingId, streamId, token, msg.record, msg.userId)
|
||||||
@ -230,7 +234,8 @@ class Screenshare(val sessionManager: ScreenshareManager,
|
|||||||
sessions += streamId -> session
|
sessions += streamId -> session
|
||||||
session.actorRef ! msg
|
session.actorRef ! msg
|
||||||
|
|
||||||
sender ! new StartShareRequestReplyMessage(token)
|
sender ! new StartShareRequestReplyMessage(token) // todo use forward here
|
||||||
|
// todo remove Request from the name of the case class
|
||||||
}
|
}
|
||||||
|
|
||||||
private def handleIsSharingStopped(msg: IsSharingStopped) {
|
private def handleIsSharingStopped(msg: IsSharingStopped) {
|
||||||
|
@ -111,8 +111,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
<bean id="redisPubSubMessageHandler"
|
<bean id="redisPubSubMessageHandler"
|
||||||
class="org.bigbluebutton.app.screenshare.messaging.redis.RedisPubSubMessageHandler">
|
class="org.bigbluebutton.app.screenshare.messaging.redis.RedisPubSubMessageHandler">
|
||||||
<!--<property name="connectionInvokerService"> <ref bean="connInvokerService"/></property>-->
|
<property name="appHandler" ref="red5AppHandler"/>
|
||||||
<!--<property name="bbbAppsIsKeepAliveHandler"> <ref bean="bbbAppsIsKeepAliveHandler"/></property>-->
|
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<import resource="bbb-redis-pool.xml"/>
|
<import resource="bbb-redis-pool.xml"/>
|
||||||
|
@ -71,14 +71,18 @@ package org.bigbluebutton.modules.screenshare.services
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function handleStartShareRequestResponse(message:Object):void {
|
private function handleStartShareRequestResponse(message:Object):void {
|
||||||
LOGGER.debug("handleStartShareRequestResponse " + message);
|
LOGGER.debug("handleStartShareRequestResponse " + message);
|
||||||
var map:Object = JSON.parse(message.msg);
|
var map:Object = JSON.parse(message.msg);
|
||||||
if (map.hasOwnProperty("authToken") && map.hasOwnProperty("jnlp")) {
|
|
||||||
|
if (map.hasOwnProperty("allowed") &&
|
||||||
|
map.allowed &&
|
||||||
|
map.hasOwnProperty("authToken") &&
|
||||||
|
map.hasOwnProperty("jnlp")) {
|
||||||
var shareSuccessEvent: ShareStartRequestResponseEvent = new ShareStartRequestResponseEvent(map.authToken, map.jnlp, true);
|
var shareSuccessEvent: ShareStartRequestResponseEvent = new ShareStartRequestResponseEvent(map.authToken, map.jnlp, true);
|
||||||
dispatcher.dispatchEvent(shareSuccessEvent);
|
dispatcher.dispatchEvent(shareSuccessEvent);
|
||||||
} else {
|
} else {
|
||||||
var shareFailedEvent: ShareStartRequestResponseEvent = new ShareStartRequestResponseEvent(null, null, false);
|
var shareFailedEvent: ShareStartRequestResponseEvent = new ShareStartRequestResponseEvent(null, null, false);
|
||||||
dispatcher.dispatchEvent(shareFailedEvent);
|
dispatcher.dispatchEvent(shareFailedEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user