]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add state change hooks for destroy
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Aug 2009 21:53:43 +0000 (21:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Aug 2009 21:53:43 +0000 (21:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14647 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_channel.c
src/switch_core_state_machine.c

index 141a1d2f5718e8423ca676fb4d4a42dc84eeb37a..6b75ef6cea8dd555793274df35827e971cb346b1 100644 (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 {
index bbfd1d2fb13c6ec34f0e8086f0c85dfb5dc7eb7b..12de83d27cee3f860abf6c087980ec11bc23b01a 100644 (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;