]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
_
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 5 Aug 2008 21:50:48 +0000 (21:50 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 5 Aug 2008 21:50:48 +0000 (21:50 +0000)
                 | |
  ____ ____  ____| | ____ ____   ____
 / _  ) _  |/ ___) |/ _  |  _ \ / _  |
( (/ ( ( | | |   | ( ( | | | | ( ( | |
 \____)_||_|_|   |_|\_||_|_| |_|\_|| |
                               (_____|

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9225 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/switch_ivr.c
src/switch_ivr_play_say.c

index 07d3f79ef4cbdf83ee8fb0a200236e6c7f1f808e..b23fa2d662538e40a7f8af7d9d56a9c3c9335a7e 100644 (file)
@@ -110,6 +110,7 @@ SWITCH_BEGIN_EXTERN_C
 #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"
index b0c76dbd932c88a87c2c8b95e740f898b580f604..06bf8a372d6189a6dfcdd684270cdb16ce84ae62 100644 (file)
@@ -760,6 +760,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
                if (eff_timeout) {
                        digit_elapsed = (uint32_t) ((switch_timestamp_now() - digit_started) / 1000);
                        if (digit_elapsed >= eff_timeout) {
+                               status = SWITCH_STATUS_TIMEOUT;
                                break;
                        }
                }
index f79b492c98cec45257e14fd6dd33151eb541bea4..196b4b84fd586f0db460ae7a74c522950b958992 100644 (file)
@@ -1371,6 +1371,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
        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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
                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: