add state change hooks for destroy

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14647 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-08-26 21:53:43 +00:00
parent 1eace1218a
commit c10d8e375d
2 changed files with 3 additions and 2 deletions

View File

@ -1049,7 +1049,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
switch_channel_presence(channel, "unknown", (const char *) state_names[state], NULL);
}
if (state < CS_HANGUP) {
if (state <= CS_DESTROY) {
switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) {
if (state == CS_ROUTING) {
@ -1285,7 +1285,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
channel->hangup_cause = SWITCH_CAUSE_NORMAL_CLEARING;
}
if (state < CS_DESTROY) {
if (state <= CS_DESTROY) {
switch_core_session_signal_state_change(channel->session);
}
} else {

View File

@ -553,6 +553,7 @@ SWITCH_DECLARE(void) switch_core_session_destroy_state(switch_core_session_t *se
int index = 0;
switch_assert(session != NULL);
switch_channel_set_running_state(session->channel, CS_DESTROY);
session->thread_running = 1;
endpoint_interface = session->endpoint_interface;