mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-02 19:40:08 +00:00
set sound path in say app
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13904 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
273b81491f
commit
dbb8d6563a
@ -2009,7 +2009,33 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session, c
|
|||||||
const char *say_method, switch_input_args_t *args)
|
const char *say_method, switch_input_args_t *args)
|
||||||
{
|
{
|
||||||
switch_say_interface_t *si;
|
switch_say_interface_t *si;
|
||||||
|
switch_channel_t *channel;
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
const char *save_path = NULL, *chan_lang = NULL, *lang = NULL;
|
||||||
|
|
||||||
|
switch_assert(session);
|
||||||
|
channel = switch_core_session_get_channel(session);
|
||||||
|
switch_assert(channel);
|
||||||
|
|
||||||
|
lang = switch_channel_get_variable(channel, "language");
|
||||||
|
|
||||||
|
if (!lang) {
|
||||||
|
chan_lang = switch_channel_get_variable(channel, "default_language");
|
||||||
|
if (!chan_lang) {
|
||||||
|
chan_lang = "en";
|
||||||
|
}
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No language specified - Using [%s]\n", chan_lang);
|
||||||
|
} else {
|
||||||
|
chan_lang = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
save_path = switch_channel_get_variable(channel, "sound_prefix");
|
||||||
|
|
||||||
|
switch_channel_set_variable_printf(channel, "sound_prefix", "%s%ssounds%s%s",
|
||||||
|
SWITCH_GLOBAL_dirs.base_dir,
|
||||||
|
SWITCH_PATH_SEPARATOR,
|
||||||
|
SWITCH_PATH_SEPARATOR,
|
||||||
|
chan_lang);
|
||||||
|
|
||||||
if ((si = switch_loadable_module_get_say_interface(module_name))) {
|
if ((si = switch_loadable_module_get_say_interface(module_name))) {
|
||||||
/* should go back and proto all the say mods to const.... */
|
/* should go back and proto all the say mods to const.... */
|
||||||
@ -2019,6 +2045,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session, c
|
|||||||
status = SWITCH_STATUS_FALSE;
|
status = SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_channel_set_variable(channel, "sound_prefix", save_path);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user