mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
revert some changes
This commit is contained in:
@@ -100,12 +100,6 @@ class TaskGather extends Task {
|
|||||||
try {
|
try {
|
||||||
if (this.sayTask) {
|
if (this.sayTask) {
|
||||||
this.logger.debug('Gather: kicking off say task');
|
this.logger.debug('Gather: kicking off say task');
|
||||||
if (this.input.includes('speech') && this.listenDuringPrompt) {
|
|
||||||
await this._initSpeech(cs, ep);
|
|
||||||
this._startTranscribing(ep);
|
|
||||||
updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid)
|
|
||||||
.catch(() => {/*already logged error */});
|
|
||||||
}
|
|
||||||
this.sayTask.exec(cs, ep);
|
this.sayTask.exec(cs, ep);
|
||||||
this.sayTask.on('playDone', async(err) => {
|
this.sayTask.on('playDone', async(err) => {
|
||||||
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
|
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
|
||||||
@@ -120,12 +114,6 @@ class TaskGather extends Task {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (this.playTask) {
|
else if (this.playTask) {
|
||||||
if (this.listenDuringPrompt && this.input.includes('speech')) {
|
|
||||||
await this._initSpeech(cs, ep);
|
|
||||||
this._startTranscribing(ep);
|
|
||||||
updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid)
|
|
||||||
.catch(() => {/*already logged error */});
|
|
||||||
}
|
|
||||||
this.playTask.exec(cs, ep); // kicked off, _not_ waiting for it to complete
|
this.playTask.exec(cs, ep); // kicked off, _not_ waiting for it to complete
|
||||||
this.playTask.on('playDone', async(err) => {
|
this.playTask.on('playDone', async(err) => {
|
||||||
if (err) return this.logger.error({err}, 'Gather:exec Error playing url');
|
if (err) return this.logger.error({err}, 'Gather:exec Error playing url');
|
||||||
@@ -141,6 +129,13 @@ class TaskGather extends Task {
|
|||||||
}
|
}
|
||||||
else startListening(cs, ep);
|
else startListening(cs, ep);
|
||||||
|
|
||||||
|
if (this.input.includes('speech') && this.listenDuringPrompt) {
|
||||||
|
await this._initSpeech(cs, ep);
|
||||||
|
this._startTranscribing(ep);
|
||||||
|
updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid)
|
||||||
|
.catch(() => {/*already logged error */});
|
||||||
|
}
|
||||||
|
|
||||||
if (this.input.includes('digits') || this.dtmfBargein) {
|
if (this.input.includes('digits') || this.dtmfBargein) {
|
||||||
ep.on('dtmf', this._onDtmf.bind(this, cs, ep));
|
ep.on('dtmf', this._onDtmf.bind(this, cs, ep));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user