diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 2e20751eca..b7755341b6 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -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); diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index b92736fb38..8c5b0e4342 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -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);