From 0ba45ead647c6df0c560c09a2d4b6408f8395f68 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 19 May 2008 14:30:39 +0000 Subject: [PATCH] fix small att_xfer issue from mailing list git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8461 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr.c | 5 +++-- src/switch_ivr_bridge.c | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 4a3c9a3062..44efb18ca0 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -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; diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index d57693c445..c522b6bfa0 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -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)))) {