]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-297
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 2 Mar 2009 23:55:00 +0000 (23:55 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 2 Mar 2009 23:55:00 +0000 (23:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12361 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c
src/switch_scheduler.c
src/switch_time.c

index a2ef4305683c7345e1bea5c8bf4d5383981315cf..d6046ed570e97cc6570c46a23948954fc298089b 100644 (file)
@@ -394,9 +394,9 @@ void sofia_event_callback(nua_event_t event,
                                                                                        (char *) sip->sip_request->rq_method_name, tech_pvt->key, strlen(tech_pvt->key), network_ip, NULL, 0,
                                                                                        REG_INVITE, NULL);
                }
-
+               
                if (auth_res != AUTH_OK) {
-                       switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                       //switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
                        nua_respond(nh, SIP_401_UNAUTHORIZED, TAG_END());
                        goto done;
                }
index 3e7dc4d3d5deb8a9c6a463a033304725e63742ee..b7b9ea8f7e6270abbf059573b3255ca6af378c6d 100644 (file)
@@ -285,9 +285,11 @@ SWITCH_DECLARE(uint32_t) switch_scheduler_del_task_group(const char *group)
        return delcnt;
 }
 
+switch_thread_t *task_thread_p = NULL;
+
 SWITCH_DECLARE(void) switch_scheduler_task_thread_start(void)
 {
-       switch_thread_t *thread;
+
        switch_threadattr_t *thd_attr;
 
        switch_core_new_memory_pool(&globals.memory_pool);
@@ -295,7 +297,7 @@ SWITCH_DECLARE(void) switch_scheduler_task_thread_start(void)
        switch_mutex_init(&globals.task_mutex, SWITCH_MUTEX_NESTED, globals.memory_pool);
 
        switch_threadattr_detach_set(thd_attr, 1);
-       switch_thread_create(&thread, thd_attr, switch_scheduler_task_thread, NULL, globals.memory_pool);
+       switch_thread_create(task_thread_p, thd_attr, switch_scheduler_task_thread, NULL, globals.memory_pool);
 }
 
 SWITCH_DECLARE(void) switch_scheduler_task_thread_stop(void)
@@ -303,8 +305,11 @@ SWITCH_DECLARE(void) switch_scheduler_task_thread_stop(void)
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping Task Thread\n");
        if (globals.task_thread_running == 1) {
                int sanity = 0;
+               switch_status_t st;
 
                globals.task_thread_running = -1;
+               
+               switch_thread_join(&st, task_thread_p);
 
                while (globals.task_thread_running) {
                        switch_yield(100000);
index 7cfa3034828863c24c5c572c8b9942f5057d99b0..cf69a3410e49ed8c5e805d29e9dcc5360061ee40 100644 (file)
@@ -174,7 +174,7 @@ SWITCH_DECLARE(void) switch_micro_sleep(switch_interval_time_t t)
 SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
 {
 
-       if (t < 1000 || t >= 10000) {
+       if (!globals.RUNNING || t < 1000 || t >= 10000) {
                do_sleep(t);
                return;
        }