From f6f123025970e0c3b204dd6ddbc7393bc68122b1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 15 Oct 2010 19:01:59 -0500 Subject: [PATCH] up --- src/switch_ivr_async.c | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 467ea93e59..964a77ec79 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -358,7 +358,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t * { switch_bool_t is_timeout = switch_ivr_dmachine_check_timeout(dmachine); dm_match_t is_match = switch_ivr_dmachine_check_match(dmachine, is_timeout); - switch_status_t r; + switch_status_t r, s; int clear = 0; if (zstr(dmachine->digits) && !is_timeout) { @@ -381,17 +381,37 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t * dmachine->match.type = DM_MATCH_POSITIVE; if (dmachine->last_matching_binding->callback) { - if (dmachine->last_matching_binding->callback(&dmachine->match) == SWITCH_STATUS_CONTINUE) { + s = dmachine->last_matching_binding->callback(&dmachine->match); + + switch(s) { + case SWITCH_STATUS_CONTINUE: r = SWITCH_STATUS_SUCCESS; + break; + case SWITCH_STATUS_SUCCESS: + break; + default: + r = SWITCH_STATUS_NOTFOUND; + break; } } if (dmachine->match_callback) { dmachine->match.user_data = dmachine->user_data; - if (dmachine->match_callback(&dmachine->match) == SWITCH_STATUS_CONTINUE) { + s = dmachine->match_callback(&dmachine->match); + + switch(s) { + case SWITCH_STATUS_CONTINUE: r = SWITCH_STATUS_SUCCESS; + break; + case SWITCH_STATUS_SUCCESS: + break; + default: + r = SWITCH_STATUS_NOTFOUND; + break; } + } + clear++; } else if (is_timeout) { r = SWITCH_STATUS_TIMEOUT; @@ -409,9 +429,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t * if (dmachine->nonmatch_callback) { dmachine->match.user_data = dmachine->user_data; - if (dmachine->nonmatch_callback(&dmachine->match) == SWITCH_STATUS_CONTINUE) { + s = dmachine->nonmatch_callback(&dmachine->match); + + switch(s) { + case SWITCH_STATUS_CONTINUE: r = SWITCH_STATUS_SUCCESS; + break; + case SWITCH_STATUS_SUCCESS: + break; + default: + r = SWITCH_STATUS_NOTFOUND; + break; } + } clear++;