add tag task and varioius cleanup

This commit is contained in:
Dave Horton
2020-01-29 15:27:20 -05:00
parent bed4fa1f42
commit 92acd50595
17 changed files with 278 additions and 111 deletions

View File

@@ -62,7 +62,7 @@ class TaskGather extends Task {
this._startTranscribing(ep);
}
if (this.input.includes('dtmf')) {
if (this.input.includes('digits')) {
ep.on('dtmf', this._onDtmf.bind(this, ep));
}
@@ -129,8 +129,14 @@ class TaskGather extends Task {
}
_killAudio() {
if (this.sayTask && !this.sayTask.killed) this.sayTask.kill();
if (this.playTask && !this.playTask.killed) this.playTask.kill();
if (this.sayTask && !this.sayTask.killed) {
this.sayTask.removeAllListeners('playDone');
this.sayTask.kill();
}
if (this.playTask && !this.playTask.killed) {
this.playTask.removeAllListeners('playDone');
this.playTask.kill();
}
}
_onTranscription(ep, evt) {