From c10d8e375da7b8881bc1a18d92adfdfbf129eaa8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 26 Aug 2009 21:53:43 +0000 Subject: [PATCH] add state change hooks for destroy git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14647 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_channel.c | 4 ++-- src/switch_core_state_machine.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index 141a1d2f57..6b75ef6cea 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -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 { diff --git a/src/switch_core_state_machine.c b/src/switch_core_state_machine.c index bbfd1d2fb1..12de83d27c 100644 --- a/src/switch_core_state_machine.c +++ b/src/switch_core_state_machine.c @@ -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;