mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-01-25 02:08:24 +00:00
fixed houndify speech credential validation skiped if custom endpoint provided
This commit is contained in:
@@ -659,9 +659,16 @@ const testAssemblyStt = async(logger, credentials) => {
|
||||
};
|
||||
|
||||
const testHoundifyStt = async(logger, credentials) => {
|
||||
const {client_id, client_key, user_id} = credentials;
|
||||
const {client_id, client_key, user_id, houndify_server_uri} = credentials;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// api-server use houndify js sdk, which connect to wss server
|
||||
// freeswitch modules use houndify c/c++ sdk, which connect to https server
|
||||
// we cannot test credentials on https server here.
|
||||
if (houndify_server_uri) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
// Read the test audio file
|
||||
const audioBuffer = fs.readFileSync(`${__dirname}/../../data/test_audio.wav`);
|
||||
@@ -678,8 +685,6 @@ const testHoundifyStt = async(logger, credentials) => {
|
||||
Latitude: 37.388309,
|
||||
Longitude: -121.973968,
|
||||
},
|
||||
// custom endpint is used only for feature server.
|
||||
// ...(houndify_server_uri && {endpoint: houndify_server_uri}),
|
||||
|
||||
// Audio format configuration
|
||||
sampleRate: 16000,
|
||||
|
||||
Reference in New Issue
Block a user