gather: dont send webhook if call is gone

This commit is contained in:
Dave Horton
2022-03-31 15:25:20 -04:00
parent a8646548cd
commit c77611f034

View File

@@ -226,6 +226,7 @@ class TaskGather extends Task {
if (this.vad?.enable) {
opts.START_RECOGNIZING_ON_VAD = 1;
if (this.vad.voiceMs) opts.RECOGNIZER_VAD_VOICE_MS = this.vad.voiceMs;
else opts.RECOGNIZER_VAD_VOICE_MS = 125;
if (this.vad.mode >= 0 && this.vad.mode <= 3) opts.RECOGNIZER_VAD_MODE = this.vad.mode;
}
@@ -437,6 +438,8 @@ class TaskGather extends Task {
async _resolve(reason, evt) {
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);