]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix regression from earlier commit
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 5 Jan 2012 19:24:57 +0000 (13:24 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 5 Jan 2012 19:25:04 +0000 (13:25 -0600)
src/include/switch_ivr.h
src/switch_ivr_async.c

index 39ce354e9f4bea7e5ef5853fbdb5ccbfb5d37309..0fb3c83e7fe549de3080067f5b51cb0c1ffe643b 100644 (file)
@@ -916,6 +916,7 @@ SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_exists(const char *uuid);
 
 
 
+SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_last_ping(switch_ivr_dmachine_t *dmachine);
 SWITCH_DECLARE(const char *) switch_ivr_dmachine_get_name(switch_ivr_dmachine_t *dmachine);
 SWITCH_DECLARE(void) switch_ivr_dmachine_set_match_callback(switch_ivr_dmachine_t *dmachine, switch_ivr_dmachine_callback_t match_callback);
 SWITCH_DECLARE(void) switch_ivr_dmachine_set_nonmatch_callback(switch_ivr_dmachine_t *dmachine, switch_ivr_dmachine_callback_t nonmatch_callback);
index 8958d10813af8f20bc40841ca6153a2649ed04da..bea3229df69e378a6a2fc9ebc1be0ad2049fc8f1 100644 (file)
@@ -74,9 +74,15 @@ struct switch_ivr_dmachine {
        switch_ivr_dmachine_binding_t *last_matching_binding;
        void *user_data;
        switch_mutex_t *mutex;
+       switch_status_t last_return;
 };
 
 
+SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_last_ping(switch_ivr_dmachine_t *dmachine)
+{
+       return dmachine->last_return;
+}
+
 SWITCH_DECLARE(switch_digit_action_target_t) switch_ivr_dmachine_get_target(switch_ivr_dmachine_t *dmachine)
 {
        switch_assert(dmachine);
@@ -507,6 +513,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
                switch_ivr_dmachine_clear(dmachine);
        }
 
+       dmachine->last_return = r;
+
        switch_mutex_unlock(dmachine->mutex);
 
        return r;
@@ -3256,7 +3264,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_detect_speech(switch_core_se
        args->buflen = sizeof(state);
        status = switch_ivr_play_file(session, NULL, file, args);
 
-       if (args->dmachine && (switch_ivr_dmachine_get_match(args->dmachine) || switch_ivr_dmachine_get_failed_digits(args->dmachine))) {
+       if (args->dmachine && switch_ivr_dmachine_last_ping(args->dmachine) != SWITCH_STATUS_SUCCESS) {
                state.done = 1;
                goto done;
        }
@@ -3272,7 +3280,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_detect_speech(switch_core_se
                while (!state.done && switch_channel_ready(channel)) {
                        status = switch_ivr_sleep(session, input_timeout, SWITCH_FALSE, args);
                        
-                       if (args->dmachine && (switch_ivr_dmachine_get_match(args->dmachine) || switch_ivr_dmachine_get_failed_digits(args->dmachine))) {
+                       if (args->dmachine && switch_ivr_dmachine_last_ping(args->dmachine) != SWITCH_STATUS_SUCCESS) {
                                state.done = 1;
                                goto done;
                        }