band aid, beware of sip transfers

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3589 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-12-09 03:49:54 +00:00
parent d16297cc46
commit d3dca0313b
2 changed files with 13 additions and 5 deletions

View File

@ -3705,14 +3705,13 @@ static void sip_i_refer(nua_t *nua,
switch_core_session_t *bsession;
if ((bsession = switch_core_session_locate(br))) {
channel = switch_core_session_get_channel(bsession);
switch_channel_set_variable(channel, "TRANSFER_FALLBACK", (char *) from->a_user);
switch_ivr_session_transfer(bsession, exten, profile->dialplan, profile->context);
switch_core_session_rwunlock(bsession);
}
switch_channel_set_variable(channel, "endpoint_disposition", "BLIND_TRANSFER");
nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"),
SIPTAG_EVENT_STR(etmp),
@ -4008,8 +4007,8 @@ static void sip_i_invite(nua_t *nua,
}
attach_private(session, profile, tech_pvt, username);
switch_core_session_read_lock(session);
switch_set_flag(tech_pvt, TFLAG_RWLOCK);
//switch_core_session_read_lock(session);
//switch_set_flag(tech_pvt, TFLAG_RWLOCK);
channel = switch_core_session_get_channel(session);
switch_channel_set_variable(channel, "endpoint_disposition", "INBOUND CALL");
set_chat_hash(tech_pvt, sip);

View File

@ -3286,10 +3286,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_channel_event_set_data(caller_channel, event);
switch_event_fire(&event);
}
if (switch_channel_get_state(caller_channel) != CS_EXECUTE && !switch_channel_test_flag(caller_channel, CF_TRANSFER)) {
switch_channel_hangup(caller_channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
if (switch_channel_test_flag(caller_channel, CF_TRANSFER) && !switch_channel_test_flag(peer_channel, CF_TRANSFER)) {
switch_channel_hangup(peer_channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && switch_channel_test_flag(peer_channel, CF_TRANSFER)) {
switch_channel_hangup(caller_channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
this_audio_thread->objs[0] = NULL;
this_audio_thread->objs[1] = NULL;
this_audio_thread->objs[2] = NULL;