[Freeswitch-svn] [commit] r9225 - in freeswitch/trunk/src: . include

Freeswitch SVN anthm at freeswitch.org
Tue Aug 5 17:50:49 EDT 2008


Author: anthm
Date: Tue Aug  5 17:50:48 2008
New Revision: 9225

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_ivr.c
   freeswitch/trunk/src/switch_ivr_play_say.c

Log:

                  _                   
                 | |                  
  ____ ____  ____| | ____ ____   ____ 
 / _  ) _  |/ ___) |/ _  |  _ \ / _  |
( (/ ( ( | | |   | ( ( | | | | ( ( | |
 \____)_||_|_|   |_|\_||_|_| |_|\_|| |
                               (_____|




Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Tue Aug  5 17:50:48 2008
@@ -110,6 +110,7 @@
 #define SWITCH_PATH_SEPARATOR "/"
 #endif
 #define SWITCH_URL_SEPARATOR "://"
+#define SWITCH_READ_RESULT_VARIABLE "read_result"
 #define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
 #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
 #define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Tue Aug  5 17:50:48 2008
@@ -760,6 +760,7 @@
 		if (eff_timeout) {
 			digit_elapsed = (uint32_t) ((switch_timestamp_now() - digit_started) / 1000);
 			if (digit_elapsed >= eff_timeout) {
+				status = SWITCH_STATUS_TIMEOUT;
 				break;
 			}
 		}

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	Tue Aug  5 17:50:48 2008
@@ -1371,6 +1371,7 @@
 	switch_assert(session);
 
 	channel = switch_core_session_get_channel(session);
+	switch_channel_set_variable(channel, SWITCH_READ_RESULT_VARIABLE, NULL);
 
 	if (digit_buffer_length < min_digits || digit_buffer_length < max_digits) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Buffer too small!\n");
@@ -1400,6 +1401,14 @@
 		status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &terminator, timeout, 0, 0);
 	}
 
+	if (status == SWITCH_STATUS_SUCCESS) {
+		switch_channel_set_variable(channel, SWITCH_READ_RESULT_VARIABLE, "success");
+	} else if (status == SWITCH_STATUS_TIMEOUT) {
+		switch_channel_set_variable(channel, SWITCH_READ_RESULT_VARIABLE, "timeout");
+	} else {
+		switch_channel_set_variable(channel, SWITCH_READ_RESULT_VARIABLE, "failure");
+	}
+
 
   end:
 



More information about the Freeswitch-svn mailing list