From e976144ef130fdd7037e785134c186efae7f6d67 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 29 Mar 2013 22:35:32 -0500 Subject: [PATCH] FS-5216 seems like invalid codec lets try this --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 4 +++- src/switch_ivr_play_say.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 96d9917df1..7c2928db4c 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -2008,7 +2008,9 @@ static JSBool session_speak(JSContext * cx, JSObject * obj, uintN argc, jsval * args.buflen = len; switch_core_speech_flush_tts(&jss->speech->sh); - switch_ivr_speak_text_handle(jss->session, &jss->speech->sh, &jss->speech->codec, NULL, text, &args); + if (switch_core_codec_ready(&jss->speech->codec)) { + switch_ivr_speak_text_handle(jss->session, &jss->speech->sh, &jss->speech->codec, NULL, text, &args); + } JS_ResumeRequest(cx, cb_state.saveDepth); check_hangup_hook(jss, &ret); *rval = cb_state.ret; diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 59dab6c904..3ce8b6bc72 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -2141,6 +2141,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session return SWITCH_STATUS_FALSE; } + if (!switch_core_codec_ready(codec)) { + return SWITCH_STATUS_FALSE; + } + arg_recursion_check_start(args); write_frame.data = abuf;