[Freeswitch-svn] [commit] r13769 - in freeswitch/trunk/src: . include mod/applications/mod_voicemail

FreeSWITCH SVN anthm at freeswitch.org
Fri Jun 12 09:06:35 PDT 2009


Author: anthm
Date: Fri Jun 12 11:06:34 2009
New Revision: 13769

Log:
record_sample_rate variable influences the rate record app will use

Modified:
   freeswitch/trunk/src/include/switch_utils.h
   freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
   freeswitch/trunk/src/switch_ivr_async.c
   freeswitch/trunk/src/switch_ivr_play_say.c

Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h	(original)
+++ freeswitch/trunk/src/include/switch_utils.h	Fri Jun 12 11:06:34 2009
@@ -86,6 +86,7 @@
 	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)
 {

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	Fri Jun 12 11:06:34 2009
@@ -587,7 +587,7 @@
 				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);

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Fri Jun 12 11:06:34 2009
@@ -979,7 +979,7 @@
 
 		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;
 		}
 	}

Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c	(original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	Fri Jun 12 11:06:34 2009
@@ -421,7 +421,7 @@
 
 		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;
 		}
 	}



More information about the Freeswitch-svn mailing list