Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
cb73fdf2
提交
cb73fdf2
authored
6月 19, 2012
作者:
David Yat Sin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added parsing for additional parameters for UI team to test their code
上级
8846e1fe
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
51 行增加
和
14 行删除
+51
-14
media_gateway_xml.c
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
+27
-2
mod_media_gateway.h
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
+24
-12
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
浏览文件 @
cb73fdf2
...
...
@@ -19,7 +19,7 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
switch_xml_t
cfg
,
xml
,
param
,
mg_interfaces
,
mg_interface
,
mg_peers
,
mg_peer
,
peer_interfaces
;
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
switch_event_t
*
event
=
NULL
;
const
char
*
file
=
"me
gaco
.conf"
;
const
char
*
file
=
"me
dia_gateway
.conf"
;
switch_xml_config_item_t
*
instructions
=
(
profile
?
get_instructions
(
profile
)
:
NULL
);
int
count
;
int
idx
;
...
...
@@ -63,6 +63,11 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
break
;
}
if
(
!
mg_interface
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error profile %s not found
\n
"
,
profile
->
name
);
return
SWITCH_STATUS_FALSE
;
}
/* go through the peer configuration and get the mg profile associated peers only */
if
(
!
(
mg_peers
=
switch_xml_child
(
cfg
,
"mg_peers"
)))
{
goto
done
;
...
...
@@ -144,10 +149,25 @@ static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) {
static
switch_xml_config_int_options_t
opt_version
=
{
SWITCH_TRUE
,
/* enforce min */
1
,
SWITCH_TRUE
,
/*
E
nforce Max */
SWITCH_TRUE
,
/*
e
nforce Max */
3
};
static
switch_xml_config_int_options_t
opt_termination_id_len
=
{
SWITCH_TRUE
,
/* enforce min */
1
,
SWITCH_TRUE
,
/* enforce Max */
9
};
static
switch_xml_config_enum_item_t
opt_default_codec_enum
[]
=
{
{
"PCMA"
,
MEGACO_CODEC_PCMA
},
{
"PCMU"
,
MEGACO_CODEC_PCMU
},
{
"G.729"
,
MEGACO_CODEC_G729
},
{
"G.723.1"
,
MEGACO_CODEC_G723_1
},
{
"ILBC"
,
MEGACO_CODEC_ILBC
},
};
switch_xml_config_item_t
instructions
[]
=
{
/* parameter name type reloadable pointer default value options structure */
SWITCH_CONFIG_ITEM
(
"protocol"
,
SWITCH_CONFIG_STRING
,
CONFIG_RELOADABLE
,
&
profile
->
protocol_type
,
"MEGACO"
,
&
switch_config_string_strdup
,
""
,
"MG Protocol type"
),
...
...
@@ -156,6 +176,11 @@ static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) {
SWITCH_CONFIG_ITEM
(
"port"
,
SWITCH_CONFIG_STRING
,
0
,
&
profile
->
port
,
"2944"
,
&
switch_config_string_strdup
,
""
,
"port"
),
SWITCH_CONFIG_ITEM
(
"domain-name"
,
SWITCH_CONFIG_STRING
,
0
,
&
profile
->
my_domain
,
""
,
&
switch_config_string_strdup
,
""
,
"domain name"
),
SWITCH_CONFIG_ITEM
(
"message-identifier"
,
SWITCH_CONFIG_STRING
,
0
,
&
profile
->
mid
,
""
,
&
switch_config_string_strdup
,
""
,
"message identifier "
),
SWITCH_CONFIG_ITEM
(
"default-codec"
,
SWITCH_CONFIG_ENUM
,
CONFIG_RELOADABLE
,
&
profile
->
default_codec
,
"PCMU"
,
&
opt_default_codec_enum
,
""
,
"default codec"
),
SWITCH_CONFIG_ITEM
(
"rtp-port-range"
,
SWITCH_CONFIG_STRING
,
CONFIG_REQUIRED
,
&
profile
->
rtp_port_range
,
"1-65535"
,
&
switch_config_string_strdup
,
""
,
"rtp port range"
),
SWITCH_CONFIG_ITEM
(
"rtp-termination-id-prefix"
,
SWITCH_CONFIG_STRING
,
CONFIG_RELOADABLE
,
&
profile
->
rtp_termination_id_prefix
,
""
,
&
switch_config_string_strdup
,
""
,
"rtp termination prefix"
),
SWITCH_CONFIG_ITEM
(
"rtp-termination-id-len"
,
SWITCH_CONFIG_INT
,
CONFIG_RELOADABLE
,
&
profile
->
rtp_termination_id_len
,
""
,
&
opt_termination_id_len
,
""
,
"rtp termination id"
),
SWITCH_CONFIG_ITEM_END
()
};
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
浏览文件 @
cb73fdf2
...
...
@@ -32,6 +32,14 @@ typedef enum {
PF_RUNNING
=
(
1
<<
0
)
}
megaco_profile_flags_t
;
typedef
enum
{
MEGACO_CODEC_PCMA
,
MEGACO_CODEC_PCMU
,
MEGACO_CODEC_G729
,
MEGACO_CODEC_G723_1
,
MEGACO_CODEC_ILBC
,
}
megaco_codec_t
;
typedef
struct
mg_peer_profile_s
{
char
*
name
;
switch_memory_pool_t
*
pool
;
...
...
@@ -47,18 +55,22 @@ typedef struct mg_peer_profile_s{
typedef
struct
megaco_profile_s
{
char
*
name
;
switch_memory_pool_t
*
pool
;
switch_thread_rwlock_t
*
rwlock
;
/* < Reference counting rwlock */
megaco_profile_flags_t
flags
;
int
idx
;
/* Trillium MEGACO SAP identification*/
char
*
mid
;
/* MG H.248 MID */
char
*
my_domain
;
/* local domain name */
char
*
my_ipaddr
;
/* local domain name */
char
*
port
;
/* port */
char
*
protocol_type
;
/* MEGACO/MGCP */
int
protocol_version
;
/* Protocol supported version */
int
total_peers
;
char
*
peer_list
[
MG_MAX_PEERS
];
/* MGC Peer ID LIST */
switch_memory_pool_t
*
pool
;
switch_thread_rwlock_t
*
rwlock
;
/* < Reference counting rwlock */
megaco_profile_flags_t
flags
;
int
idx
;
/* Trillium MEGACO SAP identification*/
char
*
mid
;
/* MG H.248 MID */
char
*
my_domain
;
/* local domain name */
char
*
my_ipaddr
;
/* local domain name */
char
*
port
;
/* port */
char
*
protocol_type
;
/* MEGACO/MGCP */
int
protocol_version
;
/* Protocol supported version */
int
total_peers
;
megaco_codec_t
default_codec
;
char
*
rtp_port_range
;
char
*
rtp_termination_id_prefix
;
int
rtp_termination_id_len
;
char
*
peer_list
[
MG_MAX_PEERS
];
/* MGC Peer ID LIST */
}
megaco_profile_t
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论