add reason property to gather action

This commit is contained in:
Dave Horton
2021-02-23 08:10:31 -05:00
parent 70e4e10a70
commit c6168ce994
3 changed files with 38 additions and 63 deletions

View File

@@ -201,10 +201,13 @@ class TaskGather extends Task {
this._clearTimer();
if (reason.startsWith('dtmf')) {
await this.performAction({digits: this.digitBuffer});
await this.performAction({reason: 'dtmfDetected', digits: this.digitBuffer});
}
else if (reason.startsWith('speech')) {
await this.performAction({speech: evt});
await this.performAction({reason: 'speechDetected', speech: evt});
}
else if (reason.startsWith('timeout')) {
await this.performAction({reason: 'inputTimeout'});
}
this.notifyTaskDone();
}