FS-3124 Use the channel's sound_prefix if it's not set in the conference's config

This commit is contained in:
Mathieu Rene 2011-03-05 12:49:19 -05:00
parent 541a99153d
commit 0911ed7408
2 changed files with 15 additions and 6 deletions

View File

@ -52,8 +52,9 @@
<!-- If TTS is enabled all audio-file params beginning with -->
<!-- 'say:' will be considered text to say with TTS -->
<!-- Set a default path here so you can use relative paths in the other sound params-->
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
<!-- Override the default path here, after which you use relative paths in the other sound params -->
<!-- Note: The default path is the conference's first caller's sound_prefix -->
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<!-- File to play to acknowledge succees -->
<!--<param name="ack-sound" value="beep.wav"/>-->
<!-- File to play to acknowledge failure -->
@ -106,7 +107,7 @@
<param name="rate" value="16000"/>
<param name="interval" value="20"/>
<param name="energy-level" value="300"/>
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
@ -131,7 +132,7 @@
<param name="rate" value="32000"/>
<param name="interval" value="20"/>
<param name="energy-level" value="300"/>
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
@ -156,7 +157,7 @@
<param name="rate" value="48000"/>
<param name="interval" value="10"/>
<param name="energy-level" value="300"/>
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>

View File

@ -6423,6 +6423,7 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
comfort_noise_level = 1400;
}
} else if (!strcasecmp(var, "sound-prefix") && !zstr(val)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "override sound-prefix with: %s\n", val);
sound_prefix = val;
} else if (!strcasecmp(var, "max-members") && !zstr(val)) {
errno = 0; /* sanity first */
@ -6527,8 +6528,15 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
set_cflags(conference_flags, &conference->flags);
}
if (sound_prefix) {
if (!zstr(sound_prefix)) {
conference->sound_prefix = switch_core_strdup(conference->pool, sound_prefix);
} else {
const char *val;
if ((val = switch_channel_get_variable(channel, "sound_prefix")) && !zstr(val)) {
/* if no sound_prefix was set, use the channel sound_prefix */
conference->sound_prefix = switch_core_strdup(conference->pool, val);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "using channel sound prefix: %s\n", conference->sound_prefix);
}
}
if (!zstr(enter_sound)) {