]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
record_sample_rate variable influences the rate record app will use
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 12 Jun 2009 16:02:23 +0000 (16:02 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 12 Jun 2009 16:02:23 +0000 (16:02 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13768 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_async.c

index 282762d7320a1c33b8d53e41630d386ae926cd4f..f2cfc7c08dc57cd615f66450a2c3bb8416e51e61 100644 (file)
@@ -973,6 +973,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
        rh->file = switch_core_session_strdup(session, file);
        rh->lead_in = LEAD_IN;
 
+
+       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) {
+                       rh->fh->samplerate = tmp;
+               }
+       }
+
        if ((status = switch_core_media_bug_add(session, record_callback, rh, to, flags, &bug)) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error adding media bug for file %s\n", file);
                switch_core_file_close(fh);