fixed houndify speech credential validation skiped if custom endpoint provided (#522)

This commit is contained in:
Hoan Luu Huu
2026-03-05 19:17:52 +07:00
committed by GitHub
parent c80928f569
commit b95a593182

View File

@@ -661,9 +661,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`);
@@ -680,8 +687,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,