mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
drop queue speech on barge in
This commit is contained in:
@@ -28,6 +28,19 @@ class SpeechConfig extends Emitter {
|
||||
this.logger.debug({sessionLevel: this.sessionConfig}, 'SpeechConfig updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* check if we should skip all nodes until next bot input
|
||||
*/
|
||||
get skipUntilBotInput(){
|
||||
return this.sessionConfig.bargein?.skipUntilBotInput === false;
|
||||
}
|
||||
/**
|
||||
* Check if barge is enabled on session level
|
||||
*/
|
||||
get bargeInEnabled(){
|
||||
return this.sessionConfig.bargein?.enable?.length > 0;
|
||||
}
|
||||
|
||||
makeSayTaskConfig({text, turnConfig = {}} = {}) {
|
||||
const synthesizer = lodash.merge({}, this.sessionConfig.synthesizer, turnConfig.synthesizer);
|
||||
return {
|
||||
@@ -36,7 +49,7 @@ class SpeechConfig extends Emitter {
|
||||
};
|
||||
}
|
||||
|
||||
makeGatherTaskConfig({textPrompt, urlPrompt, turnConfig = {}} = {}) {
|
||||
makeGatherTaskConfig({textPrompt, urlPrompt, turnConfig = {}, dontListenAfterSpeech} = {}) {
|
||||
// we merge from top to bottom deeply so we wil have
|
||||
// defaults from session config and then will override them via turn config
|
||||
const opts = lodash.merge(
|
||||
@@ -112,7 +125,8 @@ class SpeechConfig extends Emitter {
|
||||
noInputRetries,
|
||||
noInputSpeech,
|
||||
noInputUrl
|
||||
}
|
||||
},
|
||||
dontListenAfterSpeech
|
||||
};
|
||||
|
||||
const final = stripNulls(config);
|
||||
|
||||
Reference in New Issue
Block a user