| | ____ ____ ____| | ____ ____ ____ / _ ) _ |/ ___) |/ _ | _ \ / _ | ( (/ ( ( | | | | ( ( | | | | ( ( | | \____)_||_|_| |_|\_||_|_| |_|\_|| | (_____| git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9225 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
12b3a4f451
commit
8b4433720e
|
@ -110,6 +110,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||||
#define SWITCH_PATH_SEPARATOR "/"
|
#define SWITCH_PATH_SEPARATOR "/"
|
||||||
#endif
|
#endif
|
||||||
#define SWITCH_URL_SEPARATOR "://"
|
#define SWITCH_URL_SEPARATOR "://"
|
||||||
|
#define SWITCH_READ_RESULT_VARIABLE "read_result"
|
||||||
#define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
|
#define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
|
||||||
#define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
|
#define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
|
||||||
#define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
|
#define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
|
||||||
|
|
|
@ -760,6 +760,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
|
||||||
if (eff_timeout) {
|
if (eff_timeout) {
|
||||||
digit_elapsed = (uint32_t) ((switch_timestamp_now() - digit_started) / 1000);
|
digit_elapsed = (uint32_t) ((switch_timestamp_now() - digit_started) / 1000);
|
||||||
if (digit_elapsed >= eff_timeout) {
|
if (digit_elapsed >= eff_timeout) {
|
||||||
|
status = SWITCH_STATUS_TIMEOUT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1371,6 +1371,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
|
||||||
switch_assert(session);
|
switch_assert(session);
|
||||||
|
|
||||||
channel = switch_core_session_get_channel(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) {
|
if (digit_buffer_length < min_digits || digit_buffer_length < max_digits) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Buffer too small!\n");
|
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);
|
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:
|
end:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue