mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
FS-11237 #resolve speak text with colon
This commit is contained in:
parent
12e3b7177c
commit
9d0ad92d10
@ -1307,38 +1307,22 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (!strncasecmp(file, "say:", 4)) {
|
} else if (!strncasecmp(file, "say:", 4)) {
|
||||||
char *engine = NULL, *voice = NULL, *text = NULL;
|
const char *engine = NULL, *voice = NULL, *text = NULL;
|
||||||
|
|
||||||
alt = file + 4;
|
alt = file + 4;
|
||||||
dup = switch_core_session_strdup(session, alt);
|
text = alt;
|
||||||
engine = dup;
|
engine = switch_channel_get_variable(channel, "tts_engine");
|
||||||
|
voice = switch_channel_get_variable(channel, "tts_voice");
|
||||||
|
|
||||||
if (!zstr(engine)) {
|
if (engine && text) {
|
||||||
if ((voice = strchr(engine, ':'))) {
|
if ((status = switch_ivr_speak_text(session, engine, voice, (char *)text, args)) != SWITCH_STATUS_SUCCESS) {
|
||||||
*voice++ = '\0';
|
|
||||||
if (!zstr(voice) && (text = strchr(voice, ':'))) {
|
|
||||||
*text++ = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!zstr(engine) && !zstr(voice) && !zstr(text)) {
|
|
||||||
if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) {
|
|
||||||
arg_recursion_check_stop(args);
|
arg_recursion_check_stop(args);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
text = engine;
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Args\n");
|
||||||
engine = (char *) switch_channel_get_variable(channel, "tts_engine");
|
|
||||||
voice = (char *) switch_channel_get_variable(channel, "tts_voice");
|
|
||||||
if (engine && text) {
|
|
||||||
if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) {
|
|
||||||
arg_recursion_check_stop(args);
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Args\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user