mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-19 01:45:32 +00:00
FSCORE-297
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12361 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
2dbc6f85ca
commit
0c9541e985
@ -396,7 +396,7 @@ void sofia_event_callback(nua_event_t event,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (auth_res != AUTH_OK) {
|
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());
|
nua_respond(nh, SIP_401_UNAUTHORIZED, TAG_END());
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -285,9 +285,11 @@ SWITCH_DECLARE(uint32_t) switch_scheduler_del_task_group(const char *group)
|
|||||||
return delcnt;
|
return delcnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_thread_t *task_thread_p = NULL;
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_scheduler_task_thread_start(void)
|
SWITCH_DECLARE(void) switch_scheduler_task_thread_start(void)
|
||||||
{
|
{
|
||||||
switch_thread_t *thread;
|
|
||||||
switch_threadattr_t *thd_attr;
|
switch_threadattr_t *thd_attr;
|
||||||
|
|
||||||
switch_core_new_memory_pool(&globals.memory_pool);
|
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_mutex_init(&globals.task_mutex, SWITCH_MUTEX_NESTED, globals.memory_pool);
|
||||||
|
|
||||||
switch_threadattr_detach_set(thd_attr, 1);
|
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)
|
SWITCH_DECLARE(void) switch_scheduler_task_thread_stop(void)
|
||||||
@ -303,9 +305,12 @@ SWITCH_DECLARE(void) switch_scheduler_task_thread_stop(void)
|
|||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping Task Thread\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping Task Thread\n");
|
||||||
if (globals.task_thread_running == 1) {
|
if (globals.task_thread_running == 1) {
|
||||||
int sanity = 0;
|
int sanity = 0;
|
||||||
|
switch_status_t st;
|
||||||
|
|
||||||
globals.task_thread_running = -1;
|
globals.task_thread_running = -1;
|
||||||
|
|
||||||
|
switch_thread_join(&st, task_thread_p);
|
||||||
|
|
||||||
while (globals.task_thread_running) {
|
while (globals.task_thread_running) {
|
||||||
switch_yield(100000);
|
switch_yield(100000);
|
||||||
if (++sanity > 10) {
|
if (++sanity > 10) {
|
||||||
|
@ -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)
|
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);
|
do_sleep(t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user