From 0911ed740861f7e173c155c67388284b0053df57 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sat, 5 Mar 2011 12:49:19 -0500 Subject: [PATCH] FS-3124 Use the channel's sound_prefix if it's not set in the conference's config --- conf/autoload_configs/conference.conf.xml | 11 ++++++----- src/mod/applications/mod_conference/mod_conference.c | 10 +++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/conf/autoload_configs/conference.conf.xml b/conf/autoload_configs/conference.conf.xml index cab0578a57..d4e5aa60ee 100644 --- a/conf/autoload_configs/conference.conf.xml +++ b/conf/autoload_configs/conference.conf.xml @@ -52,8 +52,9 @@ - - + + + @@ -106,7 +107,7 @@ - + @@ -131,7 +132,7 @@ - + @@ -156,7 +157,7 @@ - + diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 6892cbab9e..56c85ad2f3 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -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)) {