[Freeswitch-trunk] [commit] r3589 - in freeswitch/trunk/src: . mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Fri Dec 8 22:49:55 EST 2006
Author: anthm
Date: Fri Dec 8 22:49:54 2006
New Revision: 3589
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/switch_ivr.c
Log:
band aid, beware of sip transfers
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Fri Dec 8 22:49:54 2006
@@ -3705,14 +3705,13 @@
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 @@
}
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);
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Fri Dec 8 22:49:54 2006
@@ -3286,9 +3286,18 @@
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;
More information about the Freeswitch-trunk
mailing list