Skip to content
Snippets Groups Projects
Commit ba05ea91 authored by Richard Alam's avatar Richard Alam
Browse files

Merge branch 'master' of https://github.com/bigbluebutton/bigbluebutton into bbb-2.x-dev-mconf

parents 2fd18e7c c2b6f48b
No related branches found
No related tags found
No related merge requests found
......@@ -24,30 +24,26 @@ export default class SIPBridge extends BaseAudioBridge {
// Periodically check the status of the WebRTC call, when a call has been established attempt to
// hangup, retry if a call is in progress, send the leave voice conference message to BBB
exitAudio(afterExitCall = () => {}) {
// To be called when the hangup is initiated
exitAudio(isListenOnly, afterExitCall = () => {}) {
// To be called when the hangup is confirmed
const hangupCallback = function () {
console.log('Exiting Voice Conference');
console.log('Exited Voice Conference, listenOnly=' + isListenOnly);
// notify BBB-apps we are leaving the call if we are in listen only mode
if (isListenOnly) {
callServer('listenOnlyToggle', false);
}
};
// Checks periodically until a call is established so we can successfully end the call
// clean state
// Checks periodically until a call is established so we can successfully end the call clean state
triedHangup = false;
// function to initiate call
const checkToHangupCall = ((context, afterExitCall = () => {}) => {
// if an attempt to hang up the call is made when the current session is not yet finished,
// the request has no effect
// keep track in the session if we haven't tried a hangup
// the request has no effect keep track in the session if we haven't tried a hangup
if (window.getCallStatus() != null && !triedHangup) {
console.log('Attempting to hangup on WebRTC call');
// notify BBB-apps we are leaving the call call if we are listen only
if (this.userData.listenOnly) {
callServer('listenOnlyToggle', false);
}
window.webrtc_hangup(hangupCallback);
// we have hung up, prevent retries
......
......@@ -13,7 +13,7 @@ export default class VertoBridge extends BaseAudioBridge {
this.vertoUsername = 'FreeSWITCH User - ' + encodeURIComponent(username);
}
exitAudio() {
exitAudio(listenOnly) {
window.vertoExitAudio();
}
......
import { callServer } from '/imports/ui/services/api';
import BaseAudioBridge from '../bridge/base';
import VertoBridge from '../bridge/verto';
import SIPBridge from '../bridge/sip';
......@@ -13,15 +12,16 @@ export default class AudioManager {
}
this.bridge = audioBridge;
this.isListenOnly = false;
}
exitAudio () {
this.bridge.exitAudio();
this.bridge.exitAudio(this.isListenOnly);
}
joinAudio(listenOnly) {
if (listenOnly) {
callServer('listenOnlyToggle', true);
this.isListenOnly = true;
this.bridge.joinListenOnly();
} else {
this.bridge.joinMicrophone();
......
......@@ -17,7 +17,6 @@ const init = () => {
const userId = Auth.userID;
const User = Users.findOne({ userId });
const username = User.user.name;
const listenOnly = User.user.listenOnly;
const Meeting = Meetings.findOne(); //TODO test this with Breakouts
const turns = Meeting.turns;
......@@ -27,7 +26,6 @@ const init = () => {
const userData = {
userId,
username,
listenOnly,
turns,
stuns,
voiceBridge,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment