Permalink
Browse files

Added new "webcamsOnlyForModerator" parameter for create meeting API.

  • Loading branch information...
1 parent b693bbf commit 4c4d7688839da2d16c99f91c1ad980ee967198c4 @GhaziTriki GhaziTriki committed Jan 2, 2017
Showing with 166 additions and 98 deletions.
  1. +1 −0 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonInGW.scala
  2. +2 −2 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/MeetingModel.scala
  3. +2 −1 akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala
  4. +1 −0 bbb-common-message/src/main/java/org/bigbluebutton/common/messages/Constants.java
  5. +5 −2 bbb-common-message/src/main/java/org/bigbluebutton/common/messages/CreateMeetingMessage.java
  6. +3 −1 bbb-common-message/src/main/java/org/bigbluebutton/common/messages/MessageFromJsonConverter.java
  7. +5 −2 bbb-common-message/src/main/java/org/bigbluebutton/messages/CreateMeetingRequest.java
  8. +41 −39 bbb-common-message/src/test/java/org/bigbluebutton/messages/CreateMeetingRequestTest.java
  9. +6 −0 bigbluebutton-client/src/org/bigbluebutton/core/model/Meeting.as
  10. +6 −0 bigbluebutton-client/src/org/bigbluebutton/core/model/MeetingBuilder.as
  11. +4 −1 bigbluebutton-client/src/org/bigbluebutton/main/model/users/JoinService.as
  12. +3 −0 bigbluebutton-web/grails-app/conf/bigbluebutton.properties
  13. +1 −0 bigbluebutton-web/grails-app/conf/spring/resources.xml
  14. +1 −0 bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy
  15. +4 −3 bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java
  16. +21 −3 bigbluebutton-web/src/java/org/bigbluebutton/api/ParamsProcessorUtil.java
  17. +13 −1 bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java
  18. +1 −0 bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java
  19. +1 −0 bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java
  20. +3 −3 bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java
  21. +6 −5 bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java
  22. +36 −35 ...button-web/src/java/org/bigbluebutton/api/messaging/converters/messages/CreateMeetingMessage.java
@@ -65,6 +65,7 @@ class BigBlueButtonInGW(
msg.payload.durationInMinutes,
msg.payload.autoStartRecording,
msg.payload.allowStartStopRecording,
+ msg.payload.webcamsOnlyForModerator,
msg.payload.moderatorPassword,
msg.payload.viewerPassword,
msg.payload.createTime,
@@ -6,8 +6,8 @@ import java.util.concurrent.TimeUnit
case object StopMeetingActor
case class MeetingProperties(meetingID: String, externalMeetingID: String, parentMeetingID: String, meetingName: String,
recorded: Boolean, voiceBridge: String, deskshareBridge: String, duration: Int,
- autoStartRecording: Boolean, allowStartStopRecording: Boolean, moderatorPass: String,
- viewerPass: String, createTime: Long, createDate: String,
+ autoStartRecording: Boolean, allowStartStopRecording: Boolean, webcamsOnlyForModerator: Boolean,
+ moderatorPass: String, viewerPass: String, createTime: Long, createDate: String,
red5DeskShareIP: String, red5DeskShareApp: String, isBreakout: Boolean, sequence: Int)
case class MeetingExtensionProp(maxExtensions: Int = 2, numExtensions: Int = 0, extendByMinutes: Int = 20,
@@ -13,6 +13,7 @@ trait AppsTestFixtures {
val durationInMinutes = 10
val autoStartRecording = false
val allowStartStopRecording = false
+ val webcamsOnlyForModerator = false;
val moderatorPassword = "modpass"
val viewerPassword = "viewpass"
val createTime = System.currentTimeMillis
@@ -25,7 +26,7 @@ trait AppsTestFixtures {
meetingName, record,
voiceConfId, deskshareConfId,
durationInMinutes,
- autoStartRecording, allowStartStopRecording,
+ autoStartRecording, allowStartStopRecording, webcamsOnlyForModerator,
moderatorPassword, viewerPassword,
createTime, createDate, red5DeskShareIP, red5DeskShareApp,
isBreakout, sequence)
@@ -32,6 +32,7 @@
public static final String RECORDING = "recording";
public static final String AUTO_START_RECORDING = "auto_start_recording";
public static final String ALLOW_START_STOP_RECORDING = "allow_start_stop_recording";
+ public static final String WEBCAMS_ONLY_FOR_MODERATOR = "webcams_only_for_moderator";
public static final String LAYOUT_ID = "layout_id";
public static final String LISTENONLY = "listenOnly";
public static final String LISTEN_ONLY = "listen_only";
@@ -12,15 +12,17 @@
public final Long duration;
public final Boolean autoStartRecording;
public final Boolean allowStartStopRecording;
+ public final Boolean webcamsOnlyForModerator;
public final String moderatorPass;
public final String viewerPass;
public final Long createTime;
public final String createDate;
public CreateMeetingMessage(String id, String externalId, String name, Boolean record, String voiceBridge,
Long duration, Boolean autoStartRecording,
- Boolean allowStartStopRecording, String moderatorPass,
- String viewerPass, Long createTime, String createDate) {
+ Boolean allowStartStopRecording,Boolean webcamsOnlyForModerator,
+ String moderatorPass, String viewerPass,
+ Long createTime, String createDate) {
this.id = id;
this.externalId = externalId;
this.name = name;
@@ -29,6 +31,7 @@ public CreateMeetingMessage(String id, String externalId, String name, Boolean r
this.duration = duration;
this.autoStartRecording = autoStartRecording;
this.allowStartStopRecording = allowStartStopRecording;
+ this.webcamsOnlyForModerator = webcamsOnlyForModerator;
this.moderatorPass = moderatorPass;
this.viewerPass = viewerPass;
this.createTime = createTime;
@@ -60,14 +60,16 @@ private static IBigBlueButtonMessage processCreateMeeting(JsonObject payload) {
Long duration = payload.get(Constants.DURATION).getAsLong();
Boolean autoStartRecording = payload.get(Constants.AUTO_START_RECORDING).getAsBoolean();
Boolean allowStartStopRecording = payload.get(Constants.ALLOW_START_STOP_RECORDING).getAsBoolean();
+ Boolean webcamsOnlyForModerator = payload.get(Constants.WEBCAMS_ONLY_FOR_MODERATOR).getAsBoolean();
String moderatorPassword = payload.get(Constants.MODERATOR_PASS).getAsString();
String viewerPassword = payload.get(Constants.VIEWER_PASS).getAsString();
Long createTime = payload.get(Constants.CREATE_TIME).getAsLong();
String createDate = payload.get(Constants.CREATE_DATE).getAsString();
return new CreateMeetingMessage(id, externalId, name, record, voiceBridge,
duration, autoStartRecording, allowStartStopRecording,
- moderatorPassword, viewerPassword, createTime, createDate);
+ webcamsOnlyForModerator, moderatorPassword, viewerPassword,
+ createTime, createDate);
}
private static IBigBlueButtonMessage processDestroyMeeting(JsonObject payload) {
@@ -23,6 +23,7 @@ public CreateMeetingRequest(CreateMeetingRequestPayload payload) {
public final Integer durationInMinutes;
public final Boolean autoStartRecording;
public final Boolean allowStartStopRecording;
+ public final Boolean webcamsOnlyForModerator;
public final String moderatorPassword;
public final String viewerPassword;
public final Long createTime;
@@ -34,8 +35,9 @@ public CreateMeetingRequestPayload(String id, String externalId,
String parentId, String name, Boolean record,
String voiceConfId, Integer duration,
Boolean autoStartRecording, Boolean allowStartStopRecording,
- String moderatorPass, String viewerPass, Long createTime,
- String createDate, Boolean isBreakout, Integer sequence) {
+ Boolean webcamsOnlyForModerator, String moderatorPass,
+ String viewerPass, Long createTime, String createDate,
+ Boolean isBreakout, Integer sequence) {
this.id = id;
this.externalId = externalId;
this.parentId = parentId;
@@ -45,6 +47,7 @@ public CreateMeetingRequestPayload(String id, String externalId,
this.durationInMinutes = duration;
this.autoStartRecording = autoStartRecording;
this.allowStartStopRecording = allowStartStopRecording;
+ this.webcamsOnlyForModerator = webcamsOnlyForModerator;
this.moderatorPassword = moderatorPass;
this.viewerPassword = viewerPass;
this.createTime = createTime;
@@ -8,46 +8,48 @@
import com.google.gson.Gson;
public class CreateMeetingRequestTest {
- @Test
- public void testCreateMeetingRequest() {
- String meetingId = "abc123";
- String externalId = "extabc123";
- String parentId = "";
- Boolean record = false;
- Integer durationInMinutes = 20;
- String name = "Breakout room 1";
- String voiceConfId = "851153";
- Boolean autoStartRecording = false;
- Boolean allowStartStopRecording = false;
- Boolean isBreakout = true;
- Integer sequence = 4;
- String viewerPassword = "vp";
- String moderatorPassword = "mp";
- long createTime = System.currentTimeMillis();
- String createDate = new Date(createTime).toString();
-
+ @Test
+ public void testCreateMeetingRequest() {
+ String meetingId = "abc123";
+ String externalId = "extabc123";
+ String parentId = "";
+ Boolean record = false;
+ Integer durationInMinutes = 20;
+ String name = "Breakout room 1";
+ String voiceConfId = "851153";
+ Boolean autoStartRecording = false;
+ Boolean allowStartStopRecording = false;
+ Boolean webcamsOnlyForModerator = false;
+ Boolean isBreakout = true;
+ Integer sequence = 4;
+ String viewerPassword = "vp";
+ String moderatorPassword = "mp";
+ long createTime = System.currentTimeMillis();
+ String createDate = new Date(createTime).toString();
+
CreateMeetingRequestPayload payload = new CreateMeetingRequestPayload(
meetingId, externalId, parentId, name, record, voiceConfId,
durationInMinutes, autoStartRecording, allowStartStopRecording,
- moderatorPassword, viewerPassword, createTime, createDate,
- isBreakout, sequence);
- CreateMeetingRequest msg = new CreateMeetingRequest(payload);
- Gson gson = new Gson();
- String json = gson.toJson(msg);
- System.out.println(json);
-
- CreateMeetingRequest rxMsg = gson.fromJson(json, CreateMeetingRequest.class);
-
- Assert.assertEquals(rxMsg.header.name, CreateMeetingRequest.NAME);
- Assert.assertEquals(rxMsg.payload.id, meetingId);
- Assert.assertEquals(rxMsg.payload.externalId, externalId);
- Assert.assertEquals(rxMsg.payload.parentId, parentId);
- Assert.assertEquals(rxMsg.payload.name, name);
- Assert.assertEquals(rxMsg.payload.voiceConfId, voiceConfId);
- Assert.assertEquals(rxMsg.payload.viewerPassword, viewerPassword);
- Assert.assertEquals(rxMsg.payload.moderatorPassword, moderatorPassword);
- Assert.assertEquals(rxMsg.payload.durationInMinutes, durationInMinutes);
- Assert.assertEquals(rxMsg.payload.isBreakout, isBreakout);
- Assert.assertEquals(rxMsg.payload.sequence, sequence);
- }
+ webcamsOnlyForModerator, moderatorPassword, viewerPassword,
+ createTime, createDate, isBreakout, sequence);
+ CreateMeetingRequest msg = new CreateMeetingRequest(payload);
+ Gson gson = new Gson();
+ String json = gson.toJson(msg);
+ System.out.println(json);
+
+ CreateMeetingRequest rxMsg = gson.fromJson(json,
+ CreateMeetingRequest.class);
+
+ Assert.assertEquals(rxMsg.header.name, CreateMeetingRequest.NAME);
+ Assert.assertEquals(rxMsg.payload.id, meetingId);
+ Assert.assertEquals(rxMsg.payload.externalId, externalId);
+ Assert.assertEquals(rxMsg.payload.parentId, parentId);
+ Assert.assertEquals(rxMsg.payload.name, name);
+ Assert.assertEquals(rxMsg.payload.voiceConfId, voiceConfId);
+ Assert.assertEquals(rxMsg.payload.viewerPassword, viewerPassword);
+ Assert.assertEquals(rxMsg.payload.moderatorPassword, moderatorPassword);
+ Assert.assertEquals(rxMsg.payload.durationInMinutes, durationInMinutes);
+ Assert.assertEquals(rxMsg.payload.isBreakout, isBreakout);
+ Assert.assertEquals(rxMsg.payload.sequence, sequence);
+ }
}
@@ -14,6 +14,7 @@ package org.bigbluebutton.core.model
private var _welcomeMessage:String;
private var _modOnlyMessage:String;
private var _allowStartStopRecording:Boolean;
+ private var _webcmasOnlyForModerator:Boolean;
public var isRecording: Boolean = false;
@@ -31,6 +32,7 @@ package org.bigbluebutton.core.model
_welcomeMessage = build.welcomeMessage;
_modOnlyMessage = build.modOnlyMessage;
_allowStartStopRecording = build.allowStartStopRecording;
+ _webcmasOnlyForModerator = build.webcmasOnlyForModerator;
}
public function get name():String {
@@ -68,5 +70,9 @@ package org.bigbluebutton.core.model
public function get allowStartStopRecording():Boolean {
return _allowStartStopRecording;
}
+
+ public function get webcmasOnlyForModerator() : Boolean {
+ return _webcmasOnlyForModerator;
+ }
}
}
@@ -14,6 +14,7 @@ package org.bigbluebutton.core.model
internal var welcomeMessage:String;
internal var modOnlyMessage:String;
internal var allowStartStopRecording: Boolean;
+ internal var webcmasOnlyForModerator: Boolean;
public function MeetingBuilder(id: String, name: String) {
this.id = id;
@@ -54,6 +55,11 @@ package org.bigbluebutton.core.model
allowStartStopRecording = value;
return this;
}
+
+ public function withWebcmasOnlyForModerator(value: Boolean):MeetingBuilder {
+ webcmasOnlyForModerator = value;
+ return this;
+ }
public function withDefaultLayout(value: String):MeetingBuilder {
defaultLayout = value;
@@ -122,6 +122,7 @@ package org.bigbluebutton.main.model.users
response.authToken = result.response.authToken;
response.record = result.response.record;
response.allowStartStopRecording = result.response.allowStartStopRecording;
+ response.webcmasOnlyForModerator = result.response.webcmasOnlyForModerator;
response.webvoiceconf = result.response.webvoiceconf;
response.dialnumber = result.response.dialnumber;
response.voicebridge = result.response.voicebridge;
@@ -160,7 +161,9 @@ package org.bigbluebutton.main.model.users
.withExternalId(response.externMeetingID).withRecorded(response.record.toUpperCase() == "TRUE")
.withDefaultAvatarUrl(response.avatarURL).withDialNumber(response.dialNumber)
.withWelcomeMessage(response.welcome).withModOnlyMessage(response.modOnlyMessage)
- .withAllowStartStopRecording(response.allowStartStopRecording).withBreakout(response.isBreakout)
+ .withAllowStartStopRecording(response.allowStartStopRecording)
+ .withWebcmasOnlyForModerator(response.webcmasOnlyForModerator)
+ .withBreakout(response.isBreakout)
.build();
if (_resultListener != null) _resultListener(true, response);
@@ -137,6 +137,9 @@ autoStartRecording=false
# Allow the user to start/stop recording.
allowStartStopRecording=true
+# Allow webcams streaming reception only to and from moderators
+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.
@@ -96,6 +96,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="disableRecordingDefault" value="${disableRecordingDefault}"/>
<property name="autoStartRecording" value="${autoStartRecording}"/>
<property name="allowStartStopRecording" value="${allowStartStopRecording}"/>
+ <property name="webcamsOnlyForModerator" value="${webcamsOnlyForModerator}"/>
<property name="defaultAvatarURL" value="${defaultAvatarURL}"/>
<property name="defaultConfigURL" value="${defaultConfigURL}"/>
</bean>
@@ -1597,6 +1597,7 @@ class ApiController {
record = us.record
isBreakout = meeting.isBreakout()
allowStartStopRecording = meeting.getAllowStartStopRecording()
+ webcamsOnlyForModerator = meeting.getWebcamsOnlyForModerator()
welcome = us.welcome
if (! StringUtils.isEmpty(meeting.moderatorOnlyMessage))
modOnlyMessage = meeting.moderatorOnlyMessage
@@ -334,9 +334,10 @@ private void handleCreateMeeting(Meeting m) {
messagingService.createMeeting(m.getInternalId(), m.getExternalId(),
m.getParentMeetingId(), m.getName(), m.isRecord(),
m.getTelVoice(), m.getDuration(), m.getAutoStartRecording(),
- m.getAllowStartStopRecording(), m.getModeratorPassword(),
- m.getViewerPassword(), m.getCreateTime(),
- formatPrettyDate(m.getCreateTime()), m.isBreakout(), m.getSequence());
+ m.getAllowStartStopRecording(), m.getWebcamsOnlyForModerator(),
+ m.getModeratorPassword(), m.getViewerPassword(),
+ m.getCreateTime(), formatPrettyDate(m.getCreateTime()),
+ m.isBreakout(), m.getSequence());
}
private String formatPrettyDate(Long timestamp) {
@@ -68,6 +68,7 @@
private boolean disableRecordingDefault;
private boolean autoStartRecording;
private boolean allowStartStopRecording;
+ private boolean webcamsOnlyForModerator;
private String defaultConfigXML = null;
@@ -363,6 +364,18 @@ public Meeting processCreateParams(Map<String, String> params) {
}
}
+ boolean webcamsOnlyForMod = webcamsOnlyForModerator;
+ if (!StringUtils.isEmpty(params.get("webcamsOnlyForModerator"))) {
+ try {
+ webcamsOnlyForMod = Boolean.parseBoolean(params
+ .get("webcamsOnlyForModerator"));
+ } catch (Exception ex) {
+ log.warn(
+ "Invalid param [webcamsOnlyForModerator] for meeting=[{}]",
+ internalMeetingId);
+ }
+ }
+
// Collect metadata for this meeting that the third-party app wants to
// store if meeting is recorded.
Map<String, String> meetingInfo = new HashMap<String, String>();
@@ -403,6 +416,7 @@ public Meeting processCreateParams(Map<String, String> params) {
.withDefaultAvatarURL(defaultAvatarURL)
.withAutoStartRecording(autoStartRec)
.withAllowStartStopRecording(allowStartStoptRec)
+ .withWebcamsOnlyForModerator(webcamsOnlyForMod)
.withMetadata(meetingInfo)
.withWelcomeMessageTemplate(welcomeMessageTemplate)
.withWelcomeMessage(welcomeMessage).isBreakout(isBreakout)
@@ -752,9 +766,13 @@ public void setAutoStartRecording(boolean start) {
this.autoStartRecording = start;
}
- public void setAllowStartStopRecording(boolean allowStartStopRecording) {
- this.allowStartStopRecording = allowStartStopRecording;
- }
+ public void setAllowStartStopRecording(boolean allowStartStopRecording) {
+ this.allowStartStopRecording = allowStartStopRecording;
+ }
+
+ public void setWebcamsOnlyForModerator(boolean webcamsOnlyForModerator) {
+ this.webcamsOnlyForModerator = webcamsOnlyForModerator;
+ }
public void setdefaultAvatarURL(String url) {
this.defaultAvatarURL = url;
Oops, something went wrong.

0 comments on commit 4c4d768

Please sign in to comment.