Revision
14972
Author
anthm
Date
2009-09-24 17:41:37 -0500 (Thu, 24 Sep 2009)

Log Message

make continue_on_fail trigger explicit matching and only do default behaviour when it's not set

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (14971 => 14972)


--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2009-09-24 22:29:52 UTC (rev 14971)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2009-09-24 22:41:37 UTC (rev 14972)
@@ -2122,11 +2122,6 @@
 	if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Originate Failed.  Cause: %s\n", switch_channel_cause2str(cause));
 
-		/* no answer is *always* a reason to continue */
-		if (cause == SWITCH_CAUSE_NO_ANSWER || cause == SWITCH_CAUSE_NO_USER_RESPONSE || cause == SWITCH_CAUSE_ORIGINATOR_CANCEL) {
-			return;
-		}
-
 		/* 
 		   if the variable continue_on_fail is set it can be:
 		   'true' to continue on all failures.
@@ -2150,7 +2145,13 @@
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Continue on fail [%s]:  Cause: %s\n", continue_on_fail, cause_str);
 				return;
 			}
+		} else {
+			/* no answer is *always* a reason to continue */
+			if (cause == SWITCH_CAUSE_NO_ANSWER || cause == SWITCH_CAUSE_NO_USER_RESPONSE || cause == SWITCH_CAUSE_ORIGINATOR_CANCEL) {
+				return;
+			}
 		}
+
 		if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && switch_channel_get_state(caller_channel) != CS_ROUTING) {
 			switch_channel_hangup(caller_channel, cause);
 		}