]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add continue_on_fail param to bridgecall
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 2 Jan 2007 18:48:30 +0000 (18:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 2 Jan 2007 18:48:30 +0000 (18:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3892 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_bridgecall/mod_bridgecall.c

index 30b25770829ba7c21a05b7b3b26ce2e8111a777c..b982fce52cb1697e3dbed7322ece950c9697279c 100644 (file)
@@ -44,6 +44,7 @@ static void audio_bridge_function(switch_core_session_t *session, char *data)
        char *var;
        uint8_t no_media_bridge = 0;
        switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
+    uint8_t do_continue = 0;
 
     if (switch_strlen_zero(data)) {
         return;
@@ -55,6 +56,10 @@ static void audio_bridge_function(switch_core_session_t *session, char *data)
        if ((var = switch_channel_get_variable(caller_channel, "call_timeout"))) {
                timelimit = atoi(var);
        }
+
+       if ((var = switch_channel_get_variable(caller_channel, "continue_on_fail"))) {
+               do_continue = switch_true(var);
+       }
        
        if ((var = switch_channel_get_variable(caller_channel, "no_media")) && switch_true(var)) {
                if (!switch_channel_test_flag(caller_channel, CF_ANSWERED) && !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
@@ -67,8 +72,9 @@ static void audio_bridge_function(switch_core_session_t *session, char *data)
 
        if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Originate Failed.  Cause: %s\n", switch_channel_cause2str(cause));
-        if (cause != SWITCH_CAUSE_NO_ANSWER) {
-            /* All Causes besides NO_ANSWER terminate the originating session.  We will pass that cause on when we hangup.*/
+        if (!do_continue && cause != SWITCH_CAUSE_NO_ANSWER) {
+            /* All Causes besides NO_ANSWER terminate the originating session unless continue_on_fail is set.
+               We will pass the fail cause on when we hangup.*/
             switch_channel_hangup(caller_channel, cause);
         }
         /* Otherwise.. nobody answered.  Go back to the dialplan instructions in case there was more to do. */