mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
if dial.confirmHook returns empty array do not create a confirmSession (#513)
This commit is contained in:
@@ -326,6 +326,10 @@ class SingleDialer extends Emitter {
|
|||||||
try {
|
try {
|
||||||
// retrieve set of tasks
|
// retrieve set of tasks
|
||||||
const json = await this.requestor.request('dial:confirm', confirmHook, this.callInfo.toJSON());
|
const json = await this.requestor.request('dial:confirm', confirmHook, this.callInfo.toJSON());
|
||||||
|
if (!json || (Array.isArray(json) && json.length === 0)) {
|
||||||
|
this.logger.info('SingleDialer:_executeApp: no tasks returned from confirm hook');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata));
|
const tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata));
|
||||||
// verify it contains only allowed verbs
|
// verify it contains only allowed verbs
|
||||||
const allowedTasks = tasks.filter((task) => {
|
const allowedTasks = tasks.filter((task) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user