fix 302 to hangup in the two cases where switch_ivr_transfer is used and not in the case when it should carry on and follow the redirect

This commit is contained in:
Brian West 2010-08-18 14:16:37 -05:00
parent 437c780536
commit 00b514033c
1 changed files with 2 additions and 1 deletions

View File

@ -3975,12 +3975,14 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Redirect: Transfering to %s %s %s\n", switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Redirect: Transfering to %s %s %s\n",
p_contact->m_url->url_user, sip_redirect_dialplan, sip_redirect_context); p_contact->m_url->url_user, sip_redirect_dialplan, sip_redirect_context);
switch_ivr_session_transfer(a_session, p_contact->m_url->url_user, sip_redirect_dialplan, sip_redirect_context); switch_ivr_session_transfer(a_session, p_contact->m_url->url_user, sip_redirect_dialplan, sip_redirect_context);
switch_channel_hangup(channel, SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION);
} else if ((!strcmp(profile->sipip, p_contact->m_url->url_host)) } else if ((!strcmp(profile->sipip, p_contact->m_url->url_host))
|| (profile->extsipip && !strcmp(profile->extsipip, p_contact->m_url->url_host)) || (profile->extsipip && !strcmp(profile->extsipip, p_contact->m_url->url_host))
|| (switch_xml_locate_domain(p_contact->m_url->url_host, NULL, &root, &domain) == SWITCH_STATUS_SUCCESS)) { || (switch_xml_locate_domain(p_contact->m_url->url_host, NULL, &root, &domain) == SWITCH_STATUS_SUCCESS)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Redirect: Transfering to %s\n", switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Redirect: Transfering to %s\n",
p_contact->m_url->url_user); p_contact->m_url->url_user);
switch_ivr_session_transfer(a_session, p_contact->m_url->url_user, NULL, NULL); switch_ivr_session_transfer(a_session, p_contact->m_url->url_user, NULL, NULL);
switch_channel_hangup(channel, SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION);
switch_xml_free(root); switch_xml_free(root);
} else { } else {
invite_contact = sofia_glue_strip_uri(full_contact); invite_contact = sofia_glue_strip_uri(full_contact);
@ -3996,7 +3998,6 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
free(stream.data); free(stream.data);
switch_core_session_rwunlock(a_session); switch_core_session_rwunlock(a_session);
switch_channel_hangup(channel, SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION);
} }
} else { } else {
su_home_t *home = su_home_new(sizeof(*home)); su_home_t *home = su_home_new(sizeof(*home));