diff --git a/lib/tasks/conference.js b/lib/tasks/conference.js index 55afc864..4a7a6200 100644 --- a/lib/tasks/conference.js +++ b/lib/tasks/conference.js @@ -356,7 +356,7 @@ class Conference extends Task { } 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}`)); } } @@ -448,16 +448,16 @@ class Conference extends Task { async _playHook(cs, dlg, hook, allowed = [TaskName.Play, TaskName.Say, TaskName.Pause]) { assert(!this._playSession); 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)); - if (json.length !== allowedTasks.length) { - this.logger.debug({json, allowedTasks}, 'unsupported task'); - throw new Error(`unsupported verb in dial conference wait/enterHook: only ${JSON.stringify(allowed)}`); + const allowedTasks = tasks.filter((t) => allowed.includes(t.name)); + if (tasks.length !== allowedTasks.length) { + this.logger.debug({tasks, allowedTasks}, 'unsupported task'); + 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) { - const tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata)); + if (tasks.length > 0) { this._playSession = new ConfirmCallSession({ logger: this.logger, application: cs.application, @@ -514,9 +514,6 @@ class Conference extends Task { const functionName = `_on${capitalize(camelize(action))}`; (Conference.prototype[functionName] || unhandled).bind(this, this.logger, cs, evt)() ; } - else { - this.logger.debug(`Conference#__onConferenceEvent: got unhandled custom event: ${eventName}`) ; - } } // conference event handlers