Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e3c427ad
提交
e3c427ad
authored
10月 08, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix default ptime for iLBC and make new configurable global map in switch.conf.xml
上级
fdba0e07
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
54 行增加
和
9 行删除
+54
-9
switch.conf.xml
conf/autoload_configs/switch.conf.xml
+5
-0
switch_core_pvt.h
src/include/private/switch_core_pvt.h
+1
-0
switch_core.h
src/include/switch_core.h
+1
-0
switch_utils.h
src/include/switch_utils.h
+0
-9
switch_core.c
src/switch_core.c
+47
-0
没有找到文件。
conf/autoload_configs/switch.conf.xml
浏览文件 @
e3c427ad
...
@@ -15,6 +15,11 @@
...
@@ -15,6 +15,11 @@
<key
name=
"12"
value=
"version"
/>
<key
name=
"12"
value=
"version"
/>
</cli-keybindings>
</cli-keybindings>
<default-ptimes>
<!-- set this to overide the 20ms assumption of various codecs in the sdp with no ptime defined -->
<!--<codec name="G729" ptime="40"/>-->
</default-ptimes>
<settings>
<settings>
<!--Colorize the Console -->
<!--Colorize the Console -->
<param
name=
"colorize-console"
value=
"true"
/>
<param
name=
"colorize-console"
value=
"true"
/>
...
...
src/include/private/switch_core_pvt.h
浏览文件 @
e3c427ad
...
@@ -199,6 +199,7 @@ struct switch_runtime {
...
@@ -199,6 +199,7 @@ struct switch_runtime {
int64_t
offset
;
int64_t
offset
;
switch_event_t
*
global_vars
;
switch_event_t
*
global_vars
;
switch_hash_t
*
mime_types
;
switch_hash_t
*
mime_types
;
switch_hash_t
*
ptimes
;
switch_memory_pool_t
*
memory_pool
;
switch_memory_pool_t
*
memory_pool
;
const
switch_state_handler_table_t
*
state_handlers
[
SWITCH_MAX_STATE_HANDLERS
];
const
switch_state_handler_table_t
*
state_handlers
[
SWITCH_MAX_STATE_HANDLERS
];
int
state_handler_index
;
int
state_handler_index
;
...
...
src/include/switch_core.h
浏览文件 @
e3c427ad
...
@@ -2168,6 +2168,7 @@ SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
...
@@ -2168,6 +2168,7 @@ SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
SWITCH_DECLARE
(
void
)
switch_cache_db_flush_handles
(
void
);
SWITCH_DECLARE
(
void
)
switch_cache_db_flush_handles
(
void
);
SWITCH_DECLARE
(
const
char
*
)
switch_core_banner
(
void
);
SWITCH_DECLARE
(
const
char
*
)
switch_core_banner
(
void
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_session_in_thread
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_session_in_thread
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
uint32_t
)
switch_default_ptime
(
const
char
*
name
,
uint32_t
number
);
SWITCH_END_EXTERN_C
SWITCH_END_EXTERN_C
#endif
#endif
...
...
src/include/switch_utils.h
浏览文件 @
e3c427ad
...
@@ -376,15 +376,6 @@ switch_mutex_unlock(obj->flag_mutex);
...
@@ -376,15 +376,6 @@ switch_mutex_unlock(obj->flag_mutex);
#define switch_set_string(_dst, _src) switch_copy_string(_dst, _src, sizeof(_dst))
#define switch_set_string(_dst, _src) switch_copy_string(_dst, _src, sizeof(_dst))
static
inline
uint32_t
switch_default_ptime
(
const
char
*
name
,
uint32_t
number
)
{
if
(
!
strcasecmp
(
name
,
"G723"
))
{
return
30
;
}
return
20
;
}
static
inline
char
*
switch_sanitize_number
(
char
*
number
)
static
inline
char
*
switch_sanitize_number
(
char
*
number
)
{
{
char
*
p
=
number
,
*
q
;
char
*
p
=
number
,
*
q
;
...
...
src/switch_core.c
浏览文件 @
e3c427ad
...
@@ -1275,6 +1275,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
...
@@ -1275,6 +1275,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
switch_core_session_init
(
runtime
.
memory_pool
);
switch_core_session_init
(
runtime
.
memory_pool
);
switch_event_create_plain
(
&
runtime
.
global_vars
,
SWITCH_EVENT_CHANNEL_DATA
);
switch_event_create_plain
(
&
runtime
.
global_vars
,
SWITCH_EVENT_CHANNEL_DATA
);
switch_core_hash_init
(
&
runtime
.
mime_types
,
runtime
.
memory_pool
);
switch_core_hash_init
(
&
runtime
.
mime_types
,
runtime
.
memory_pool
);
switch_core_hash_init_case
(
&
runtime
.
ptimes
,
runtime
.
memory_pool
,
SWITCH_FALSE
);
load_mime_types
();
load_mime_types
();
runtime
.
flags
|=
flags
;
runtime
.
flags
|=
flags
;
runtime
.
sps_total
=
30
;
runtime
.
sps_total
=
30
;
...
@@ -1405,13 +1406,58 @@ static void handle_SIGHUP(int sig)
...
@@ -1405,13 +1406,58 @@ static void handle_SIGHUP(int sig)
}
}
SWITCH_DECLARE
(
uint32_t
)
switch_default_ptime
(
const
char
*
name
,
uint32_t
number
)
{
uint32_t
*
p
;
if
((
p
=
switch_core_hash_find
(
runtime
.
ptimes
,
name
)))
{
return
*
p
;
}
return
20
;
}
static
uint32_t
d_30
=
30
;
static
void
switch_load_core_config
(
const
char
*
file
)
static
void
switch_load_core_config
(
const
char
*
file
)
{
{
switch_xml_t
xml
=
NULL
,
cfg
=
NULL
;
switch_xml_t
xml
=
NULL
,
cfg
=
NULL
;
switch_core_hash_insert
(
runtime
.
ptimes
,
"ilbc"
,
&
d_30
);
switch_core_hash_insert
(
runtime
.
ptimes
,
"G723"
,
&
d_30
);
if
((
xml
=
switch_xml_open_cfg
(
file
,
&
cfg
,
NULL
)))
{
if
((
xml
=
switch_xml_open_cfg
(
file
,
&
cfg
,
NULL
)))
{
switch_xml_t
settings
,
param
;
switch_xml_t
settings
,
param
;
if
((
settings
=
switch_xml_child
(
cfg
,
"default-ptimes"
)))
{
for
(
param
=
switch_xml_child
(
settings
,
"codec"
);
param
;
param
=
param
->
next
)
{
const
char
*
var
=
switch_xml_attr_soft
(
param
,
"name"
);
const
char
*
val
=
switch_xml_attr_soft
(
param
,
"ptime"
);
if
(
!
zstr
(
var
)
&&
!
zstr
(
val
))
{
uint32_t
*
p
;
uint32_t
v
=
(
unsigned
long
)
atol
(
val
);
if
(
!
strcasecmp
(
var
,
"G723"
)
||
!
strcasecmp
(
var
,
"iLBC"
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Error adding %s, defaults cannot be changed
\n
"
,
var
);
continue
;
}
if
(
v
<
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Error adding %s, invalid ptime
\n
"
,
var
);
continue
;
}
p
=
switch_core_alloc
(
runtime
.
memory_pool
,
sizeof
(
*
p
));
*
p
=
v
;
switch_core_hash_insert
(
runtime
.
ptimes
,
var
,
p
);
}
}
}
if
((
settings
=
switch_xml_child
(
cfg
,
"settings"
)))
{
if
((
settings
=
switch_xml_child
(
cfg
,
"settings"
)))
{
for
(
param
=
switch_xml_child
(
settings
,
"param"
);
param
;
param
=
param
->
next
)
{
for
(
param
=
switch_xml_child
(
settings
,
"param"
);
param
;
param
=
param
->
next
)
{
const
char
*
var
=
switch_xml_attr_soft
(
param
,
"name"
);
const
char
*
var
=
switch_xml_attr_soft
(
param
,
"name"
);
...
@@ -1973,6 +2019,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
...
@@ -1973,6 +2019,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_safe_free
(
SWITCH_GLOBAL_dirs
.
temp_dir
);
switch_safe_free
(
SWITCH_GLOBAL_dirs
.
temp_dir
);
switch_event_destroy
(
&
runtime
.
global_vars
);
switch_event_destroy
(
&
runtime
.
global_vars
);
switch_core_hash_destroy
(
&
runtime
.
ptimes
);
switch_core_hash_destroy
(
&
runtime
.
mime_types
);
switch_core_hash_destroy
(
&
runtime
.
mime_types
);
if
(
IP_LIST
.
hash
)
{
if
(
IP_LIST
.
hash
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论