提交 a35dddbf authored 作者: Michael Jerris's avatar Michael Jerris

handle NULL values better. Found by Klockwork (www.klocwork.com)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8509 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 103dfc02
......@@ -735,15 +735,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
dup = switch_core_session_strdup(session, alt);
engine = dup;
if ((voice = strchr(engine, ':'))) {
*voice++ = '\0';
if ((text = strchr(voice, ':'))) {
*text++ = '\0';
if (!switch_strlen_zero(engine)) {
if ((voice = strchr(engine, ':'))) {
*voice++ = '\0';
if (!switch_strlen_zero(voice) && (text = strchr(voice, ':'))) {
*text++ = '\0';
}
}
}
if (engine && voice && text) {
if (!switch_strlen_zero(engine) && !switch_strlen_zero(voice) && !switch_strlen_zero(text)) {
return switch_ivr_speak_text(session, engine, voice, text, args);
} else if (engine && !(voice && text)) {
} else if (!switch_strlen_zero(engine) && !(voice && text)) {
text = engine;
engine = (char *)switch_channel_get_variable(channel, "tts_engine");
voice = (char *)switch_channel_get_variable(channel, "tts_voice");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论