]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODSOFIA-18
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 22 Jul 2009 19:14:47 +0000 (19:14 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 22 Jul 2009 19:14:47 +0000 (19:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14319 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/private/switch_core_pvt.h
src/include/switch_apr.h
src/mod/endpoints/mod_sofia/sofia.c
src/switch_core_state_machine.c

index 70f19bfa628c38fea6c5a68d053e6ec429429957..e3519bc10e5a9b7fa05803ed2f5e9bd560972964 100644 (file)
@@ -127,7 +127,7 @@ struct switch_core_session {
        void *streams[SWITCH_MAX_STREAMS];
        int stream_count;
 
-       char uuid_str[128];
+       char uuid_str[SWITCH_UUID_FORMATTED_LENGTH+1];
        void *private_info;
        switch_queue_t *event_queue;
        switch_queue_t *message_queue;
index 0bde6750aabb913dc4aa1afcdd7fd536805e3ea6..bb02f3e3c438b566a598913d3088dd040e345023 100644 (file)
@@ -521,7 +521,7 @@ SWITCH_DECLARE(switch_status_t) switch_thread_cond_destroy(switch_thread_cond_t
         } switch_uuid_t;
 
 /** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */
-#define SWITCH_UUID_FORMATTED_LENGTH 36
+#define SWITCH_UUID_FORMATTED_LENGTH 256
 
 #define SWITCH_MD5_DIGESTSIZE 16
 #define SWITCH_MD5_DIGEST_STRING_SIZE 33
index 1578af5c5d21af8cc338bd5ac7b398e30de9ee4c..34364779e5df179ad4f52dd280087b3b86f09ac2 100644 (file)
@@ -416,25 +416,22 @@ void sofia_event_callback(nua_event_t event,
                                        tech_pvt->call_id = switch_core_session_strdup(session, sip->sip_call_id->i_id);
                                        switch_channel_set_variable(channel, "sip_call_id", tech_pvt->call_id);
                                }
+
                                if (tech_pvt->gateway_name) {
                                        gateway = sofia_reg_find_gateway(tech_pvt->gateway_name);
                                }
+
+                               if (channel && switch_channel_down(channel)) {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already hungup.\n");
+                                       goto done;
+                               }
                        } else {
-                               /* too late */
+                               /* we can't find the session it must be hanging up or something else, its too late to do anything with it. */
                                return;
                        }
                }
        }
 
-       if (session) {
-               if (channel && switch_channel_down(channel)) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already hungup.\n");
-                       goto done;
-               }
-       } else if (sofia_private && sofia_private->is_call) {
-               sofia_private->destroy_me = 22;
-       }
-
        if (sofia_test_pflag(profile, PFLAG_AUTH_ALL) && tech_pvt && tech_pvt->key && sip) {
                sip_authorization_t const *authorization = NULL;
 
index 6fd0db9f0d12d3e1f33c58b1fc6f36ac67d8ca51..1f406d07139c71ed3e4c2ab02305f4c49d514df5 100644 (file)
@@ -332,7 +332,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
        switch_thread_id_t thread_id;
        jmp_buf env;
        int sig, silly = 0;
-       uint32_t new_loops = 60000000;
+       uint32_t new_loops = 60000;
 
        if (switch_test_flag((&runtime), SCF_CRASH_PROT)) {
                thread_id = switch_thread_self();