feat/836: capturing callSid for STT and TTS alerts (#838)

* feat/836: capturing callSid for STT and TTS alerts

* feat/836: corrected assignment of callSid and added target_sid at few more alerts

* update github action

---------

Co-authored-by: Quan HL <quan.luuhoang8@gmail.com>
This commit is contained in:
rammohan-kore
2024-08-05 21:44:08 +05:30
committed by GitHub
parent b7a3c2970a
commit e4e37d5697
8 changed files with 28 additions and 10 deletions

View File

@@ -114,7 +114,8 @@ class TaskSay extends TtsTask {
writeAlerts({
account_sid,
alert_type: AlertType.TTS_NOT_PROVISIONED,
vendor
vendor,
target_sid: cs.callSid
}).catch((err) => this.logger.info({err}, 'Error generating alert for no tts'));
throw new Error('no provisioned speech credentials for TTS');
}
@@ -185,7 +186,8 @@ class TaskSay extends TtsTask {
account_sid: cs.accountSid,
alert_type: AlertType.TTS_FAILURE,
vendor,
detail: err.message
detail: err.message,
target_sid: cs.callSid
}).catch((err) => this.logger.info({err}, 'Error generating alert for tts failure'));
throw err;
}
@@ -201,7 +203,7 @@ class TaskSay extends TtsTask {
}
async exec(cs, {ep}) {
const {srf, accountSid:account_sid} = cs;
const {srf, accountSid:account_sid, callSid:target_sid} = cs;
const {writeAlerts, AlertType} = srf.locals;
const {addFileToCache} = srf.locals.dbHelpers;
const engine = this.synthesizer.engine || cs.synthesizer?.engine || 'neural';
@@ -312,7 +314,8 @@ class TaskSay extends TtsTask {
account_sid,
alert_type: AlertType.TTS_FAILURE,
vendor,
detail: evt.variable_tts_error
detail: evt.variable_tts_error,
target_sid
}).catch((err) => this.logger.info({err}, 'Error generating alert for no tts'));
}
if (evt.variable_tts_cache_filename && !this.killed) {