Merge pull request #8707 from capilkey/fs-lo-voice-call-state
Properly handle voice call state with FreeSWITCH listen-only connections
This commit is contained in:
commit
cd637bd2e7
@ -502,7 +502,8 @@ class SIPSession {
|
||||
|
||||
query.observeChanges({
|
||||
changed: (id, fields) => {
|
||||
if (fields.callState === CallStateOptions.IN_ECHO_TEST) {
|
||||
if ((this.inEchoTest && fields.callState === CallStateOptions.IN_ECHO_TEST)
|
||||
|| (!this.inEchoTest && fields.callState === CallStateOptions.IN_CONFERENCE)) {
|
||||
fsReady = true;
|
||||
checkIfCallReady();
|
||||
|
||||
|
@ -41,7 +41,7 @@ export default function handleVoiceCallStateEvent({ body }, meetingId) {
|
||||
return Logger.error(`Update voice call state=${userId}: ${err}`);
|
||||
}
|
||||
|
||||
return Logger.debug(`Update voice call state=${userId} meeting=${meetingId} clientSession=${clientSession}`);
|
||||
return Logger.debug(`Update voice call state=${userId} meeting=${meetingId} clientSession=${clientSession} callState=${callState}`);
|
||||
};
|
||||
|
||||
return VoiceCallState.upsert(selector, modifier, cb);
|
||||
|
@ -1,12 +1,10 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import listenOnlyToggle from './methods/listenOnlyToggle';
|
||||
import muteToggle from './methods/muteToggle';
|
||||
import muteAllToggle from './methods/muteAllToggle';
|
||||
import muteAllExceptPresenterToggle from './methods/muteAllExceptPresenterToggle';
|
||||
import ejectUserFromVoice from './methods/ejectUserFromVoice';
|
||||
|
||||
Meteor.methods({
|
||||
listenOnlyToggle,
|
||||
toggleVoice: muteToggle,
|
||||
muteAllUsers: muteAllToggle,
|
||||
muteAllExceptPresenter: muteAllExceptPresenterToggle,
|
||||
|
@ -1,47 +0,0 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import RedisPubSub from '/imports/startup/server/redis';
|
||||
import Logger from '/imports/startup/server/logger';
|
||||
import Meetings from '/imports/api/meetings';
|
||||
import VoiceUsers from '/imports/api/voice-users';
|
||||
import { extractCredentials } from '/imports/api/common/server/helpers';
|
||||
|
||||
export default function listenOnlyToggle(isJoining = true) {
|
||||
const REDIS_CONFIG = Meteor.settings.private.redis;
|
||||
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
||||
|
||||
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
||||
|
||||
check(isJoining, Boolean);
|
||||
|
||||
let EVENT_NAME;
|
||||
|
||||
if (isJoining) {
|
||||
EVENT_NAME = 'UserConnectedToGlobalAudioMsg';
|
||||
} else {
|
||||
EVENT_NAME = 'UserDisconnectedFromGlobalAudioMsg';
|
||||
}
|
||||
|
||||
const VoiceUser = VoiceUsers.findOne({
|
||||
intId: requesterUserId,
|
||||
meetingId,
|
||||
});
|
||||
|
||||
const Meeting = Meetings.findOne({ meetingId });
|
||||
|
||||
if (!VoiceUser) {
|
||||
throw new Meteor.Error('user-not-found', 'You need a valid user to be able to toggle audio');
|
||||
}
|
||||
|
||||
// check(User.user.name, String);
|
||||
|
||||
const payload = {
|
||||
userId: requesterUserId,
|
||||
name: VoiceUser.callerName,
|
||||
};
|
||||
|
||||
Logger.info(`VoiceUser '${requesterUserId}' ${isJoining
|
||||
? 'joined' : 'left'} global audio from meeting '${meetingId}'`);
|
||||
|
||||
return RedisPubSub.publishVoiceMessage(CHANNEL, EVENT_NAME, Meeting.voiceProp.voiceConf, payload);
|
||||
}
|
Loading…
Reference in New Issue
Block a user