gather: resolve with reason killed prevented task from ending

This commit is contained in:
Dave Horton
2022-04-05 08:15:30 -04:00
parent 49a75a3e3a
commit 077d34dc9e

View File

@@ -437,11 +437,10 @@ class TaskGather extends Task {
} }
async _resolve(reason, evt) { async _resolve(reason, evt) {
this.logger.debug(`TaskGather:resolve with reason ${reason}`);
if (this.resolved) return; if (this.resolved) return;
if (this.callSession && this.callSession.callGone) return;
this.resolved = true; this.resolved = true;
this.logger.info(`TaskGather:resolve with reason ${reason}`);
clearTimeout(this.interDigitTimer); clearTimeout(this.interDigitTimer);
this.span.setAttributes({'stt.resolve': reason, 'stt.result': JSON.stringify(evt)}); this.span.setAttributes({'stt.resolve': reason, 'stt.result': JSON.stringify(evt)});
@@ -451,6 +450,13 @@ class TaskGather extends Task {
} }
this._clearTimer(); 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 (reason.startsWith('dtmf')) {
if (this.parentTask) this.parentTask.emit('dtmf', evt); if (this.parentTask) this.parentTask.emit('dtmf', evt);
else { else {