]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
up
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 16 Oct 2010 00:01:59 +0000 (19:01 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 16 Oct 2010 00:01:59 +0000 (19:01 -0500)
src/switch_ivr_async.c

index 467ea93e59caf2beaca88cfa114f4c297411bfbd..964a77ec79fe9e67322fc7fcb52e044ff205ddcd 100644 (file)
@@ -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++;