]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak ivr
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 9 Jun 2006 19:54:53 +0000 (19:54 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 9 Jun 2006 19:54:53 +0000 (19:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1589 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_rss/mod_rss.c
src/switch_ivr.c

index 4f49cba6d95805fb383f7cfcb61c252abc3eaca5..27b4c59b7e74aac11dfa199491a4ef015cf7d98e 100644 (file)
@@ -131,7 +131,6 @@ static void rss_function(switch_core_session_t *session, char *data)
 {
        switch_channel_t *channel;
        switch_status_t status;
-       switch_frame_t *read_frame;
        const char *err = NULL;
        struct dtmf_buffer dtb = {0};
        switch_xml_t xml = NULL, item, xchannel = NULL;
@@ -186,13 +185,6 @@ static void rss_function(switch_core_session_t *session, char *data)
        switch_channel_answer(channel);
 
 
-       for (dtb.index = 0; dtb.index < 10; dtb.index++) {
-               if ((status = switch_core_session_read_frame(session, &read_frame, -1, 0)) != SWITCH_STATUS_SUCCESS) {
-                       switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
-                       goto done;
-               }
-       }
-
 
        if (!switch_strlen_zero(data)) {
                if ((mydata = switch_core_session_strdup(session, data))) {
@@ -312,9 +304,21 @@ static void rss_function(switch_core_session_t *session, char *data)
                        }
 
                        i = atoi(cmd) - 1;
-                       
-                       if (i >= 0 && i <= feed_index) {
+
+                       if (i > -1 && i < feed_index) {
                                filename = feed_list[i];
+                       } else {
+                               status = switch_ivr_speak_text_handle(session,
+                                                                                                         &sh,
+                                                                                                         &speech_codec,
+                                                                                                         timerp,
+                                                                                                         NULL,
+                                                                                                         "I'm sorry. That is an Invalid Selection. ",
+                                                                                                         NULL,
+                                                                                                         0);
+                               if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
+                                       goto finished;
+                               }
                        }
                }
        
@@ -323,6 +327,7 @@ static void rss_function(switch_core_session_t *session, char *data)
                }
                
 
+
                if (!(xml = switch_xml_parse_file(filename))) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", filename);
                        goto finished;
@@ -571,7 +576,7 @@ static void rss_function(switch_core_session_t *session, char *data)
                switch_core_timer_destroy(&timer);
        }
 
- done:
+
        switch_xml_free(xml);
 
        switch_core_session_reset(session);
index 44bf1baa98dda0dd6cfd988943008d6049b1402d..902a4411157c9536d81dbdba0c7f721691a64af5 100644 (file)
@@ -534,7 +534,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
     len = samples * 2;
 
        flags = 0;
+       switch_sleep(200000);
        switch_core_speech_feed_tts(sh, text, &flags);
+
        write_frame.rate = sh->rate;
 
        memset(write_frame.data, 0, len);