提交 181db2d1 authored 作者: Michael Jerris's avatar Michael Jerris

fix hung channels when using respond app with 1xx or 2xx responses or on…

fix hung channels when using respond app with 1xx or 2xx responses or on re-invite in proxy/bypass media with 1xx and 2xx responses

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8062 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 bfd2d644
...@@ -948,12 +948,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi ...@@ -948,12 +948,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} }
if (!reason && code != 407) { if (!reason && code != 407) {
reason = "Call Refused"; reason = sip_status_phrase(code);
if (!reason) { if (switch_strlen_zero(reason)) {
reason = sip_status_phrase(code); reason = "Because";
if (switch_strlen_zero(reason)) {
reason = "Because";
}
} }
} }
...@@ -985,7 +982,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi ...@@ -985,7 +982,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
nua_respond(tech_pvt->nh, code, reason, TAG_IF(to_uri, SIPTAG_CONTACT_STR(to_uri)), nua_respond(tech_pvt->nh, code, reason, TAG_IF(to_uri, SIPTAG_CONTACT_STR(to_uri)),
SIPTAG_SUPPORTED_STR(NULL), SIPTAG_ACCEPT_STR(NULL), SIPTAG_SUPPORTED_STR(NULL), SIPTAG_ACCEPT_STR(NULL),
TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END()); TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
switch_set_flag_locked(tech_pvt, TFLAG_BYE); if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
switch_set_flag_locked(tech_pvt, TFLAG_BYE);
}
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding with %d %s\n", code, reason); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding with %d %s\n", code, reason);
...@@ -1005,7 +1004,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi ...@@ -1005,7 +1004,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} else { } else {
nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END()); nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END());
} }
switch_set_flag_locked(tech_pvt, TFLAG_BYE); if (!switch_channel_test_flag(channel, CF_ANSWERED) && code >= 300) {
switch_set_flag_locked(tech_pvt, TFLAG_BYE);
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论