]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix small att_xfer issue from mailing list
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 19 May 2008 14:30:39 +0000 (14:30 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 19 May 2008 14:30:39 +0000 (14:30 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8461 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr.c
src/switch_ivr_bridge.c

index 4a3c9a3062e7d552c985bb078d7c1b2c4228126e..44efb18ca0aab981fd9e6365c7a91a816c04211b 100644 (file)
@@ -279,8 +279,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
        if (lead_frames) {
                switch_frame_t *read_frame;
                int frame_count = atoi(lead_frames);
-
-               while(frame_count > 0) {
+               int max_frames = frame_count * 2;
+               
+               while(frame_count > 0 && --max_frames > 0) {
                        status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
                        if (!SWITCH_READ_ACCEPTABLE(status)) {
                                goto done;
index d57693c4455a560a19f53709391859fa34b3590f..c522b6bfa02167ddb229dfffec9a0e214af18dfb 100644 (file)
@@ -648,7 +648,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
        switch_channel_state_t state;
        switch_event_t *event;
        int br = 0;
-
+       int nosuspend = switch_channel_test_flag(caller_channel, CF_INNER_BRIDGE);
+       
        switch_channel_set_flag(caller_channel, CF_ORIGINATOR);
        switch_channel_clear_flag(caller_channel, CF_TRANSFER);
        switch_channel_clear_flag(peer_channel, CF_TRANSFER);
@@ -785,9 +786,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
 
   done:
 
-       switch_channel_clear_flag(caller_channel, CF_INNER_BRIDGE);
-       switch_channel_clear_flag(peer_channel, CF_INNER_BRIDGE);
-
        if (br && switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) {
                switch_channel_event_set_data(caller_channel, event);
                switch_event_fire(&event);
@@ -795,7 +793,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
 
        state = switch_channel_get_state(caller_channel);
        
-       if (!switch_channel_test_flag(caller_channel, CF_TRANSFER)) {
+       if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && !nosuspend) {
                if ((state != CS_EXECUTE && state != CS_PARK && state != CS_ROUTING) || 
                        (switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP && 
                         switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE)))) {