Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
6f6765b8
提交
6f6765b8
authored
3月 27, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
start one msg thread per cpu by default
上级
ed193436
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
26 行增加
和
13 行删除
+26
-13
switch_core.h
src/include/switch_core.h
+2
-0
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+5
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+13
-13
switch_core.c
src/switch_core.c
+5
-0
没有找到文件。
src/include/switch_core.h
浏览文件 @
6f6765b8
...
...
@@ -217,6 +217,8 @@ SWITCH_DECLARE(uint32_t) switch_core_media_bug_clear_flag(_In_ switch_media_bug_
*/
SWITCH_DECLARE
(
void
)
switch_core_media_bug_set_read_replace_frame
(
_In_
switch_media_bug_t
*
bug
,
_In_
switch_frame_t
*
frame
);
SWITCH_DECLARE
(
uint32_t
)
switch_core_cpu_count
(
void
);
/*!
\brief Remove a media bug from the session
\param session the session to remove the bug from
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
6f6765b8
...
...
@@ -5353,6 +5353,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_chat_interface_t
*
chat_interface
;
switch_api_interface_t
*
api_interface
;
switch_management_interface_t
*
management_interface
;
uint32_t
cpus
=
switch_core_cpu_count
();
struct
in_addr
in
;
memset
(
&
mod_sofia_globals
,
0
,
sizeof
(
mod_sofia_globals
));
...
...
@@ -5390,6 +5391,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Waiting for profiles to start
\n
"
);
switch_yield
(
1500000
);
/* start one message thread per cpu */
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Starting %u message threads.
\n
"
,
cpus
);
sofia_msg_thread_start
(
cpus
);
if
(
switch_event_bind_removable
(
modname
,
SWITCH_EVENT_CUSTOM
,
MULTICAST_EVENT
,
event_handler
,
NULL
,
&
mod_sofia_globals
.
custom_node
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't bind!
\n
"
);
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
6f6765b8
...
...
@@ -1151,3 +1151,4 @@ void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t
void
sofia_process_dispatch_event
(
sofia_dispatch_event_t
**
dep
);
char
*
sofia_glue_get_host
(
const
char
*
str
,
switch_memory_pool_t
*
pool
);
void
sofia_presence_check_subscriptions
(
sofia_profile_t
*
profile
,
time_t
now
);
void
sofia_msg_thread_start
(
int
idx
);
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
6f6765b8
...
...
@@ -1232,7 +1232,7 @@ void *SWITCH_THREAD_FUNC sofia_msg_thread_run(switch_thread_t *thread, void *obj
static
int
IDX
=
0
;
static
void
sofia_msg_thread_start
(
int
idx
)
void
sofia_msg_thread_start
(
int
idx
)
{
if
(
idx
>=
SOFIA_MAX_MSG_QUEUE
||
(
idx
<
mod_sofia_globals
.
msg_queue_len
&&
mod_sofia_globals
.
msg_queue_thread
[
idx
]))
{
...
...
@@ -3616,6 +3616,18 @@ switch_status_t config_sofia(int reload, char *profile_name)
mod_sofia_globals
.
debug_sla
=
atoi
(
val
);
}
else
if
(
!
strcasecmp
(
var
,
"auto-restart"
))
{
mod_sofia_globals
.
auto_restart
=
switch_true
(
val
);
}
else
if
(
!
strcasecmp
(
var
,
"message-threads"
))
{
int
num
=
atoi
(
val
);
if
(
num
<
1
||
num
>
SOFIA_MAX_MSG_QUEUE
-
1
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"message-threads must be between 1 and %d"
,
SOFIA_MAX_MSG_QUEUE
-
1
);
}
if
(
num
<
1
)
num
=
1
;
if
(
num
>
SOFIA_MAX_MSG_QUEUE
-
1
)
num
=
SOFIA_MAX_MSG_QUEUE
-
1
;
sofia_msg_thread_start
(
num
);
}
else
if
(
!
strcasecmp
(
var
,
"reg-deny-binding-fetch-and-no-lookup"
))
{
/* backwards compatibility */
mod_sofia_globals
.
reg_deny_binding_fetch_and_no_lookup
=
switch_true
(
val
);
/* remove when noone complains about the extra lookup */
if
(
switch_true
(
val
))
{
...
...
@@ -3862,19 +3874,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
}
else
{
sofia_clear_pflag
(
profile
,
PFLAG_CID_IN_1XX
);
}
}
else
if
(
!
strcasecmp
(
var
,
"message-threads"
))
{
int
num
=
atoi
(
val
);
if
(
num
<
1
||
num
>
SOFIA_MAX_MSG_QUEUE
-
1
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"message-threads must be between 1 and %d"
,
SOFIA_MAX_MSG_QUEUE
-
1
);
}
if
(
num
<
1
)
num
=
1
;
if
(
num
>
SOFIA_MAX_MSG_QUEUE
-
1
)
num
=
SOFIA_MAX_MSG_QUEUE
-
1
;
sofia_msg_thread_start
(
num
);
}
else
if
(
!
strcasecmp
(
var
,
"disable-hold"
))
{
if
(
switch_true
(
val
))
{
sofia_set_pflag
(
profile
,
PFLAG_DISABLE_HOLD
);
...
...
src/switch_core.c
浏览文件 @
6f6765b8
...
...
@@ -724,6 +724,11 @@ SWITCH_DECLARE(int32_t) set_realtime_priority(void)
return
0
;
}
SWITCH_DECLARE
(
uint32_t
)
switch_core_cpu_count
(
void
)
{
return
runtime
.
cpu_count
;
}
SWITCH_DECLARE
(
int32_t
)
set_normal_priority
(
void
)
{
return
0
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论