diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41f5141b..de67df35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,11 @@ jobs: node-version: 20 - run: npm ci - run: npm run jslint + - name: Install Docker Compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + docker-compose --version - run: docker pull drachtio/sipp - run: npm test env: diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 5098b6d0..33f78cc6 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -873,7 +873,8 @@ class CallSession extends Emitter { writeAlerts({ alert_type: AlertType.TTS_FAILURE, account_sid: this.accountSid, - vendor + vendor, + target_sid: this.callSid }).catch((err) => this.logger.error({err}, 'Error writing tts alert')); } } @@ -996,7 +997,8 @@ class CallSession extends Emitter { writeAlerts({ alert_type: AlertType.STT_NOT_PROVISIONED, account_sid: this.accountSid, - vendor + vendor, + target_sid: this.callSid }).catch((err) => this.logger.error({err}, 'Error writing tts alert')); } } diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index fbe4ede2..28a2f77b 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -543,7 +543,8 @@ class TaskGather extends SttTask { account_sid: this.cs.accountSid, alert_type: AlertType.STT_FAILURE, vendor: this.vendor, - detail: err.message + detail: err.message, + target_sid: this.cs.callSid }); }).catch((err) => this.logger.info({err}, 'Error generating alert for tts failure')); } @@ -966,6 +967,7 @@ class TaskGather extends SttTask { alert_type: AlertType.STT_FAILURE, message: `Custom speech vendor ${this.vendor} error: ${evt.error}`, vendor: this.vendor, + target_sid: cs.callSid }).catch((err) => this.logger.info({err}, 'Error generating alert for jambonz custom connection failure')); if (!(await this._startFallback(cs, ep, evt))) { this.notifyTaskDone(); diff --git a/lib/tasks/say.js b/lib/tasks/say.js index d581ed95..5502d5eb 100644 --- a/lib/tasks/say.js +++ b/lib/tasks/say.js @@ -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) { diff --git a/lib/tasks/stt-task.js b/lib/tasks/stt-task.js index 6ad186fe..4d6df652 100644 --- a/lib/tasks/stt-task.js +++ b/lib/tasks/stt-task.js @@ -178,7 +178,8 @@ class SttTask extends Task { writeAlerts({ account_sid: cs.accountSid, alert_type: AlertType.STT_NOT_PROVISIONED, - vendor + vendor, + target_sid: cs.callSid }).catch((err) => this.logger.info({err}, 'Error generating alert for no stt')); this.notifyTaskDone(); throw new Error(`No speech-to-text service credentials for ${vendor} have been configured`); @@ -309,6 +310,7 @@ class SttTask extends Task { message: 'STT failure reported by vendor', detail: evt.error, vendor: this.vendor, + target_sid: cs.callSid }).catch((err) => this.logger.info({err}, `Error generating alert for ${this.vendor} connection failure`)); } @@ -321,6 +323,7 @@ class SttTask extends Task { alert_type: AlertType.STT_FAILURE, message: `Failed connecting to ${this.vendor} speech recognizer: ${reason}`, vendor: this.vendor, + target_sid: cs.callSid }).catch((err) => this.logger.info({err}, `Error generating alert for ${this.vendor} connection failure`)); } } diff --git a/lib/tasks/transcribe.js b/lib/tasks/transcribe.js index 5dcd40d0..1932adf9 100644 --- a/lib/tasks/transcribe.js +++ b/lib/tasks/transcribe.js @@ -605,6 +605,7 @@ class TaskTranscribe extends SttTask { alert_type: AlertType.STT_FAILURE, message: `Custom speech vendor ${this.vendor} error: ${evt.error}`, vendor: this.vendor, + target_sid: cs.callSid }).catch((err) => this.logger.info({err}, 'Error generating alert for jambonz custom connection failure')); if (!(await this._startFallback(cs, _ep, evt))) { this.notifyTaskDone(); diff --git a/lib/tasks/tts-task.js b/lib/tasks/tts-task.js index ad03eb48..b680448a 100644 --- a/lib/tasks/tts-task.js +++ b/lib/tasks/tts-task.js @@ -152,7 +152,8 @@ class TtsTask extends Task { 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')); this.notifyError({msg: 'TTS error', details: err.message || err}); throw err; diff --git a/lib/utils/amd-utils.js b/lib/utils/amd-utils.js index a981e82d..48509a08 100644 --- a/lib/utils/amd-utils.js +++ b/lib/utils/amd-utils.js @@ -210,7 +210,8 @@ module.exports = (logger) => { account_sid: cs.accountSid, alert_type: AlertType.STT_FAILURE, vendor: vendor, - detail: err.message + detail: err.message, + target_sid: cs.callSid }); }).catch((err) => logger.info({err}, 'Error generating alert for tts failure'));