mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-01-25 02:07:56 +00:00
* fix #1466: * do not send tts streaming events when we are not doing tts streaming
This commit is contained in:
@@ -291,7 +291,7 @@ router.post('/',
|
|||||||
}, {
|
}, {
|
||||||
...(account.enable_debug_log && {level: 'debug'})
|
...(account.enable_debug_log && {level: 'debug'})
|
||||||
});
|
});
|
||||||
app.requestor.logger = app.notifier.logger = sipLogger;
|
app.requestor.logger = app.notifier.logger = restDial.logger = sipLogger;
|
||||||
const callInfo = new CallInfo({
|
const callInfo = new CallInfo({
|
||||||
direction: CallDirection.Outbound,
|
direction: CallDirection.Outbound,
|
||||||
req: inviteReq,
|
req: inviteReq,
|
||||||
|
|||||||
@@ -927,7 +927,7 @@ class CallSession extends Emitter {
|
|||||||
this.logger.debug('CallSession:enableBackgroundTtsStream - ttsStream enabled');
|
this.logger.debug('CallSession:enableBackgroundTtsStream - ttsStream enabled');
|
||||||
} else {
|
} else {
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
'CallSession:enableBackgroundTtsStream - ignoring request as call does not have required conditions');
|
'CallSession:enableBackgroundTtsStream - ignoring request; conditions not met (probably not using ws api)');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.info({err, say}, 'CallSession:enableBackgroundTtsStream - Error creating background tts stream task');
|
this.logger.info({err, say}, 'CallSession:enableBackgroundTtsStream - Error creating background tts stream task');
|
||||||
@@ -941,17 +941,19 @@ class CallSession extends Emitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearTtsStream() {
|
clearTtsStream() {
|
||||||
|
if (this.isTtsStreamEnabled) {
|
||||||
this.requestor?.request('tts:streaming-event', '/streaming-event', {event_type: 'user_interruption'})
|
this.requestor?.request('tts:streaming-event', '/streaming-event', {event_type: 'user_interruption'})
|
||||||
.catch((err) => this.logger.info({err}, 'CallSession:clearTtsStream - Error sending user_interruption'));
|
.catch((err) => this.logger.info({err}, 'CallSession:clearTtsStream - Error sending user_interruption'));
|
||||||
this.ttsStreamingBuffer?.clear();
|
this.ttsStreamingBuffer?.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
startTtsStream() {
|
startTtsStream() {
|
||||||
this.ttsStreamingBuffer?.start();
|
this.ttsStreamingBuffer?.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
stopTtsStream() {
|
stopTtsStream() {
|
||||||
if (this.appIsUsingWebsockets) {
|
if (this.isTtsStreamEnabled) {
|
||||||
this.requestor?.request('tts:streaming-event', '/streaming-event', {event_type: 'stream_closed'})
|
this.requestor?.request('tts:streaming-event', '/streaming-event', {event_type: 'stream_closed'})
|
||||||
.catch((err) => this.logger.info({err}, 'CallSession:clearTtsStream - Error sending user_interruption'));
|
.catch((err) => this.logger.info({err}, 'CallSession:clearTtsStream - Error sending user_interruption'));
|
||||||
this.ttsStreamingBuffer?.stop();
|
this.ttsStreamingBuffer?.stop();
|
||||||
|
|||||||
@@ -881,7 +881,7 @@ class TaskGather extends SttTask {
|
|||||||
this._fillerNoiseOn = false; // in a race, if we just started audio it may sneak through here
|
this._fillerNoiseOn = false; // in a race, if we just started audio it may sneak through here
|
||||||
this.ep.api('uuid_break', this.ep.uuid)
|
this.ep.api('uuid_break', this.ep.uuid)
|
||||||
.catch((err) => this.logger.info(err, 'Error killing audio'));
|
.catch((err) => this.logger.info(err, 'Error killing audio'));
|
||||||
cs.clearTtsStream();
|
if (cs.isTtsStreamEnabled) cs.clearTtsStream();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ class SttLatencyCalculator extends Emitter {
|
|||||||
|
|
||||||
calculateLatency() {
|
calculateLatency() {
|
||||||
if (!this.isRunning) {
|
if (!this.isRunning) {
|
||||||
this.logger.debug('Latency calculator is not running, cannot calculate latency, returning default values');
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ class TtsStreamingBuffer extends Emitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
this.logger.debug('TtsStreamingBuffer:clear');
|
|
||||||
if (this._connectionStatus !== TtsStreamingConnectionStatus.Connected) return;
|
if (this._connectionStatus !== TtsStreamingConnectionStatus.Connected) return;
|
||||||
clearTimeout(this.timer);
|
clearTimeout(this.timer);
|
||||||
this._api(this.ep, [this.ep.uuid, 'clear']).catch((err) =>
|
this._api(this.ep, [this.ep.uuid, 'clear']).catch((err) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user