]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
test patch
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 8 Mar 2007 16:09:57 +0000 (16:09 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 8 Mar 2007 16:09:57 +0000 (16:09 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4482 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index e2fc5111ce16ba0b6f9b4dfe646ebd5829ff3f60..808de3db5df3083142967be666ded9004de2f972 100644 (file)
@@ -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);
                }
        }