the intent for having the module and lang separate is for things where the same module can use different sets of sounds like en module and en-male or en-female lang (sound dirs) there was indeed a disconnect in the dialplan version of this app. Originally say was only available in phrase macros so I change the syntax of the say app so you can specify both the module and the lang absolte from the dp with something like he:he as the module name. BTW: Going forward can you attach the patch or give me instructions on how to get it in raw format or merge it to our local git, I don't really have the time to figure it out just to pull in a patch......
This commit is contained in:
parent
cdcd36337a
commit
44304f4962
|
@ -2078,7 +2078,7 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
|
|||
prompt_audio_file, bad_input_audio_file, var_name, digit_buffer, sizeof(digit_buffer), digits_regex, digit_timeout);
|
||||
}
|
||||
|
||||
#define SAY_SYNTAX "<module_name> <say_type> <say_method> [<say_gender>] <text>"
|
||||
#define SAY_SYNTAX "<module_name>:<lang> <say_type> <say_method> [<say_gender>] <text>"
|
||||
SWITCH_STANDARD_APP(say_function)
|
||||
{
|
||||
char *argv[5] = { 0 };
|
||||
|
|
|
@ -2330,23 +2330,39 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session,
|
|||
const char *save_path = NULL, *chan_lang = NULL, *lang = NULL, *lname = NULL, *sound_path = NULL;
|
||||
switch_event_t *hint_data;
|
||||
switch_xml_t cfg, xml = NULL, language, macros;
|
||||
|
||||
char *p;
|
||||
|
||||
switch_assert(session);
|
||||
channel = switch_core_session_get_channel(session);
|
||||
switch_assert(channel);
|
||||
|
||||
if (zstr(module_name)) {
|
||||
module_name = "en";
|
||||
}
|
||||
|
||||
if (module_name) {
|
||||
p = switch_core_session_strdup(session, module_name);
|
||||
module_name = p;
|
||||
|
||||
if ((p = strchr(module_name, ':'))) {
|
||||
*p++ = '\0';
|
||||
chan_lang = p;
|
||||
}
|
||||
}
|
||||
|
||||
if (!chan_lang) {
|
||||
lang = switch_channel_get_variable(channel, "language");
|
||||
|
||||
if (!lang) {
|
||||
chan_lang = switch_channel_get_variable(channel, "default_language");
|
||||
if (!chan_lang) {
|
||||
chan_lang = "en";
|
||||
chan_lang = module_name;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No language specified - Using [%s]\n", chan_lang);
|
||||
} else {
|
||||
chan_lang = lang;
|
||||
}
|
||||
}
|
||||
|
||||
switch_event_create(&hint_data, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(hint_data);
|
||||
|
@ -2399,6 +2415,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session,
|
|||
|
||||
if (sound_path) {
|
||||
switch_channel_set_variable(channel, "sound_prefix", sound_path);
|
||||
p = switch_core_session_strdup(session, sound_path);
|
||||
sound_path = p;
|
||||
}
|
||||
|
||||
if (xml) {
|
||||
switch_xml_free(xml);
|
||||
}
|
||||
|
||||
if ((si = switch_loadable_module_get_say_interface(module_name))) {
|
||||
|
@ -2425,10 +2447,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session,
|
|||
switch_channel_set_variable(channel, "sound_prefix", save_path);
|
||||
}
|
||||
|
||||
if (xml) {
|
||||
switch_xml_free(xml);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue