[Freeswitch-svn] [commit] r1589 - in freeswitch/trunk/src: . mod/applications/mod_rss

anthm at freeswitch.org anthm at freeswitch.org
Fri Jun 9 15:54:53 EDT 2006


Author: anthm
Date: Fri Jun  9 15:54:53 2006
New Revision: 1589

Modified:
   freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
   freeswitch/trunk/src/switch_ivr.c

Log:
tweak ivr

Modified: freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	Fri Jun  9 15:54:53 2006
@@ -131,7 +131,6 @@
 {
 	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,14 +185,7 @@
 	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))) {
 			argc = switch_separate_string(mydata, ' ', argv, sizeof(argv)/sizeof(argv[0]));
@@ -312,9 +304,21 @@
 			}
 
 			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 @@
 		}
 		
 
+
 		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 @@
 		switch_core_timer_destroy(&timer);
 	}
 
- done:
+
 	switch_xml_free(xml);
 
 	switch_core_session_reset(session);

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Fri Jun  9 15:54:53 2006
@@ -534,7 +534,9 @@
     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);



More information about the Freeswitch-svn mailing list