record_sample_rate variable influences the rate record app will use

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13769 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-06-12 16:06:34 +00:00
parent 9fa25cebce
commit 9675a6e24b
4 changed files with 4 additions and 3 deletions

View File

@ -86,6 +86,7 @@ static inline switch_bool_t switch_is_moh(const char *s)
return SWITCH_TRUE;
}
#define switch_is_valid_rate(_tmp) (_tmp == 8000 || _tmp == 16000 || _tmp == 32000 || _tmp == 11025 || _tmp == 22050 || _tmp == 44100 || _tmp == 48000)
static inline int switch_string_has_escaped_data(const char *in)
{

View File

@ -587,7 +587,7 @@ static vm_profile_t * load_profile(const char *profile_name)
if (!switch_strlen_zero(val)) {
tmp = atoi(val);
}
if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 11025 || tmp == 22050 || tmp == 44100) {
if (switch_is_valid_rate(tmp)) {
record_sample_rate = tmp;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid samplerate %s\n", val);

View File

@ -979,7 +979,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
tmp = atoi(vval);
if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 11025 || tmp == 22050 || tmp == 44100) {
if (switch_is_valid_rate(tmp)) {
rh->fh->samplerate = tmp;
}
}

View File

@ -421,7 +421,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
tmp = atoi(vval);
if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 11025 || tmp == 22050 || tmp == 44100) {
if (switch_is_valid_rate(tmp)) {
fh->samplerate = tmp;
}
}