mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
Fixed Gather digits does not work without nested say/play (#914)
* Fixed Gather digits does not work without nested say/play * fix review comment * add assert to make sure we don't register dtmf twice in gather verb
This commit is contained in:
@@ -177,8 +177,10 @@ class TaskGather extends SttTask {
|
|||||||
this._startVad();
|
this._startVad();
|
||||||
|
|
||||||
const startDtmfListener = () => {
|
const startDtmfListener = () => {
|
||||||
|
assert(!this._dtmfListenerStarted);
|
||||||
if (this.input.includes('digits') || this.dtmfBargein || this.asrDtmfTerminationDigit) {
|
if (this.input.includes('digits') || this.dtmfBargein || this.asrDtmfTerminationDigit) {
|
||||||
ep.on('dtmf', this._onDtmf.bind(this, cs, ep));
|
ep.on('dtmf', this._onDtmf.bind(this, cs, ep));
|
||||||
|
this._dtmfListenerStarted = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -281,7 +283,8 @@ class TaskGather extends SttTask {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.listenDuringPrompt) {
|
// https://github.com/jambonz/jambonz-feature-server/issues/913
|
||||||
|
if (this.listenDuringPrompt || (!this.sayTask && !this.playTask)) {
|
||||||
startDtmfListener();
|
startDtmfListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user