mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
add support for conference members joining in a muted state
This commit is contained in:
@@ -468,12 +468,12 @@ class CallSession extends Emitter {
|
|||||||
task.doConferenceHold(this, opts);
|
task.doConferenceHold(this, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _lccConfMute(callSid, mute) {
|
async _lccConfMuteStatus(callSid, opts) {
|
||||||
const task = this.currentTask;
|
const task = this.currentTask;
|
||||||
if (!task || TaskName.Conference !== task.name || !this.isInConference) {
|
if (!task || TaskName.Conference !== task.name || !this.isInConference) {
|
||||||
return this.logger.info('CallSession:_lccConfMute - invalid command as call is not in conference');
|
return this.logger.info('CallSession:_lccConfHoldStatus - invalid command as call is not in conference');
|
||||||
}
|
}
|
||||||
task.doConferenceMuteNonModerators(this, mute);
|
task.doConferenceMuteNonModerators(this, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -548,8 +548,8 @@ class CallSession extends Emitter {
|
|||||||
else if (opts.conf_hold_status) {
|
else if (opts.conf_hold_status) {
|
||||||
await this._lccConfHoldStatus(callSid, opts);
|
await this._lccConfHoldStatus(callSid, opts);
|
||||||
}
|
}
|
||||||
else if ('mute_conference' in opts) {
|
else if (opts.conf_mute_status) {
|
||||||
await this._lccConfMute(callSid, opts.mute_conference);
|
await this._lccConfMuteStatus(callSid, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
// whisper may be the only thing we are asked to do, or it may that
|
// whisper may be the only thing we are asked to do, or it may that
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Conference extends Task {
|
|||||||
|
|
||||||
this.confName = this.data.name;
|
this.confName = this.data.name;
|
||||||
[
|
[
|
||||||
'beep', 'startConferenceOnEnter', 'endConferenceOnExit',
|
'beep', 'startConferenceOnEnter', 'endConferenceOnExit', 'joinMuted',
|
||||||
'maxParticipants', 'waitHook', 'statusHook', 'endHook', 'enterHook'
|
'maxParticipants', 'waitHook', 'statusHook', 'endHook', 'enterHook'
|
||||||
].forEach((attr) => this[attr] = this.data[attr]);
|
].forEach((attr) => this[attr] = this.data[attr]);
|
||||||
|
|
||||||
@@ -332,6 +332,9 @@ class Conference extends Task {
|
|||||||
|
|
||||||
const opts = {};
|
const opts = {};
|
||||||
if (this.endConferenceOnExit) Object.assign(opts, {flags: {endconf: true}});
|
if (this.endConferenceOnExit) Object.assign(opts, {flags: {endconf: true}});
|
||||||
|
if (this.startConferenceOnEnter) Object.assign(opts, {flags: {moderator: true}});
|
||||||
|
if (this.joinMuted) Object.assign(opts, {flags: {mute: true}});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const {memberId, confUuid} = await this.ep.join(this.confName, opts);
|
const {memberId, confUuid} = await this.ep.join(this.confName, opts);
|
||||||
this.logger.debug({memberId, confUuid}, `Conference:_joinConference: successfully joined ${this.confName}`);
|
this.logger.debug({memberId, confUuid}, `Conference:_joinConference: successfully joined ${this.confName}`);
|
||||||
@@ -379,7 +382,8 @@ class Conference extends Task {
|
|||||||
this.emitter.emit('join', opts);
|
this.emitter.emit('join', opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
async doConferenceMuteNonModerators(cs, mute) {
|
async doConferenceMuteNonModerators(cs, opts) {
|
||||||
|
const mute = opts.conf_mute_status === 'mute';
|
||||||
assert (cs.isInConference);
|
assert (cs.isInConference);
|
||||||
|
|
||||||
this.logger.info(`Conference:doConferenceMuteNonModerators ${mute ? 'muting' : 'unmuting'} non-moderators`);
|
this.logger.info(`Conference:doConferenceMuteNonModerators ${mute ? 'muting' : 'unmuting'} non-moderators`);
|
||||||
|
|||||||
@@ -87,6 +87,7 @@
|
|||||||
"startConferenceOnEnter": "boolean",
|
"startConferenceOnEnter": "boolean",
|
||||||
"endConferenceOnExit": "boolean",
|
"endConferenceOnExit": "boolean",
|
||||||
"maxParticipants": "number",
|
"maxParticipants": "number",
|
||||||
|
"joinMuted": "boolean",
|
||||||
"actionHook": "object|string",
|
"actionHook": "object|string",
|
||||||
"waitHook": "object|string",
|
"waitHook": "object|string",
|
||||||
"statusEvents": "array",
|
"statusEvents": "array",
|
||||||
|
|||||||
Reference in New Issue
Block a user