From 0a503b1a7742830c1d9edda042efe62afee6e6f4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 18 Jan 2012 18:08:52 -0600 Subject: [PATCH] FS-3794 revert some of baa11b2d03e8d09b18d704fa7c530f3fdff94b2e --- src/mod/endpoints/mod_sofia/mod_sofia.h | 1 - src/mod/endpoints/mod_sofia/sofia.c | 43 ++++--------------------- 2 files changed, 6 insertions(+), 38 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 629fd91e5f..32f0af7441 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -329,7 +329,6 @@ typedef enum { TFLAG_LIBERAL_DTMF, TFLAG_GOT_ACK, TFLAG_CAPTURE, - TFLAG_XFER_HUP, /* No new flags below this line */ TFLAG_MAX } TFLAGS; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index a16b5b9a15..43247e385b 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -88,18 +88,6 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status, sofia_dispatch_event_t *de, tagi_t tags[]) { - if (session) { - switch_channel_t *channel = switch_core_session_get_channel(session); - private_object_t *tech_pvt = NULL; - - if ((tech_pvt = switch_core_session_get_private(session))) { - if (sofia_test_flag(tech_pvt, TFLAG_XFER_HUP)) { - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - } - } - - } - if (status >= 300 && sip && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) { char *sql; @@ -577,7 +565,6 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status, if (!session) { nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END()); - return; } @@ -6642,13 +6629,9 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_core_session_rwunlock(a_session); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), - SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), - SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); - sofia_set_flag(tech_pvt, TFLAG_XFER_HUP); - if (b_tech_pvt && !sofia_test_flag(b_tech_pvt, TFLAG_BYE)) { char *q850 = NULL; const char *val = NULL; @@ -6712,13 +6695,9 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_ivr_uuid_bridge(br_b, br_a); switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), - SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), - SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); - - sofia_set_flag(tech_pvt, TFLAG_XFER_HUP); sofia_clear_flag_locked(b_tech_pvt, TFLAG_SIP_HOLD); switch_channel_clear_flag(channel_b, CF_LEG_HOLDING); sofia_clear_flag_locked(tech_pvt, TFLAG_HOLD_LOCK); @@ -6730,9 +6709,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot transfer channels that are not in a bridge.\n"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), - SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), - SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); } else { switch_core_session_t *t_session, *hup_session; @@ -6784,7 +6761,6 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); - sofia_set_flag(tech_pvt, TFLAG_XFER_HUP); switch_core_session_rwunlock(t_session); switch_channel_hangup(hup_channel, SWITCH_CAUSE_ATTENDED_TRANSFER); } else { @@ -6904,9 +6880,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Transfer! [%s]\n", br_a); switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER_ERROR"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), - SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), - SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); } } @@ -6948,18 +6922,13 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "BLIND_TRANSFER"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), - SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), - SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); - sofia_set_flag(tech_pvt, TFLAG_XFER_HUP); + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot Blind Transfer 1 Legged calls\n"); switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER_ERROR"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), - SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), - SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); } }