Compare commits

...

1 Commits

Author SHA1 Message Date
Dave Horton
9a27f53b81 if dial.confirmHook returns empty array do not create a confirmSession 2023-11-01 08:32:19 -04:00

View File

@@ -326,6 +326,10 @@ class SingleDialer extends Emitter {
try {
// retrieve set of tasks
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));
// verify it contains only allowed verbs
const allowedTasks = tasks.filter((task) => {