mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
bugfix: undefined reference to endpoint and validation fix for wait tasks
This commit is contained in:
@@ -356,7 +356,7 @@ class Conference extends Task {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof this.maxParticipants === 'number' && this.maxParticipants > 1) {
|
if (typeof this.maxParticipants === 'number' && this.maxParticipants > 1) {
|
||||||
this.endpoint.api('conference', `${this.confName} set max_members ${this.maxParticipants}`)
|
this.ep.api('conference', `${this.confName} set max_members ${this.maxParticipants}`)
|
||||||
.catch((err) => this.logger.error(err, `Error setting max participants to ${this.maxParticipants}`));
|
.catch((err) => this.logger.error(err, `Error setting max participants to ${this.maxParticipants}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -448,16 +448,16 @@ class Conference extends Task {
|
|||||||
async _playHook(cs, dlg, hook, allowed = [TaskName.Play, TaskName.Say, TaskName.Pause]) {
|
async _playHook(cs, dlg, hook, allowed = [TaskName.Play, TaskName.Say, TaskName.Pause]) {
|
||||||
assert(!this._playSession);
|
assert(!this._playSession);
|
||||||
const json = await cs.application.requestor.request(hook, cs.callInfo);
|
const json = await cs.application.requestor.request(hook, cs.callInfo);
|
||||||
|
const tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata));
|
||||||
|
|
||||||
const allowedTasks = json.filter((task) => allowed.includes(task.verb));
|
const allowedTasks = tasks.filter((t) => allowed.includes(t.name));
|
||||||
if (json.length !== allowedTasks.length) {
|
if (tasks.length !== allowedTasks.length) {
|
||||||
this.logger.debug({json, allowedTasks}, 'unsupported task');
|
this.logger.debug({tasks, allowedTasks}, 'unsupported task');
|
||||||
throw new Error(`unsupported verb in dial conference wait/enterHook: only ${JSON.stringify(allowed)}`);
|
throw new Error(`unsupported verb in conference waitHook: only ${JSON.stringify(allowed)}`);
|
||||||
}
|
}
|
||||||
this.logger.debug(`Conference:_playHook: executing ${json.length} tasks`);
|
this.logger.debug(`Conference:_playHook: executing ${tasks.length} tasks`);
|
||||||
|
|
||||||
if (json.length > 0) {
|
if (tasks.length > 0) {
|
||||||
const tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata));
|
|
||||||
this._playSession = new ConfirmCallSession({
|
this._playSession = new ConfirmCallSession({
|
||||||
logger: this.logger,
|
logger: this.logger,
|
||||||
application: cs.application,
|
application: cs.application,
|
||||||
@@ -514,9 +514,6 @@ class Conference extends Task {
|
|||||||
const functionName = `_on${capitalize(camelize(action))}`;
|
const functionName = `_on${capitalize(camelize(action))}`;
|
||||||
(Conference.prototype[functionName] || unhandled).bind(this, this.logger, cs, evt)() ;
|
(Conference.prototype[functionName] || unhandled).bind(this, this.logger, cs, evt)() ;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
this.logger.debug(`Conference#__onConferenceEvent: got unhandled custom event: ${eventName}`) ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// conference event handlers
|
// conference event handlers
|
||||||
|
|||||||
Reference in New Issue
Block a user