mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
include fallback speech selections, if any, in the initial webhook (#464)
This commit is contained in:
@@ -299,22 +299,30 @@ module.exports = function(srf, logger) {
|
|||||||
if (app.app_json) {
|
if (app.app_json) {
|
||||||
json = JSON.parse(app.app_json);
|
json = JSON.parse(app.app_json);
|
||||||
} else {
|
} else {
|
||||||
|
const defaults = {
|
||||||
|
synthesizer: {
|
||||||
|
vendor: app.speech_synthesis_vendor,
|
||||||
|
...(app.speech_synthesis_label && {label: app.speech_synthesis_label}),
|
||||||
|
language: app.speech_synthesis_language,
|
||||||
|
voice: app.speech_synthesis_voice,
|
||||||
|
...(app.fallback_speech_synthesis_vendor && {fallback_vendor: app.fallback_speech_synthesis_vendor}),
|
||||||
|
...(app.fallback_speech_synthesis_label && {fallback_label: app.fallback_speech_synthesis_label}),
|
||||||
|
...(app.fallback_speech_synthesis_language && {fallback_language: app.fallback_speech_synthesis_language}),
|
||||||
|
...(app.fallback_speech_synthesis_voice && {fallback_voice: app.fallback_speech_synthesis_voice})
|
||||||
|
},
|
||||||
|
recognizer: {
|
||||||
|
vendor: app.speech_recognizer_vendor,
|
||||||
|
...(app.speech_synthesis_label && {label: app.speech_synthesis_label}),
|
||||||
|
language: app.speech_recognizer_language,
|
||||||
|
...(app.fallback_speech_recognizer_vendor && {fallback_vendor: app.fallback_speech_recognizer_vendor}),
|
||||||
|
...(app.fallback_speech_recognizer_label && {fallback_label: app.fallback_speech_recognizer_label}),
|
||||||
|
...(app.fallback_speech_recognizer_language && {fallback_language: app.fallback_speech_recognizer_language})
|
||||||
|
}
|
||||||
|
};
|
||||||
const params = Object.assign(['POST', 'WS'].includes(app.call_hook.method) ? { sip: req.msg } : {},
|
const params = Object.assign(['POST', 'WS'].includes(app.call_hook.method) ? { sip: req.msg } : {},
|
||||||
req.locals.callInfo,
|
req.locals.callInfo,
|
||||||
{ service_provider_sid: req.locals.service_provider_sid },
|
{ service_provider_sid: req.locals.service_provider_sid },
|
||||||
{
|
{ defaults });
|
||||||
defaults: {
|
|
||||||
synthesizer: {
|
|
||||||
vendor: app.speech_synthesis_vendor,
|
|
||||||
language: app.speech_synthesis_language,
|
|
||||||
voice: app.speech_synthesis_voice
|
|
||||||
},
|
|
||||||
recognizer: {
|
|
||||||
vendor: app.speech_recognizer_vendor,
|
|
||||||
language: app.speech_recognizer_language
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
logger.debug({ params }, 'sending initial webhook');
|
logger.debug({ params }, 'sending initial webhook');
|
||||||
const obj = rootSpan.startChildSpan('performAppWebhook');
|
const obj = rootSpan.startChildSpan('performAppWebhook');
|
||||||
span = obj.span;
|
span = obj.span;
|
||||||
|
|||||||
Reference in New Issue
Block a user