forked from bigbluebutton/bigbluebutton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v2.2.x-release' of github.com:bigbluebutton/bigbluebutt…
…on into pres-url-on-page-convert
- Loading branch information
Showing
17 changed files
with
340 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
bigbluebutton-html5/imports/api/voice-call-states/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
|
||
const VoiceCallStates = new Mongo.Collection('voiceCallStates'); | ||
|
||
if (Meteor.isServer) { | ||
// types of queries for the voice users: | ||
// 1. intId | ||
// 2. meetingId, intId | ||
|
||
VoiceCallStates._ensureIndex({ meetingId: 1, userId: 1 }); | ||
} | ||
|
||
export default VoiceCallStates; |
4 changes: 4 additions & 0 deletions
4
bigbluebutton-html5/imports/api/voice-call-states/server/eventHandlers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import RedisPubSub from '/imports/startup/server/redis'; | ||
import handleVoiceCallStateEvent from './handlers/voiceCallStateEvent'; | ||
|
||
RedisPubSub.on('VoiceCallStateEvtMsg', handleVoiceCallStateEvent); |
48 changes: 48 additions & 0 deletions
48
bigbluebutton-html5/imports/api/voice-call-states/server/handlers/voiceCallStateEvent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { check } from 'meteor/check'; | ||
import VoiceCallState from '/imports/api/voice-call-states'; | ||
import Logger from '/imports/startup/server/logger'; | ||
|
||
// "CALL_STARTED", "IN_ECHO_TEST", "IN_CONFERENCE", "CALL_ENDED" | ||
|
||
export default function handleVoiceCallStateEvent({ body }, meetingId) { | ||
const { | ||
voiceConf, | ||
clientSession, | ||
userId, | ||
callerName, | ||
callState, | ||
} = body; | ||
|
||
check(meetingId, String); | ||
check(voiceConf, String); | ||
check(clientSession, String); | ||
check(userId, String); | ||
check(callerName, String); | ||
check(callState, String); | ||
|
||
const selector = { | ||
meetingId, | ||
userId, | ||
clientSession, | ||
}; | ||
|
||
const modifier = { | ||
$set: { | ||
meetingId, | ||
userId, | ||
voiceConf, | ||
clientSession, | ||
callState, | ||
}, | ||
}; | ||
|
||
const cb = (err) => { | ||
if (err) { | ||
return Logger.error(`Update voice call state=${userId}: ${err}`); | ||
} | ||
|
||
return Logger.debug(`Update voice call state=${userId} meeting=${meetingId} clientSession=${clientSession}`); | ||
}; | ||
|
||
return VoiceCallState.upsert(selector, modifier, cb); | ||
} |
2 changes: 2 additions & 0 deletions
2
bigbluebutton-html5/imports/api/voice-call-states/server/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import './eventHandlers'; | ||
import './publishers'; |
14 changes: 14 additions & 0 deletions
14
bigbluebutton-html5/imports/api/voice-call-states/server/modifiers/clearVoiceCallStates.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Logger from '/imports/startup/server/logger'; | ||
import VoiceCallStates from '/imports/api/voice-users'; | ||
|
||
export default function clearVoiceCallStates(meetingId) { | ||
if (meetingId) { | ||
return VoiceCallStates.remove({ meetingId }, () => { | ||
Logger.info(`Cleared VoiceCallStates in (${meetingId})`); | ||
}); | ||
} | ||
|
||
return VoiceCallStates.remove({}, () => { | ||
Logger.info('Cleared VoiceCallStates in all meetings'); | ||
}); | ||
} |
22 changes: 22 additions & 0 deletions
22
bigbluebutton-html5/imports/api/voice-call-states/server/publishers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import VoiceCallStates from '/imports/api/voice-call-states'; | ||
import { Meteor } from 'meteor/meteor'; | ||
import Logger from '/imports/startup/server/logger'; | ||
import { extractCredentials } from '/imports/api/common/server/helpers'; | ||
|
||
function voiceCallStates() { | ||
if (!this.userId) { | ||
return VoiceCallStates.find({ meetingId: '' }); | ||
} | ||
const { meetingId, requesterUserId } = extractCredentials(this.userId); | ||
|
||
Logger.debug(`Publishing Voice Call States for ${meetingId} ${requesterUserId}`); | ||
|
||
return VoiceCallStates.find({ meetingId, userId: requesterUserId }); | ||
} | ||
|
||
function publish(...args) { | ||
const boundVoiceCallStates = voiceCallStates.bind(this); | ||
return boundVoiceCallStates(...args); | ||
} | ||
|
||
Meteor.publish('voice-call-states', publish); |
8 changes: 8 additions & 0 deletions
8
bigbluebutton-html5/imports/api/voice-call-states/utils/callStates.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const CallStateOptions = { | ||
CALL_STARTED: 'CALL_STARTED', | ||
IN_ECHO_TEST: 'IN_ECHO_TEST', | ||
IN_CONFERENCE: 'IN_CONFERENCE', | ||
CALL_ENDED: 'CALL_ENDED', | ||
}; | ||
|
||
export default CallStateOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.