]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
caller/callee id flipping for blind xfer
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 14 Jun 2010 23:37:40 +0000 (18:37 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 14 Jun 2010 23:37:53 +0000 (18:37 -0500)
src/switch_ivr.c
src/switch_ivr_bridge.c

index d1abab3921635177d413a4e771c5b2e352982b2d..14f874289ab5ab281d0e84a62364cc9e5366d017 100644 (file)
@@ -1406,6 +1406,21 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
                new_profile->destination_number = switch_core_strdup(new_profile->pool, extension);
                new_profile->rdnis = switch_core_strdup(new_profile->pool, profile->destination_number);
 
+               if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
+                       if (profile->callee_id_name) {
+                               switch_channel_set_variable(channel, "pre_transfer_caller_id_name", new_profile->caller_id_name);
+                               new_profile->caller_id_name = switch_core_strdup(new_profile->pool, profile->callee_id_name);
+                               profile->callee_id_name = NULL;
+                       }
+
+                       if (profile->callee_id_number) {
+                               switch_channel_set_variable(channel, "pre_transfer_caller_id_number", new_profile->caller_id_number);
+                               new_profile->caller_id_number = switch_core_strdup(new_profile->pool, profile->callee_id_number);
+                               profile->callee_id_number = NULL;
+                       }
+               }
+               
+
                switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, NULL);
 
                /* If HANGUP_AFTER_BRIDGE is set to 'true', SWITCH_SIGNAL_BRIDGE_VARIABLE 
index 9d58ae6d889f0964f0d9ca54014ee04d8d2a3bbe..9cb56b22468a3433e94237256c24ae4dfccef232 100644 (file)
@@ -100,7 +100,8 @@ static void send_display(switch_core_session_t *session, switch_core_session_t *
        caller_channel = switch_core_session_get_channel(session);
        caller_profile = switch_channel_get_caller_profile(caller_channel);
 
-       if (switch_channel_direction(caller_channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
+       //      if (switch_channel_direction(caller_channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
+       if (!switch_channel_test_flag(caller_channel, CF_BRIDGE_ORIGINATOR)) {
                name = caller_profile->callee_id_name;
                number = caller_profile->callee_id_number;