[Freeswitch-svn] [commit] r8461 - freeswitch/trunk/src
Freeswitch SVN
anthm at freeswitch.org
Mon May 19 10:30:40 EDT 2008
Author: anthm
Date: Mon May 19 10:30:39 2008
New Revision: 8461
Modified:
freeswitch/trunk/src/switch_ivr.c
freeswitch/trunk/src/switch_ivr_bridge.c
Log:
fix small att_xfer issue from mailing list
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Mon May 19 10:30:39 2008
@@ -279,8 +279,9 @@
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;
Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c (original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c Mon May 19 10:30:39 2008
@@ -648,7 +648,8 @@
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 @@
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 @@
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)))) {
More information about the Freeswitch-svn
mailing list