Skip to content

Commit 63a3420

Browse files
committed
Merge branch 'master' into upgrade-to-red5-r4580
2 parents 310c283 + a9b3f77 commit 63a3420

File tree

25 files changed

+193
-53
lines changed

25 files changed

+193
-53
lines changed

bbb-lti/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Configure the properties
4444

4545
sudo vi /var/lib/tomcat6/webapps/lti/WEB-INF/classes/lti.properties
4646

47-
Edit the URL and Salt of the BigBlueButton server you are going to connect to
47+
Edit the URL and Salt of the BigBlueButton server you are going to connect to (NOTE: Remove any trailing slashes from the URL!)
4848

4949
bigbluebuttonURL=http://yourbigbluebuttonserver.com/bigbluebutton
5050

bbb-lti/grails-app/controllers/ToolController.groovy

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,19 @@ class ToolController {
7373
log.debug "Locale has been set to " + locale
7474
String welcome = message(code: "bigbluebutton.welcome", args: ["\"{0}\"", "\"{1}\""])
7575
log.debug "Localized default welcome message: [" + welcome + "]"
76-
76+
77+
// Check for [custom_]welcome parameter being passed from the LTI
78+
if (params.get(Parameter.CUSTOM_WELCOME) != null) {
79+
log.debug "A custom welcome message has been provided"
80+
welcome = params.get(Parameter.CUSTOM_WELCOME)
81+
log.debug "Overriding default welcome message with: [" + welcome + "]"
82+
}
83+
84+
// Detect if the LTI has requested recording
85+
if (params.get(Parameter.CUSTOM_RECORD) == "true") {
86+
log.debug "This session will be recorded!"
87+
}
88+
7789
//String destinationURL = "http://www.bigbluebutton.org/"
7890
String destinationURL = bigbluebuttonService.getJoinURL(params, welcome)
7991

bbb-lti/grails-app/services/BigbluebuttonService.groovy

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,14 @@ class BigbluebuttonService {
8686
String userFullName = getValidatedUserFullName(params, isModerator)
8787
String courseTitle = getValidatedCourseTitle(params.get(Parameter.COURSE_TITLE))
8888
String userID = getValidatedUserId(params.get(Parameter.USER_ID))
89+
String record = getValidatedRecord(params.get(Parameter.CUSTOM_RECORD))
8990

9091
String[] values = [meetingName, courseTitle]
9192
String welcomeMsg = MessageFormat.format(welcome, values)
9293

9394
String meta = getMonitoringMetaData(params)
9495

95-
String createURL = getCreateURL( meetingName, meetingID, attendeePW, moderatorPW, welcomeMsg, logoutURL, meta )
96+
String createURL = getCreateURL( meetingName, meetingID, attendeePW, moderatorPW, welcomeMsg, logoutURL, record, meta )
9697
//log.debug "createURL: " + createURL
9798
Map<String, Object> createResponse = doAPICall(createURL)
9899
//log.debug "createResponse: " + createResponse
@@ -110,10 +111,10 @@ class BigbluebuttonService {
110111

111112
}
112113

113-
private String getCreateURL(String name, String meetingID, String attendeePW, String moderatorPW, String welcome, String logoutURL, String meta ) {
114+
private String getCreateURL(String name, String meetingID, String attendeePW, String moderatorPW, String welcome, String logoutURL, String record, String meta ) {
114115
Integer voiceBridge = 70000 + new Random(System.currentTimeMillis()).nextInt(10000);
115116

116-
String url = bbbProxy.getCreateURL(name, meetingID, attendeePW, moderatorPW, welcome, "", voiceBridge.toString(), "", logoutURL, "", "", "", meta );
117+
String url = bbbProxy.getCreateURL(name, meetingID, attendeePW, moderatorPW, welcome, "", voiceBridge.toString(), "", logoutURL, "", record, "", meta );
117118
return url;
118119
}
119120

@@ -156,6 +157,10 @@ class BigbluebuttonService {
156157
private String getValidatedUserId(String userId){
157158
return (userId == null)? "": userId
158159
}
160+
161+
private String getValidatedRecord(String record){
162+
return (record != "true")? "": record
163+
}
159164

160165
private String getMonitoringMetaData(params){
161166
String meta

bbb-lti/src/java/org/bigbluebutton/lti/Parameter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public class Parameter {
4747
public static final String TOOL_CONSUMER_INSTANCE_URL = "tool_consumer_instance_url";
4848

4949
public static final String CUSTOM_USER_ID = "custom_lis_person_sourcedid";
50+
public static final String CUSTOM_WELCOME = "custom_welcome";
51+
public static final String CUSTOM_RECORD = "custom_record";
5052

5153

5254
}

bbb-lti/src/java/org/bigbluebutton/lti/Role.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@ public static boolean isModerator(String _roles){
4646
for( int i=0; i < roles.length; i++){
4747
if( roles[i].equals(FACULTY) ||
4848
roles[i].equals(URN_INSTITUTION_ROLE + FACULTY) ||
49+
roles[i].equals(URN_CONTEXT_ROLE + FACULTY) ||
4950
roles[i].equals(INSTRUCTOR) ||
5051
roles[i].equals(URN_INSTITUTION_ROLE + INSTRUCTOR) ||
52+
roles[i].equals(URN_CONTEXT_ROLE + INSTRUCTOR) ||
5153
roles[i].equals(MENTOR) ||
5254
roles[i].equals(URN_INSTITUTION_ROLE + MENTOR) ||
53-
roles[i].equals(URN_INSTITUTION_ROLE + ADMINISTRATOR)
55+
roles[i].equals(URN_CONTEXT_ROLE + MENTOR) ||
56+
roles[i].equals(URN_INSTITUTION_ROLE + ADMINISTRATOR) ||
57+
roles[i].equals(URN_CONTEXT_ROLE + ADMINISTRATOR)
5458
){
5559
response = true;
5660
break;

bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void createConference(String room, String meetingid, boolean record) {
4848
}
4949

5050
public void destroyConference(String room) {
51+
confProvider.ejectAll(room);
5152
roomMgr.destroyRoom(room);
5253
}
5354

bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServiceProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public interface ConferenceServiceProvider {
2626
public void populateRoom(String room);
2727
public void mute(String room, Integer participant, Boolean mute);
2828
public void eject(String room, Integer participant);
29+
public void ejectAll(String room);
2930
public void record(String room, String meetingid);
3031
public void broadcast(String room, String meetingid);
3132
public void setConferenceEventListener(ConferenceEventListener l);

bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
package org.bigbluebutton.webconference.voice.freeswitch;
2020

2121
import java.io.File;
22-
import java.util.Collections;
23-
import java.util.HashMap;
2422
import java.util.Iterator;
2523
import java.util.Map;
2624
import java.util.Observable;
@@ -33,6 +31,7 @@
3331
import org.bigbluebutton.webconference.voice.events.ParticipantTalkingEvent;
3432
import org.bigbluebutton.webconference.voice.events.StartRecordingEvent;
3533
import org.bigbluebutton.webconference.voice.freeswitch.actions.BroadcastConferenceCommand;
34+
import org.bigbluebutton.webconference.voice.freeswitch.actions.EjectAllUsersCommand;
3635
import org.bigbluebutton.webconference.voice.freeswitch.actions.EjectParticipantCommand;
3736
import org.bigbluebutton.webconference.voice.freeswitch.actions.PopulateRoomCommand;
3837
import org.bigbluebutton.webconference.voice.freeswitch.actions.MuteParticipantCommand;
@@ -149,6 +148,20 @@ public void eject(String room, Integer participant) {
149148
startHeartbeatMonitor();
150149
}
151150
}
151+
152+
@Override
153+
public void ejectAll(String room) {
154+
Client c = manager.getESLClient();
155+
if (c.canSend()) {
156+
EjectAllUsersCommand mpc = new EjectAllUsersCommand(room, USER);
157+
String jobId = c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs());
158+
log.debug("eject all user from room [{}], jobid [{}]", room, jobId);
159+
}else {
160+
log.warn("Can't send eject request to FreeSWITCH as we are not connected.");
161+
// Let's see if we can recover the connection.
162+
startHeartbeatMonitor();
163+
}
164+
}
152165

153166
@Override
154167
public void record(String room, String meetingid){

bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchServiceProvider.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public void eject(String room, Integer participant) {
5050
appDelegate.eject(room, participant);
5151
}
5252

53+
@Override
54+
public void ejectAll(String room) {
55+
appDelegate.ejectAll(room);
56+
}
57+
5358
@Override
5459
public void mute(String room, Integer participant, Boolean mute) {
5560
appDelegate.mute(room, participant, mute);
@@ -111,4 +116,6 @@ public void setConferenceEventListener(ConferenceEventListener l) {
111116
conferenceEventListener = l;
112117
appDelegate.setConferenceEventListener(conferenceEventListener);
113118
}
119+
120+
114121
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
3+
*
4+
* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
5+
*
6+
* This program is free software; you can redistribute it and/or modify it under the
7+
* terms of the GNU Lesser General Public License as published by the Free Software
8+
* Foundation; either version 3.0 of the License, or (at your option) any later
9+
* version.
10+
*
11+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
12+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License along
16+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
17+
*
18+
*/
19+
package org.bigbluebutton.webconference.voice.freeswitch.actions;
20+
21+
public class EjectAllUsersCommand extends FreeswitchCommand {
22+
23+
public EjectAllUsersCommand(String room, Integer requesterId) {
24+
super(room, requesterId);
25+
}
26+
27+
@Override
28+
public String getCommandArgs() {
29+
return room + " kick all";
30+
}
31+
}

0 commit comments

Comments
 (0)