Skip to content

Commit

Permalink
Merge branch 'v2.0.x-release' of github.com:bigbluebutton/bigbluebutt…
Browse files Browse the repository at this point in the history
…on into current
  • Loading branch information
antobinary committed Jul 3, 2018
2 parents 381e72b + d80f3a5 commit eca2e50
Show file tree
Hide file tree
Showing 34 changed files with 648 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ package org.bigbluebutton.clientcheck.service
private static var RECORD_MOCK:Boolean=false;
private static var EXTERNAL_USER_ID_MOCK:String="123456";
private static var INTERNAL_USER_ID_MOCK:String="654321";
private static var CLIENT_CONN_ID:String="client-conn-id";
private static var LOCK_ON_MOCK:Boolean=true;

public function init():void
Expand All @@ -60,7 +61,7 @@ package org.bigbluebutton.clientcheck.service
// sip has a different way of connecting to the red5 server, need to fake connection data.
if (systemConfiguration.rtmpApps[i].applicationUri.indexOf("sip") > 0)
{
_netConnection.connect(systemConfiguration.rtmpApps[i].applicationUri, ROOM_MOCK, EXTERNAL_USER_ID_MOCK, USER_NAME_MOCK, INTERNAL_USER_ID_MOCK);
_netConnection.connect(systemConfiguration.rtmpApps[i].applicationUri, ROOM_MOCK, EXTERNAL_USER_ID_MOCK, USER_NAME_MOCK, INTERNAL_USER_ID_MOCK, CLIENT_CONN_ID);
continue;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void appStop(IScope scope) {
public boolean appConnect(IConnection conn, Object[] params) {

if(params.length != 5) {
log.error("Invalid number of parameters. param length=" + params.length);
log.error("Invalid number of parameters. Provided parameters={} .Required parameters=5", params.length);
return false;
}

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ package org.bigbluebutton.modules.screenshare.managers {
LOGGER.debug("ViewerWindowManager Received stop viewing command");
if (viewWindow) {
closeWindow(viewWindow);
viewWindow = null;
isViewing = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ package org.bigbluebutton.modules.screenshare.managers
if (shareWindow != null) shareWindow.stopSharing();
}

private function autopublishTimerHandler(event:TimerEvent):void {
shareWindow.shareScreen(true);
}

public function handleShareWindowCloseEvent():void {
closeWindow(shareWindow);
if (shareWindow) {
closeWindow(shareWindow);
shareWindow = null;
}
}

private function openWindow(window:IBbbModuleWindow = null):void {
Expand All @@ -77,7 +76,6 @@ package org.bigbluebutton.modules.screenshare.managers
var event:CloseWindowEvent = new CloseWindowEvent(CloseWindowEvent.CLOSE_WINDOW_EVENT);
event.window = window;
globalDispatcher.dispatchEvent(event);
shareWindow = null;
}

public function startSharing():void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ package org.bigbluebutton.modules.screenshare.managers

public function handleViewWindowCloseEvent():void {
LOGGER.debug("Received close view window event");
closeWindow(viewWindow);
isViewing = false;
if (viewWindow) {
closeWindow(viewWindow);
isViewing = false;
}
}

private function closeWindow(window:IBbbModuleWindow):void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable]
private var shareTypeProvider:Array;
[Embed(source="../../assets/sounds/ScreenshareOff.mp3")]
private var noticeSoundClass:Class;
private var noticeSound:Sound = new noticeSoundClass() as Sound;
private var soundPlayed:Boolean = false;
private function init():void {
dsOptions = Options.getOptions(ScreenshareOptions) as ScreenshareOptions;
Expand Down Expand Up @@ -431,6 +436,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function closeWindow():void {
dispatchEvent(new ShareWindowEvent(ShareWindowEvent.CLOSE));
if (!soundPlayed) {
trace("playing from java publish window");
var tSC:SoundChannel = noticeSound.play(0, 0, new SoundTransform(0.25));
soundPlayed = true;
}
}
private function restartJava():void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var globalDispatcher:Dispatcher = new Dispatcher();
[Bindable] private var dsOptions:ScreenshareOptions;
[Embed(source="../../assets/sounds/ScreenshareOff.mp3")]
private var noticeSoundClass:Class;
private var noticeSound:Sound = new noticeSoundClass() as Sound;
private var soundPlayed:Boolean = false;
private function displayInstall():void {
setCurrentState("displayInstall");
Expand All @@ -115,9 +120,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (ExternalInterface.available) {
var isIncognito:Function = function(args:Object):void {
incognitoLbl.visible = true;
ExternalInterface.addCallback("isIncognito", null);
ExternalInterface.addCallback("isNotIncognito", null);
};
var isNotIncognito:Function = function(args:Object):void {};
var isNotIncognito:Function = function(args:Object):void {
ExternalInterface.addCallback("isIncognito", null);
ExternalInterface.addCallback("isNotIncognito", null);
};
ExternalInterface.addCallback("isIncognito", isIncognito);
ExternalInterface.addCallback("isNotIncognito", isNotIncognito);
Expand Down Expand Up @@ -145,6 +155,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
ExternalInterface.addCallback("onSuccess", onSuccess);
ExternalInterface.call("checkChromeExtInstalled", "onSuccess", dsOptions.chromeExtensionKey);
}
private function init():void {
dsOptions = Options.getOptions(ScreenshareOptions) as ScreenshareOptions;
Expand Down Expand Up @@ -248,32 +260,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/
public function resetWidthAndHeight():void{/* do nothing */}
public function initWindow(connection:NetConnection, uri:String, useTLS:Boolean , room:String):void {
this.connection = connection;
this.uri = uri;
this.useTLS = useTLS;
this.room = room;
}
public function shareScreen(fullScreen:Boolean):void {
LOGGER.debug("Calling shareScreen");
startSharing(connection, uri, useTLS , room, fullScreen);
}
private function startSharing(connection:NetConnection, uri:String , useTLS:Boolean , room:String, fullScreen:Boolean):void {
var captureX:Number = 0;
var captureY:Number = 0;
}
public function stopSharing():void{
if (streaming) {
stopStream();
var streamEvent:WebRTCStreamEvent = new WebRTCStreamEvent(WebRTCStreamEvent.STOP);
dispatchEvent(streamEvent);
}
streaming = false;
closeWindow();
//closeWindow();
}
public function stopSharingEvent(evt:StopSharingButtonEvent):void{
Expand Down Expand Up @@ -427,12 +421,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
video.y = videoHolder.y = (this.height - VID_HEIGHT_PAD - vidH) / 2;
}
private function stopStream():void{
private function stopStream():void {
streaming = false;
if (ns != null) {
ns.close();
}
if (connection != null) {
connection.close();
}
}
private function onAsyncError(e:AsyncErrorEvent):void{
Expand Down Expand Up @@ -479,9 +476,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function closeWindow():void {
// Have to remove the callback so we can garbage collect
ExternalInterface.addCallback("onFail", null);
// LOGGER.debug("Calling stopApplet in closeWindow()");
dispatchEvent(new WebRTCShareWindowEvent(WebRTCShareWindowEvent.CLOSE));
globalDispatcher.dispatchEvent(new DeskshareToolbarEvent(DeskshareToolbarEvent.STOP));
globalDispatcher.dispatchEvent(new DeskshareToolbarEvent(DeskshareToolbarEvent.STOP));
if (!soundPlayed) {
trace("playing from webrtc publish window");
var tSC:SoundChannel = noticeSound.play(0, 0, new SoundTransform(0.25));
soundPlayed = true;
}
}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,9 @@ package org.bigbluebutton.modules.users.services
if (UsersUtil.isMe(userId)) {
LiveMeeting.inst().me.role = role;
dispatcher.dispatchEvent(new ChangeMyRole(role));

// need to fake a new lock settings so that the lock state gets revalidated
UsersUtil.applyLockSettings();
}

dispatcher.dispatchEvent(new UserStatusChangedEvent(userId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,13 @@
muteImg.filters = null;
var ls:LockSettingsVO = UsersUtil.getLockSettings();
var amIMod:Boolean = UsersUtil.amIModerator();
if (data != null) {
var allowModeratorToSeeOwnSettings: Boolean = !data.me || (data.me && UsersUtil.amIModerator());
settingsBtn.visible = rolledOver && allowModeratorToSeeOwnSettings && !UsersUtil.isBreakout();
if (!data.inVoiceConf) {
if ( !data.inVoiceConf || ( options.moderatorUnmute == false && amIMod && !UsersUtil.isMe(data.userId) ) ) {
muteImg.visible = false;
muteImg.includeInLayout = false;
muteBtn.visible = false;
Expand All @@ -210,7 +211,7 @@
muteImg.includeInLayout = true;
muteBtn.visible = false;
muteBtn.includeInLayout = false;
} else if (data.locked && ls.getDisableMic()) {
} else if (!amIMod && data.locked && ls.getDisableMic()) {
muteImg.visible = true;
muteImg.includeInLayout = true;
muteBtn.visible = false;
Expand Down
11 changes: 6 additions & 5 deletions bigbluebutton-config/bin/bbb-conf
Original file line number Diff line number Diff line change
Expand Up @@ -1792,11 +1792,12 @@ if [ -n "$HOST" ]; then
#

echo "Assigning $HOST for http[s]:// in /var/www/bigbluebutton/client/conf/config.xml"
chromeExtensionLinkURL=$(cat /var/www/bigbluebutton/client/conf/config.xml | sed -n '/chromeExtensionLink/{s/.*https*:\/\///;s/\/.*//;p}')
sudo sed -i "s/http[s]*:\/\/\([^\"\/]*\)\([\"\/]\)/$PROTOCOL_HTTP:\/\/$HOST\2/g" \
/var/www/bigbluebutton/client/conf/config.xml
sudo sed -i "s/chromeExtensionLink=\"https:\/\/[^\/]*/chromeExtensionLink=\"https:\/\/$chromeExtensionLinkURL/g" \
/var/www/bigbluebutton/client/conf/config.xml
sudo sed -i "s/http[s]*:\/\/\([^\"\/]*\)\([\"\/]\)/$PROTOCOL_HTTP:\/\/$HOST\2/g" /var/www/bigbluebutton/client/conf/config.xml
if ! echo "$chromeExtensionLinkURL" | grep -q '""'; then
sudo sed -i "s/chromeExtensionLink=\"https:\/\/[^\/]*/chromeExtensionLink=\"https:\/\/$chromeExtensionLinkURL/g" \
/var/www/bigbluebutton/client/conf/config.xml
fi


echo "Assigning $HOST for publishURI in /var/www/bigbluebutton/client/conf/config.xml"
sudo sed -i "s/publishURI=\"[^\"]*\"/publishURI=\"$HOST\"/" /var/www/bigbluebutton/client/conf/config.xml
Expand Down
2 changes: 1 addition & 1 deletion bigbluebutton-html5/client/main.html
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<style>
html {
box-sizing: border-box;
Expand Down
2 changes: 2 additions & 0 deletions bigbluebutton-html5/imports/api/audio/client/bridge/base.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export default class BaseAudioBridge {
REQUEST_TIMEOUT: 'REQUEST_TIMEOUT',
GENERIC_ERROR: 'GENERIC_ERROR',
MEDIA_ERROR: 'MEDIA_ERROR',
WEBRTC_NOT_SUPPORTED: 'WEBRTC_NOT_SUPPORTED',
ICE_NEGOTIATION_FAILED: 'ICE_NEGOTIATION_FAILED',
};

this.baseCallStates = {
Expand Down
35 changes: 28 additions & 7 deletions bigbluebutton-html5/imports/api/audio/client/bridge/sip.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const MEDIA_TAG = MEDIA.mediaTag;
const CALL_TRANSFER_TIMEOUT = MEDIA.callTransferTimeout;
const CALL_HANGUP_TIMEOUT = MEDIA.callHangupTimeout;
const CALL_HANGUP_MAX_RETRIES = MEDIA.callHangupMaximumRetries;
const CONNECTION_TERMINATED_EVENTS = ['iceConnectionFailed', 'iceConnectionClosed'];

const fetchStunTurnServers = (sessionToken) => {
const handleStunTurnResponse = ({ stunServers, turnServers }) => {
Expand Down Expand Up @@ -76,6 +77,20 @@ export default class SIPBridge extends BaseAudioBridge {
[causes.REQUEST_TIMEOUT]: this.baseErrorCodes.REQUEST_TIMEOUT,
[causes.INVALID_TARGET]: this.baseErrorCodes.INVALID_TARGET,
[causes.CONNECTION_ERROR]: this.baseErrorCodes.CONNECTION_ERROR,
[causes.WEBRTC_NOT_SUPPORTED]: this.baseErrorCodes.WEBRTC_NOT_SUPPORTED,
};
this.webRtcError = {
1001: '1001',
1002: '1002',
1003: '1003',
1004: '1004',
1005: '1005',
1006: '1006',
1007: '1007',
1008: '1008',
1009: '1009',
1010: '1010',
1011: '1011',
};
}

Expand Down Expand Up @@ -168,6 +183,10 @@ export default class SIPBridge extends BaseAudioBridge {
return new Promise((resolve, reject) => {
let hangupRetries = 0;
let hangup = false;
const { mediaHandler } = this.currentSession;

// Removing termination events to avoid triggering an error
CONNECTION_TERMINATED_EVENTS.forEach(e => mediaHandler.off(e));
const tryHangup = () => {
this.currentSession.bye();
hangupRetries += 1;
Expand Down Expand Up @@ -229,19 +248,22 @@ export default class SIPBridge extends BaseAudioBridge {
resolve(userAgent);
};

const handleUserAgentDisconnection = () => {
const handleUserAgentDisconnection = (event) => {
userAgent.stop();
userAgent = null;
const { lastTransportError } = event.transport;
const errorCode = lastTransportError.code;
const error = this.webRtcError[errorCode] || this.baseErrorCodes.CONNECTION_ERROR;
this.callback({
status: this.baseCallStates.failed,
error: this.baseErrorCodes.CONNECTION_ERROR,
error,
bridgeError: 'User Agent Disconnected',
});
reject(this.baseErrorCodes.CONNECTION_ERROR);
};

userAgent.on('connected', handleUserAgentConnection);
userAgent.on('disconnected', handleUserAgentDisconnection);
userAgent.on('disconnected', handleUserAgentDisconnection);

userAgent.start();
});
Expand Down Expand Up @@ -311,16 +333,15 @@ export default class SIPBridge extends BaseAudioBridge {
};
currentSession.on('terminated', handleSessionTerminated);

const connectionTerminatedEvents = ['iceConnectionFailed', 'iceConnectionDisconnected'];
const handleConnectionTerminated = (peer) => {
connectionTerminatedEvents.forEach(e => mediaHandler.off(e, handleConnectionTerminated));
CONNECTION_TERMINATED_EVENTS.forEach(e => mediaHandler.off(e, handleConnectionTerminated));
this.callback({
status: this.baseCallStates.failed,
error: this.baseErrorCodes.CONNECTION_ERROR,
error: this.baseErrorCodes.ICE_NEGOTIATION_FAILED,
bridgeError: peer,
});
};
connectionTerminatedEvents.forEach(e => mediaHandler.on(e, handleConnectionTerminated));
CONNECTION_TERMINATED_EVENTS.forEach(e => mediaHandler.on(e, handleConnectionTerminated));

this.currentSession = currentSession;
});
Expand Down
Loading

0 comments on commit eca2e50

Please sign in to comment.