]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix linksys transfers
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 17 Nov 2008 20:13:12 +0000 (20:13 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 17 Nov 2008 20:13:12 +0000 (20:13 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10429 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_bridge.c
src/switch_ivr_originate.c

index 16290b2d9d4dbaff37c4c92fad4a2164627104c5..1ce1b015cec7cc3c4b509f81b1087615b81f68df 100644 (file)
@@ -527,6 +527,7 @@ static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM RESET\n", switch_channel_get_name(channel));
 
        switch_channel_clear_flag(channel, CF_TRANSFER);
+       switch_channel_clear_flag(channel, CF_ORIGINATING);
 
        if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
                switch_channel_set_state(channel, CS_SOFT_EXECUTE);
index f4c4505524f9dadc3748de40284466487fa5786f..44f845428b0e1b3bdf671a3aaa1c5c6dbf41020b 100644 (file)
@@ -1645,16 +1645,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                        continue;
                                }
                                
-                               switch_channel_clear_flag(peer_channels[i], CF_ORIGINATING);
                                if (status == SWITCH_STATUS_SUCCESS) { 
+                                       switch_channel_clear_flag(peer_channels[i], CF_ORIGINATING);
                                        if (bleg && *bleg && *bleg == peer_sessions[i]) {
                                                continue;
                                        }
-                               } else if ((state=switch_channel_get_state(peer_channels[i])) < CS_HANGUP) {
-                                       if (!(state == CS_RESET || switch_channel_test_flag(peer_channels[i], CF_TRANSFER))) {
+                               } else if ((state=switch_channel_get_state(peer_channels[i])) < CS_HANGUP && switch_channel_test_flag(peer_channels[i], CF_ORIGINATING)) {
+                                       if (!(state == CS_RESET || switch_channel_test_flag(peer_channels[i], CF_TRANSFER) || 
+                                                 switch_channel_test_flag(peer_channels[i], CF_BRIDGED))) {
                                                switch_channel_hangup(peer_channels[i], *cause);
                                        }
                                }
+                               switch_channel_clear_flag(peer_channels[i], CF_ORIGINATING);
 
                                switch_core_session_rwunlock(peer_sessions[i]);
                        }