mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
add support for muting/unmuting non moderators in a conference
This commit is contained in:
@@ -468,6 +468,14 @@ class CallSession extends Emitter {
|
||||
task.doConferenceHold(this, opts);
|
||||
}
|
||||
|
||||
async _lccConfMute(callSid, mute) {
|
||||
const task = this.currentTask;
|
||||
if (!task || TaskName.Conference !== task.name || !this.isInConference) {
|
||||
return this.logger.info('CallSession:_lccConfMute - invalid command as call is not in conference');
|
||||
}
|
||||
task.doConferenceMuteNonModerators(this, mute);
|
||||
}
|
||||
|
||||
/**
|
||||
* perform live call control -- whisper to one party or the other on a call
|
||||
* @param {array} opts - array of play or say tasks
|
||||
@@ -540,6 +548,9 @@ class CallSession extends Emitter {
|
||||
else if (opts.conf_hold_status) {
|
||||
await this._lccConfHoldStatus(callSid, opts);
|
||||
}
|
||||
else if ('mute_conference' in opts) {
|
||||
await this._lccConfMute(callSid, opts.mute_conference);
|
||||
}
|
||||
|
||||
// whisper may be the only thing we are asked to do, or it may that
|
||||
// we are doing a whisper after having muted, paused reccording etc..
|
||||
|
||||
@@ -379,6 +379,19 @@ class Conference extends Task {
|
||||
this.emitter.emit('join', opts);
|
||||
}
|
||||
|
||||
async doConferenceMuteNonModerators(cs, mute) {
|
||||
assert (cs.isInConference);
|
||||
|
||||
this.logger.info(`Conference:doConferenceMuteNonModerators ${mute ? 'muting' : 'unmuting'} non-moderators`);
|
||||
this.ep.api(`conference ${this.confName} ${mute ? 'mute' : 'unmute'} non_moderator`)
|
||||
.catch((err) => this.logger.info({err}, 'Error muting or unmuting non_moderators'));
|
||||
|
||||
if (this.conf_hold_status !== 'hold' && this._playSession) {
|
||||
this._playSession.kill();
|
||||
this._playSession = null;
|
||||
}
|
||||
}
|
||||
|
||||
async doConferenceHold(cs, opts) {
|
||||
assert (cs.isInConference);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user