another regression
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12693 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
5b6b9f89ab
commit
ed35b00a0a
|
@ -309,8 +309,6 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
|
|||
switch_event_header_t *hi;
|
||||
char *bye_headers = NULL;
|
||||
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
|
||||
|
||||
SWITCH_STANDARD_STREAM(stream);
|
||||
if ((hi = switch_channel_variable_first(channel))) {
|
||||
for (; hi; hi = hi->next) {
|
||||
|
@ -342,22 +340,25 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
|
|||
switch_channel_set_variable(channel, "sip_hangup_disposition", "send_bye");
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending BYE to %s\n", switch_channel_get_name(channel));
|
||||
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
nua_bye(tech_pvt->nh,
|
||||
SIPTAG_REASON_STR(reason),
|
||||
TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
|
||||
TAG_END());
|
||||
}
|
||||
} else {
|
||||
if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending CANCEL to %s\n", switch_channel_get_name(channel));
|
||||
if (!tech_pvt->got_bye) {
|
||||
switch_channel_set_variable(channel, "sip_hangup_disposition", "send_cancel");
|
||||
}
|
||||
|
||||
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
nua_cancel(tech_pvt->nh,
|
||||
SIPTAG_REASON_STR(reason),
|
||||
TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
|
||||
TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
|
||||
TAG_END());
|
||||
}
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding to INVITE with: %d\n", sip_cause);
|
||||
if (!tech_pvt->got_bye) {
|
||||
|
@ -372,7 +373,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
|
||||
switch_safe_free(stream.data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue