]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5530 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Jun 2013 01:58:55 +0000 (20:58 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Jun 2013 01:58:55 +0000 (20:58 -0500)
src/switch_ivr_bridge.c

index 9e718a10965f58c52fbd86961ee349e76bfffd97..202c2f46f2c8c1850746dfcf76bbc892d27f520c 100644 (file)
@@ -1542,17 +1542,25 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
                                switch_ivr_park_session(session);
                        } else if ((var = switch_channel_get_variable(caller_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
                                transfer_after_bridge(session, var);
-                       } else if (switch_channel_test_flag(peer_channel, CF_ANSWERED) &&
-                                          switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE))) {
-                               switch_call_cause_t cause = switch_channel_get_cause(peer_channel);
-                               if (cause == SWITCH_CAUSE_NONE) {
-                                       cause = SWITCH_CAUSE_NORMAL_CLEARING;
+                       } else {
+                               const char *hup = switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE);
+                               int explicit = 0;
+
+                               if (hup) {
+                                       explicit = !strcasecmp(hup, "explicit");
                                }
 
-                               if (switch_channel_test_flag(peer_channel, CF_INTERCEPTED)) {
-                                       switch_channel_set_flag(peer_channel, CF_INTERCEPT);
+                               if (explicit || (switch_channel_test_flag(peer_channel, CF_ANSWERED) && switch_true(hup))) {
+                                       switch_call_cause_t cause = switch_channel_get_cause(peer_channel);
+                                       if (cause == SWITCH_CAUSE_NONE) {
+                                               cause = SWITCH_CAUSE_NORMAL_CLEARING;
+                                       }
+                                       
+                                       if (switch_channel_test_flag(peer_channel, CF_INTERCEPTED)) {
+                                               switch_channel_set_flag(peer_channel, CF_INTERCEPT);
+                                       }
+                                       switch_channel_hangup(caller_channel, cause);
                                }
-                               switch_channel_hangup(caller_channel, cause);
                        }
                }
        }