mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
wip (#830)
* wip * wip * wip * wip * update deps * update test to use latest freeswitch image
This commit is contained in:
@@ -141,12 +141,12 @@ class TaskSay extends TtsTask {
|
||||
await this.playToConfMember(ep, memberId, confName, confUuid, filepath[segment]);
|
||||
}
|
||||
else {
|
||||
let tts_cache_filename;
|
||||
if (filepath[segment].startsWith('say:{')) {
|
||||
const isStreaming = filepath[segment].startsWith('say:{');
|
||||
if (isStreaming) {
|
||||
const arr = /^say:\{.*\}\s*(.*)$/.exec(filepath[segment]);
|
||||
if (arr) this.logger.debug(`Say:exec sending streaming tts request: ${arr[1].substring(0, 64)}..`);
|
||||
}
|
||||
else this.logger.debug(`Say:exec sending ${filepath[segment].substring(0, 64)}`);
|
||||
else this.logger.debug(`Say:exec sending ${filepath[segment].substring(0, 64)}`);
|
||||
ep.once('playback-start', (evt) => {
|
||||
this.logger.debug({evt}, 'Say got playback-start');
|
||||
if (this.otelSpan) {
|
||||
@@ -154,17 +154,19 @@ class TaskSay extends TtsTask {
|
||||
this.otelSpan.end();
|
||||
this.otelSpan = null;
|
||||
if (evt.variable_tts_cache_filename) {
|
||||
tts_cache_filename = evt.variable_tts_cache_filename;
|
||||
cs.trackTmpFile(evt.variable_tts_cache_filename);
|
||||
}
|
||||
else {
|
||||
this.logger.info('No tts_cache_filename in playback-start event');
|
||||
}
|
||||
}
|
||||
});
|
||||
ep.once('playback-stop', (evt) => {
|
||||
if (!tts_cache_filename || evt.variable_tts_cache_filename !== tts_cache_filename) {
|
||||
this.logger.info({evt}, 'Say: discarding playback-stop from other say verb');
|
||||
this.logger.debug({evt}, 'Say got playback-stop');
|
||||
if (evt.variable_tts_error) {
|
||||
writeAlerts({
|
||||
account_sid,
|
||||
alert_type: AlertType.TTS_FAILURE,
|
||||
vendor,
|
||||
detail: evt.variable_tts_error
|
||||
}).catch((err) => this.logger.info({err}, 'Error generating alert for no tts'));
|
||||
}
|
||||
else {
|
||||
this.logger.debug({evt}, 'Say got playback-stop');
|
||||
|
||||
Reference in New Issue
Block a user