mirror of
https://github.com/jambonz/freeswitch-modules.git
synced 2026-01-25 02:08:27 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d01991ed0f | |||
| eec4df4b77 | |||
| b003ab0875 |
@@ -111,9 +111,6 @@ public:
|
|||||||
if (var = switch_channel_get_variable(channel, "AWS_VOCABULARY_FILTER_METHOD")) {
|
if (var = switch_channel_get_variable(channel, "AWS_VOCABULARY_FILTER_METHOD")) {
|
||||||
m_request.SetVocabularyFilterMethod(VocabularyFilterMethodMapper::GetVocabularyFilterMethodForName(var));
|
m_request.SetVocabularyFilterMethod(VocabularyFilterMethodMapper::GetVocabularyFilterMethodForName(var));
|
||||||
}
|
}
|
||||||
if (var = switch_channel_get_variable(channel, "AWS_LANGUAGE_MODEL_NAME")) {
|
|
||||||
m_request.SetLanguageModelName(var);
|
|
||||||
}
|
|
||||||
switch_core_session_rwunlock(session);
|
switch_core_session_rwunlock(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,10 @@ switch_status_t playht_parse_text(const std::map<std::string, std::string>& para
|
|||||||
cJSON_AddStringToObject(jResult, "quality", quality.c_str());
|
cJSON_AddStringToObject(jResult, "quality", quality.c_str());
|
||||||
}
|
}
|
||||||
if (!speed.empty()) {
|
if (!speed.empty()) {
|
||||||
cJSON_AddNumberToObject(jResult, "speed", atoi(speed.c_str()));
|
double val = strtod(speed.c_str(), NULL);
|
||||||
|
if (val != 0.0) {
|
||||||
|
cJSON_AddNumberToObject(jResult, "speed", val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!seed.empty()) {
|
if (!seed.empty()) {
|
||||||
cJSON_AddNumberToObject(jResult, "seed", atoi(seed.c_str()));
|
cJSON_AddNumberToObject(jResult, "seed", atoi(seed.c_str()));
|
||||||
|
|||||||
@@ -229,16 +229,6 @@ int AudioPipe::lws_callback(struct lws *wsi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// static members
|
|
||||||
static const lws_retry_bo_t retry = {
|
|
||||||
nullptr, // retry_ms_table
|
|
||||||
0, // retry_ms_table_count
|
|
||||||
0, // conceal_count
|
|
||||||
UINT16_MAX, // secs_since_valid_ping
|
|
||||||
UINT16_MAX, // secs_since_valid_hangup
|
|
||||||
0 // jitter_percent
|
|
||||||
};
|
|
||||||
|
|
||||||
struct lws_context *AudioPipe::context = nullptr;
|
struct lws_context *AudioPipe::context = nullptr;
|
||||||
std::thread AudioPipe::serviceThread;
|
std::thread AudioPipe::serviceThread;
|
||||||
std::mutex AudioPipe::mutex_connects;
|
std::mutex AudioPipe::mutex_connects;
|
||||||
@@ -376,6 +366,28 @@ bool AudioPipe::lws_service_thread() {
|
|||||||
{ NULL, NULL, 0, 0 }
|
{ NULL, NULL, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uint16_t secs_sinceq_valid_ping = UINT16_MAX;
|
||||||
|
uint16_t secs_since_valid_hangup = UINT16_MAX;
|
||||||
|
|
||||||
|
char* wsVar = std::getenv("WS_PING_INTERVAL");
|
||||||
|
if (wsVar != nullptr) {
|
||||||
|
secs_sinceq_valid_ping = std::atoi(wsVar);
|
||||||
|
}
|
||||||
|
|
||||||
|
wsVar = std::getenv("WS_NO_PONG_HANGUP_INTERVAL");
|
||||||
|
if (wsVar != nullptr) {
|
||||||
|
secs_since_valid_hangup = std::atoi(wsVar);
|
||||||
|
}
|
||||||
|
|
||||||
|
const lws_retry_bo_t retry = {
|
||||||
|
nullptr, // retry_ms_table
|
||||||
|
0, // retry_ms_table_count
|
||||||
|
0, // conceal_count
|
||||||
|
secs_sinceq_valid_ping, // secs_sinceq_valid_ping
|
||||||
|
secs_since_valid_hangup, // secs_since_valid_hangup
|
||||||
|
0 // jitter_percent
|
||||||
|
};
|
||||||
|
|
||||||
memset(&info, 0, sizeof info);
|
memset(&info, 0, sizeof info);
|
||||||
info.port = CONTEXT_PORT_NO_LISTEN;
|
info.port = CONTEXT_PORT_NO_LISTEN;
|
||||||
info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
|
info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
|
||||||
|
|||||||
@@ -774,7 +774,10 @@ extern "C" {
|
|||||||
cJSON_AddStringToObject(jResult, "quality", p->quality);
|
cJSON_AddStringToObject(jResult, "quality", p->quality);
|
||||||
}
|
}
|
||||||
if (p->speed) {
|
if (p->speed) {
|
||||||
cJSON_AddNumberToObject(jResult, "speed", atoi(p->speed));
|
double val = strtod(p->speed, NULL);
|
||||||
|
if (val != 0.0) {
|
||||||
|
cJSON_AddNumberToObject(jResult, "speed", val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (p->seed) {
|
if (p->seed) {
|
||||||
cJSON_AddNumberToObject(jResult, "seed", atoi(p->seed));
|
cJSON_AddNumberToObject(jResult, "seed", atoi(p->seed));
|
||||||
|
|||||||
Reference in New Issue
Block a user