From 566e56b192dd2ff50dcde0fd98e74094461022a5 Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthony.minessale@gmail.com>
Date: Fri, 12 Jun 2009 15:59:19 +0000
Subject: [PATCH] record_sample_rate variable influences the rate record app
 will use

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13767 d0543943-73ff-0310-b7d9-9358b9ac24b2
---
 src/switch_ivr_play_say.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c
index c40c20af34..5d7dc0c837 100644
--- a/src/switch_ivr_play_say.c
+++ b/src/switch_ivr_play_say.c
@@ -416,6 +416,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
 	fh->channels = read_impl.number_of_channels;
 	fh->native_rate = read_impl.actual_samples_per_second;
 
+	if ((vval = switch_channel_get_variable(channel, "record_sample_rate"))) {
+		int tmp = 0;
+
+		tmp = atoi(vval);
+
+		if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 11025 || tmp == 22050 || tmp == 44100) {
+			fh->samplerate = tmp;
+		}
+	}
+
+
 	if ((vval = switch_channel_get_variable(channel, "record_waste_resources"))) {
 	
 		if (switch_true(vval)) {