提交 f7438a22 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix regression from earlier commit

上级 ac7f94e5
...@@ -916,6 +916,7 @@ SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_exists(const char *uuid); ...@@ -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(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_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); SWITCH_DECLARE(void) switch_ivr_dmachine_set_nonmatch_callback(switch_ivr_dmachine_t *dmachine, switch_ivr_dmachine_callback_t nonmatch_callback);
......
...@@ -74,9 +74,15 @@ struct switch_ivr_dmachine { ...@@ -74,9 +74,15 @@ struct switch_ivr_dmachine {
switch_ivr_dmachine_binding_t *last_matching_binding; switch_ivr_dmachine_binding_t *last_matching_binding;
void *user_data; void *user_data;
switch_mutex_t *mutex; 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_DECLARE(switch_digit_action_target_t) switch_ivr_dmachine_get_target(switch_ivr_dmachine_t *dmachine)
{ {
switch_assert(dmachine); switch_assert(dmachine);
...@@ -507,6 +513,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t * ...@@ -507,6 +513,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
switch_ivr_dmachine_clear(dmachine); switch_ivr_dmachine_clear(dmachine);
} }
dmachine->last_return = r;
switch_mutex_unlock(dmachine->mutex); switch_mutex_unlock(dmachine->mutex);
return r; return r;
...@@ -3256,7 +3264,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_detect_speech(switch_core_se ...@@ -3256,7 +3264,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_detect_speech(switch_core_se
args->buflen = sizeof(state); args->buflen = sizeof(state);
status = switch_ivr_play_file(session, NULL, file, args); 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; state.done = 1;
goto done; goto done;
} }
...@@ -3272,7 +3280,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_detect_speech(switch_core_se ...@@ -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)) { while (!state.done && switch_channel_ready(channel)) {
status = switch_ivr_sleep(session, input_timeout, SWITCH_FALSE, args); 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; state.done = 1;
goto done; goto done;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论