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 | |
|---|---|---|---|
| 4a7ce3fdf8 | |||
| b019a634bd | |||
| f0b304b8a1 |
@@ -162,14 +162,14 @@ namespace {
|
|||||||
if (!model && !customModel) {
|
if (!model && !customModel) {
|
||||||
std::string defaultModel;
|
std::string defaultModel;
|
||||||
if (getLanguageInfo(language, defaultModel)) {
|
if (getLanguageInfo(language, defaultModel)) {
|
||||||
oss << "&model=" << defaultModel;
|
oss << "model=" << defaultModel;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
oss << "model=base"; // most widely supported, though not ideal
|
oss << "model=base"; // most widely supported, though not ideal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (model) oss << "&model=" << model;
|
else if (model) oss << "model=" << model;
|
||||||
else if (customModel) oss << "&model=" << customModel;
|
else if (customModel) oss << "model=" << customModel;
|
||||||
|
|
||||||
if (var = switch_channel_get_variable(channel, "DEEPGRAM_SPEECH_MODEL_VERSION")) {
|
if (var = switch_channel_get_variable(channel, "DEEPGRAM_SPEECH_MODEL_VERSION")) {
|
||||||
oss << "&version";
|
oss << "&version";
|
||||||
|
|||||||
@@ -404,12 +404,14 @@ extern "C" {
|
|||||||
jambonz::AudioPipe *pAudioPipe = static_cast<jambonz::AudioPipe *>(tech_pvt->pAudioPipe);
|
jambonz::AudioPipe *pAudioPipe = static_cast<jambonz::AudioPipe *>(tech_pvt->pAudioPipe);
|
||||||
if (pAudioPipe) reaper(tech_pvt);
|
if (pAudioPipe) reaper(tech_pvt);
|
||||||
destroy_tech_pvt(tech_pvt);
|
destroy_tech_pvt(tech_pvt);
|
||||||
|
switch_mutex_unlock(tech_pvt->mutex);
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "(%u) jb_transcribe_session_stop, bug removed\n", id);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "(%u) jb_transcribe_session_stop, bug removed\n", id);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "jb_transcribe_session_stop: race condition, previous close completed\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "jb_transcribe_session_stop: race condition, previous close completed\n");
|
||||||
}
|
}
|
||||||
|
switch_mutex_unlock(tech_pvt->mutex);
|
||||||
}
|
}
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ static switch_status_t start_capture(switch_core_session_t *session, switch_medi
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
switch_channel_set_private(channel, bugname, bug);
|
switch_channel_set_private(channel, bugname, bug);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "added media bug for jb transcribe\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "added media bug for jb transcribe: %s\n", bugname);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@ SWITCH_STANDARD_API(jb_transcribe_function)
|
|||||||
if ((lsession = switch_core_session_locate(argv[0]))) {
|
if ((lsession = switch_core_session_locate(argv[0]))) {
|
||||||
if (!strcasecmp(argv[1], "stop")) {
|
if (!strcasecmp(argv[1], "stop")) {
|
||||||
char *bugname = argc > 2 ? argv[2] : MY_BUG_NAME;
|
char *bugname = argc > 2 ? argv[2] : MY_BUG_NAME;
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "stop transcribing\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "stop transcribing %s\n", bugname);
|
||||||
status = do_stop(lsession, bugname);
|
status = do_stop(lsession, bugname);
|
||||||
} else if (!strcasecmp(argv[1], "start")) {
|
} else if (!strcasecmp(argv[1], "start")) {
|
||||||
char* lang = argv[2];
|
char* lang = argv[2];
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ static CURL* createEasyHandle(void) {
|
|||||||
|
|
||||||
// set connect timeout to 3 seconds and total timeout to 109 seconds
|
// set connect timeout to 3 seconds and total timeout to 109 seconds
|
||||||
curl_easy_setopt(easy, CURLOPT_CONNECTTIMEOUT_MS, 3000L);
|
curl_easy_setopt(easy, CURLOPT_CONNECTTIMEOUT_MS, 3000L);
|
||||||
curl_easy_setopt(easy, CURLOPT_TIMEOUT, 10L);
|
//For long text, PlayHT took more than 20 seconds to complete the download.
|
||||||
|
curl_easy_setopt(easy, CURLOPT_TIMEOUT, 60L);
|
||||||
|
|
||||||
return easy ;
|
return easy ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user