gather verb should clean dtmf listerner even dtmfBargein=false (#686)

This commit is contained in:
Hoan Luu Huu authored and GitHub committed 2024-03-23 16:01:41 -04:00
1 parent 75b6f89e0c
commit 65c241bcd1
1 file changed
+2 -4
+2 -4
View File
@@ -965,10 +965,8 @@ class TaskGather extends SttTask {
// If bargin is false and ws application return ack to verb:hook
// the gather should not play any audio
this._killAudio(this.cs);
// Clear dtmf event
if (this.dtmfBargein) {
this.ep.removeAllListeners('dtmf');
}
// Clear dtmf events, to avoid any case can leak the listener, just clean it
this.ep.removeAllListeners('dtmf');
clearTimeout(this.interDigitTimer);
this._clearTimer();
this._clearFastRecognitionTimer();