]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix min digits in read app
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 8 Sep 2008 22:34:28 +0000 (22:34 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 8 Sep 2008 22:34:28 +0000 (22:34 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9486 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_voicemail/mod_voicemail.c
src/switch_ivr_play_say.c

index 2e20751eca4a90117c58b57ac6e8aedf621b7de7..b7755341b6bdd106240a734cb18d5793c13becf8 100644 (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);
index b92736fb387bee706b2e11e7c0ec2bea1eec2a92..8c5b0e43420d7aefbd24fb3b2d10aba9490feee6 100644 (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);