]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3505 --resolve copied same code from the other place the original intention was...
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Aug 2011 21:11:18 +0000 (16:11 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Aug 2011 21:11:38 +0000 (16:11 -0500)
src/switch_ivr_play_say.c

index bc6ba621208d468ead0d47c8734bccbfc3d42ce9..c5200d0e0e3c5a7e3c37decea924ada984d2c858 100644 (file)
@@ -377,7 +377,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
        int divisor = 0;
        int file_flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT;
        int restart_limit_on_dtmf = 0;
-       const char *prefix;
+       const char *prefix, *var;
 
        prefix = switch_channel_get_variable(channel, "sound_prefix");
 
@@ -756,6 +756,29 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
 
        switch_core_file_close(fh);
 
+
+       if ((var = switch_channel_get_variable(channel, "record_post_process_exec_api"))) {
+               char *cmd = switch_core_session_strdup(session, var);
+               char *data, *expanded = NULL;
+               switch_stream_handle_t stream = { 0 };
+               
+               SWITCH_STANDARD_STREAM(stream);
+               
+               if ((data = strchr(cmd, ':'))) {
+                       *data++ = '\0';
+                       expanded = switch_channel_expand_variables(channel, data);
+               }
+               
+               switch_api_execute(cmd, expanded, session, &stream);
+               
+               if (expanded && expanded != data) {
+                       free(expanded);
+               }
+               
+               switch_safe_free(stream.data);
+               
+       }
+
        if (read_impl.samples_per_second) {
                switch_channel_set_variable_printf(channel, "record_seconds", "%d", fh->samples_out / read_impl.samples_per_second);
                switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (read_impl.samples_per_second / 1000));