mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
clear before calling callback
This commit is contained in:
parent
c8be999c34
commit
7d89ca45b6
@ -476,7 +476,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
|||||||
switch_bool_t is_timeout = switch_ivr_dmachine_check_timeout(dmachine);
|
switch_bool_t is_timeout = switch_ivr_dmachine_check_timeout(dmachine);
|
||||||
dm_match_t is_match = switch_ivr_dmachine_check_match(dmachine, is_timeout);
|
dm_match_t is_match = switch_ivr_dmachine_check_match(dmachine, is_timeout);
|
||||||
switch_status_t r, s;
|
switch_status_t r, s;
|
||||||
int clear = 0;
|
|
||||||
|
|
||||||
if (is_match == DM_MATCH_NEVER) {
|
if (is_match == DM_MATCH_NEVER) {
|
||||||
is_timeout++;
|
is_timeout++;
|
||||||
@ -504,6 +503,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
|||||||
dmachine->is_match = 1;
|
dmachine->is_match = 1;
|
||||||
|
|
||||||
dmachine->match.type = DM_MATCH_POSITIVE;
|
dmachine->match.type = DM_MATCH_POSITIVE;
|
||||||
|
switch_ivr_dmachine_clear(dmachine);
|
||||||
|
|
||||||
if (dmachine->last_matching_binding->callback) {
|
if (dmachine->last_matching_binding->callback) {
|
||||||
s = dmachine->last_matching_binding->callback(&dmachine->match);
|
s = dmachine->last_matching_binding->callback(&dmachine->match);
|
||||||
@ -537,7 +537,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clear++;
|
|
||||||
} else if (is_timeout) {
|
} else if (is_timeout) {
|
||||||
r = SWITCH_STATUS_TIMEOUT;
|
r = SWITCH_STATUS_TIMEOUT;
|
||||||
} else if (is_match == DM_MATCH_NONE && dmachine->cur_digit_len == dmachine->max_digit_len) {
|
} else if (is_match == DM_MATCH_NONE && dmachine->cur_digit_len == dmachine->max_digit_len) {
|
||||||
@ -547,6 +546,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (r != SWITCH_STATUS_FOUND && r != SWITCH_STATUS_SUCCESS && r != SWITCH_STATUS_BREAK) {
|
if (r != SWITCH_STATUS_FOUND && r != SWITCH_STATUS_SUCCESS && r != SWITCH_STATUS_BREAK) {
|
||||||
|
switch_ivr_dmachine_clear(dmachine);
|
||||||
switch_set_string(dmachine->last_failed_digits, dmachine->digits);
|
switch_set_string(dmachine->last_failed_digits, dmachine->digits);
|
||||||
dmachine->match.match_digits = dmachine->last_failed_digits;
|
dmachine->match.match_digits = dmachine->last_failed_digits;
|
||||||
|
|
||||||
@ -569,13 +569,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clear++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clear) {
|
|
||||||
switch_ivr_dmachine_clear(dmachine);
|
|
||||||
}
|
|
||||||
|
|
||||||
dmachine->last_return = r;
|
dmachine->last_return = r;
|
||||||
|
|
||||||
switch_mutex_unlock(dmachine->mutex);
|
switch_mutex_unlock(dmachine->mutex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user