add more logs

This commit is contained in:
akirilyuk
2022-02-04 08:26:55 +01:00
parent 50f926bce4
commit 5c8f91c1c1
2 changed files with 6 additions and 2 deletions

View File

@@ -88,6 +88,7 @@ class TaskGather extends Task {
const startListening = (cs, ep) => { const startListening = (cs, ep) => {
this._startTimer(); this._startTimer();
if (this.input.includes('speech') && !this.listenDuringPrompt) { if (this.input.includes('speech') && !this.listenDuringPrompt) {
this.logger.debug('listening after speech 1');
this._initSpeech(cs, ep) this._initSpeech(cs, ep)
.then(() => { .then(() => {
this._startTranscribing(ep); this._startTranscribing(ep);
@@ -106,6 +107,7 @@ class TaskGather extends Task {
this.logger.debug('Gather: say task completed'); this.logger.debug('Gather: say task completed');
if (!this.killed) { if (!this.killed) {
if (this.listenAfterSpeech === true) { if (this.listenAfterSpeech === true) {
this.logger.debug('listening after speech 2');
startListening(cs, ep); startListening(cs, ep);
} else { } else {
this.notifyTaskDone(); this.notifyTaskDone();
@@ -119,6 +121,7 @@ class TaskGather extends Task {
if (err) return this.logger.error({err}, 'Gather:exec Error playing url'); if (err) return this.logger.error({err}, 'Gather:exec Error playing url');
if (!this.killed) { if (!this.killed) {
if (this.listenAfterSpeech === true) { if (this.listenAfterSpeech === true) {
this.logger.debug('listening after speech 3');
startListening(cs, ep); startListening(cs, ep);
} else { } else {
this.notifyTaskDone(); this.notifyTaskDone();
@@ -130,6 +133,7 @@ class TaskGather extends Task {
else startListening(cs, ep); else startListening(cs, ep);
if (this.input.includes('speech') && this.listenDuringPrompt) { if (this.input.includes('speech') && this.listenDuringPrompt) {
this.logger.debug('listening after speech 4');
await this._initSpeech(cs, ep); await this._initSpeech(cs, ep);
this._startTranscribing(ep); this._startTranscribing(ep);
updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid) updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid)