From f7f8f52283c04e83d33fb0f9358bb19304bfd315 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:04:40 +0700 Subject: [PATCH] fixed google asr max duration exceeded or no audio raised jambonz_transcribe::error (#120) Co-authored-by: root --- mod_google_transcribe/google_glue_v1.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod_google_transcribe/google_glue_v1.cpp b/mod_google_transcribe/google_glue_v1.cpp index a4e18f4..842c413 100644 --- a/mod_google_transcribe/google_glue_v1.cpp +++ b/mod_google_transcribe/google_glue_v1.cpp @@ -233,6 +233,10 @@ static void *SWITCH_THREAD_FUNC grpc_read_thread(switch_thread_t *thread, void * auto speech_event_type = response.speech_event_type(); if (response.has_error()) { Status status = response.error(); + //error 11 is handled in finished session, avoid sending jambonz_transcribe::error event for this here. + if (11 == status.code()) { + continue; + } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "grpc_read_thread: error %s (%d)\n", status.message().c_str(), status.code()) ; cJSON* json = cJSON_CreateObject(); cJSON_AddStringToObject(json, "type", "error");