forked from Mirrors/freeswitch
test patch
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4482 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
23be1abf52
commit
5a166b4ba3
|
@ -915,21 +915,13 @@ static void terminate_session(switch_core_session_t **session, switch_call_cause
|
|||
switch_channel_t *channel = switch_core_session_get_channel(*session);
|
||||
switch_channel_state_t state = switch_channel_get_state(channel);
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
uint8_t running = switch_core_session_running(*session);
|
||||
tech_pvt = switch_core_session_get_private(*session);
|
||||
|
||||
if (tech_pvt) {
|
||||
if (state < CS_HANGUP) {
|
||||
switch_channel_hangup(channel, cause);
|
||||
}
|
||||
|
||||
if (!switch_test_flag(tech_pvt, TFLAG_READY)) {
|
||||
if (state > CS_INIT && state < CS_HANGUP) {
|
||||
sofia_on_hangup(*session);
|
||||
}
|
||||
switch_core_session_destroy(session);
|
||||
}
|
||||
|
||||
if (running) {
|
||||
switch_channel_hangup(channel, cause);
|
||||
} else {
|
||||
sofia_on_hangup(*session);
|
||||
switch_core_session_destroy(session);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue