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
This commit is contained in:
parent
103dfc02cb
commit
a35dddbfc0
|
@ -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);
|
dup = switch_core_session_strdup(session, alt);
|
||||||
engine = dup;
|
engine = dup;
|
||||||
|
|
||||||
|
if (!switch_strlen_zero(engine)) {
|
||||||
if ((voice = strchr(engine, ':'))) {
|
if ((voice = strchr(engine, ':'))) {
|
||||||
*voice++ = '\0';
|
*voice++ = '\0';
|
||||||
if ((text = strchr(voice, ':'))) {
|
if (!switch_strlen_zero(voice) && (text = strchr(voice, ':'))) {
|
||||||
*text++ = '\0';
|
*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);
|
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;
|
text = engine;
|
||||||
engine = (char *)switch_channel_get_variable(channel, "tts_engine");
|
engine = (char *)switch_channel_get_variable(channel, "tts_engine");
|
||||||
voice = (char *)switch_channel_get_variable(channel, "tts_voice");
|
voice = (char *)switch_channel_get_variable(channel, "tts_voice");
|
||||||
|
|
Loading…
Reference in New Issue