fix min digits in read app

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9486 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-09-08 22:34:28 +00:00
parent fc9c08c27e
commit 1b048f00c3
2 changed files with 4 additions and 4 deletions

View File

@ -1358,7 +1358,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
switch_snprintf(macro_buf, sizeof(macro_buf), "phrase:%s:%s", VM_FORWARD_MESSAGE_ENTER_EXTENSION_MACRO, profile->terminator_key);
vm_cc[0] = '\0';
TRY_CODE(switch_ivr_read(session, 1, sizeof(vm_cc), macro_buf, NULL, vm_cc, sizeof(vm_cc), profile->digit_timeout, profile->terminator_key));
TRY_CODE(switch_ivr_read(session, 0, sizeof(vm_cc), macro_buf, NULL, vm_cc, sizeof(vm_cc), profile->digit_timeout, profile->terminator_key));
cmd = switch_core_session_sprintf(session, "%s@%s %s %s %s", vm_cc, cbt->domain, new_file_path, cbt->cid_number, cbt->cid_name);
@ -1796,7 +1796,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
char macro[256] = "";
switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", VM_ENTER_PASS_MACRO, profile->terminator_key);
TRY_CODE(switch_ivr_read(session, 1, 255, macro, NULL, buf, sizeof(buf), 10000, profile->terminator_key));
TRY_CODE(switch_ivr_read(session, 0, 255, macro, NULL, buf, sizeof(buf), 10000, profile->terminator_key));
sql = switch_mprintf("update voicemail_prefs set password='%s' where username='%s' and domain='%s'", buf, myid, domain_name);
vm_execute_sql(profile, sql, profile->mutex);
switch_safe_free(file_path);

View File

@ -1378,7 +1378,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *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 ((min_digits && digit_buffer_length < min_digits) || digit_buffer_length < max_digits) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Buffer too small!\n");
return SWITCH_STATUS_FALSE;
}
@ -1400,7 +1400,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
len = strlen(digit_buffer);
if (len < min_digits && len < max_digits) {
if ((min_digits && len < min_digits) || len < max_digits) {
args.buf = digit_buffer + len;
args.buflen = (uint32_t) (digit_buffer_length - len);
status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &terminator, timeout, 0, 0);