optimize
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@963 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
011a5ccf12
commit
9ed06edb96
|
@ -338,6 +338,8 @@ typedef apr_threadattr_t switch_threadattr_t;
|
||||||
#define SWITCH_THREAD_FUNC APR_THREAD_FUNC
|
#define SWITCH_THREAD_FUNC APR_THREAD_FUNC
|
||||||
typedef apr_thread_start_t switch_thread_start_t;
|
typedef apr_thread_start_t switch_thread_start_t;
|
||||||
|
|
||||||
|
#define switch_threadattr_stacksize_set apr_threadattr_stacksize_set
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and initialize a new threadattr variable
|
* Create and initialize a new threadattr variable
|
||||||
* @param new_attr The newly created threadattr.
|
* @param new_attr The newly created threadattr.
|
||||||
|
|
|
@ -84,6 +84,7 @@ struct switch_directories {
|
||||||
typedef struct switch_directories switch_directories;
|
typedef struct switch_directories switch_directories;
|
||||||
SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs;
|
SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs;
|
||||||
|
|
||||||
|
#define SWITCH_THREAD_STACKSIZE 512 * 1024
|
||||||
#define SWITCH_RECCOMMENDED_BUFFER_SIZE 2048
|
#define SWITCH_RECCOMMENDED_BUFFER_SIZE 2048
|
||||||
#define SWITCH_MAX_CODECS 30
|
#define SWITCH_MAX_CODECS 30
|
||||||
#define SWITCH_MAX_STATE_HANDLERS 30
|
#define SWITCH_MAX_STATE_HANDLERS 30
|
||||||
|
|
|
@ -90,7 +90,6 @@ static struct {
|
||||||
switch_mutex_t *port_lock;
|
switch_mutex_t *port_lock;
|
||||||
int running;
|
int running;
|
||||||
int codec_ms;
|
int codec_ms;
|
||||||
int supress_telephony_events;
|
|
||||||
int dtmf_duration;
|
int dtmf_duration;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
} globals;
|
} globals;
|
||||||
|
@ -637,7 +636,7 @@ static switch_status exosip_read_frame(switch_core_session *session, switch_fram
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (globals.supress_telephony_events && payload != tech_pvt->payload_num) {
|
if (payload != tech_pvt->payload_num) {
|
||||||
tech_pvt->read_frame.datalen = 0;
|
tech_pvt->read_frame.datalen = 0;
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
continue;
|
continue;
|
||||||
|
@ -1582,8 +1581,6 @@ static int config_exosip(int reload)
|
||||||
globals.rtp_end = atoi(val);
|
globals.rtp_end = atoi(val);
|
||||||
} else if (!strcmp(var, "codec_ms")) {
|
} else if (!strcmp(var, "codec_ms")) {
|
||||||
globals.codec_ms = atoi(val);
|
globals.codec_ms = atoi(val);
|
||||||
} else if (!strcmp(var, "supress_telephony_events")) {
|
|
||||||
globals.supress_telephony_events = switch_true(val);
|
|
||||||
} else if (!strcmp(var, "dtmf_duration")) {
|
} else if (!strcmp(var, "dtmf_duration")) {
|
||||||
int dur = atoi(val);
|
int dur = atoi(val);
|
||||||
if (dur > 10 && dur < 8000) {
|
if (dur > 10 && dur < 8000) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -2080,7 +2080,7 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void
|
||||||
ts->pool = pool;
|
ts->pool = pool;
|
||||||
}
|
}
|
||||||
ts->objs[0] = obj;
|
ts->objs[0] = obj;
|
||||||
|
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
||||||
switch_thread_create(&thread, thd_attr, func, ts, pool);
|
switch_thread_create(&thread, thd_attr, func, ts, pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2114,6 +2114,7 @@ SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *sess
|
||||||
switch_threadattr_detach_set(thd_attr, 1);
|
switch_threadattr_detach_set(thd_attr, 1);
|
||||||
|
|
||||||
if (! session->thread_running) {
|
if (! session->thread_running) {
|
||||||
|
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
||||||
if (switch_thread_create(&thread, thd_attr, switch_core_session_thread, session, session->pool) != SWITCH_STATUS_SUCCESS) {
|
if (switch_thread_create(&thread, thd_attr, switch_core_session_thread, session, session->pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_core_session_destroy(&session);
|
switch_core_session_destroy(&session);
|
||||||
}
|
}
|
||||||
|
@ -2128,6 +2129,7 @@ SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *sess
|
||||||
switch_threadattr_create(&thd_attr, session->pool);
|
switch_threadattr_create(&thd_attr, session->pool);
|
||||||
switch_threadattr_detach_set(thd_attr, 1);
|
switch_threadattr_detach_set(thd_attr, 1);
|
||||||
|
|
||||||
|
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
||||||
switch_thread_create(&thread, thd_attr, func, obj, session->pool);
|
switch_thread_create(&thread, thd_attr, func, obj, session->pool);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -792,9 +792,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
data->running = 0;
|
data->running = 0;
|
||||||
switch_sleep(200000);
|
switch_sleep(500000);
|
||||||
data->running = 0;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue