MODAPP-376 .. AGAIN

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15844 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-12-08 17:22:42 +00:00
parent bdd80b759a
commit 2f4fcf9a9f
2 changed files with 17 additions and 3 deletions

View File

@ -1563,7 +1563,6 @@ SWITCH_STANDARD_APP(att_xfer_function)
}
switch_channel_set_variable(channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, bond);
switch_channel_set_flag(channel, CF_XFER_ZOMBIE);
if (switch_ivr_originate(session, &peer_session, &cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL)
!= SWITCH_STATUS_SUCCESS || !peer_session) {

View File

@ -2465,7 +2465,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
} else {
oglobals.ringback_ok = 0;
}
soft_holding = switch_channel_get_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE);
while ((!caller_channel || switch_channel_ready(caller_channel) || switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) &&
check_channel_status(&oglobals, originate_status, and_argc)) {
time_t elapsed = switch_epoch_time_now(NULL) - start;
@ -2542,6 +2544,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (switch_channel_media_ready(caller_channel)) {
tstatus = switch_core_session_read_frame(oglobals.session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
if (soft_holding) {
switch_channel_set_flag(caller_channel, CF_XFER_ZOMBIE);
}
if (switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
continue;
}
@ -2607,6 +2613,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if ((write_frame.datalen = (uint32_t) switch_buffer_read_loop(ringback.audio_buffer,
write_frame.data,
write_frame.codec->implementation->decoded_bytes_per_packet)) <= 0) {
if (soft_holding) {
switch_channel_set_flag(caller_channel, CF_XFER_ZOMBIE);
continue;
}
break;
}
} else if (ringback.silence) {
@ -2623,6 +2635,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
}
if (switch_core_session_write_frame(oglobals.session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
if (soft_holding) {
switch_channel_set_flag(caller_channel, CF_XFER_ZOMBIE);
}
if (switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
continue;
}
@ -2639,12 +2654,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
notready:
if (caller_channel) {
soft_holding = switch_channel_get_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE);
holding = switch_channel_get_variable(caller_channel, SWITCH_HOLDING_UUID_VARIABLE);
switch_channel_set_variable(caller_channel, SWITCH_HOLDING_UUID_VARIABLE, NULL);
if (soft_holding && switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
holding = soft_holding;
soft_holding = NULL;
switch_channel_set_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, NULL);
}
}