diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 8fd2ab3e..dd436933 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -437,11 +437,10 @@ class TaskGather extends Task { } async _resolve(reason, evt) { + this.logger.debug(`TaskGather:resolve with reason ${reason}`); if (this.resolved) return; - if (this.callSession && this.callSession.callGone) return; this.resolved = true; - this.logger.info(`TaskGather:resolve with reason ${reason}`); clearTimeout(this.interDigitTimer); this.span.setAttributes({'stt.resolve': reason, 'stt.result': JSON.stringify(evt)}); @@ -451,6 +450,13 @@ class TaskGather extends Task { } this._clearTimer(); + + if (this.callSession && this.callSession.callGone) { + this.logger.debug('TaskGather:_resolve - call is gone, not invoking web callback'); + this.notifyTaskDone(); + return; + } + if (reason.startsWith('dtmf')) { if (this.parentTask) this.parentTask.emit('dtmf', evt); else {