Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d147dcd5
提交
d147dcd5
authored
6月 04, 2012
作者:
kapil
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'nsg-4.3' of
ssh://git.sangoma.com/smg_freeswitch
into nsg-4.3
上级
117cbc1b
67373e78
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
1180 行增加
和
17 行删除
+1180
-17
megaco.conf.xml
src/mod/endpoints/mod_megaco/conf/megaco.conf.xml
+3
-2
megaco.c
src/mod/endpoints/mod_megaco/megaco.c
+5
-3
megaco_stack.c
src/mod/endpoints/mod_megaco/megaco_stack.c
+1135
-1
megaco_stack.h
src/mod/endpoints/mod_megaco/megaco_stack.h
+6
-0
megaco_xml.c
src/mod/endpoints/mod_megaco/megaco_xml.c
+13
-0
mod_megaco.c
src/mod/endpoints/mod_megaco/mod_megaco.c
+18
-11
没有找到文件。
src/mod/endpoints/mod_megaco/conf/megaco.conf.xml
浏览文件 @
d147dcd5
...
...
@@ -5,8 +5,9 @@
<sng_mg_interface
name=
"default"
>
<param
name=
"id"
value=
"1"
/>
<!-- /* equivalent to SSAP ID of MEGACO layer */-->
<param
name=
"protocol"
value=
"MEGACO"
/>
<!-- /* Protocol Type , Supported values are MEGACO/MGCP */ -->
<param
name=
"version"
value=
"3"
/>
<!-- /* Protocol Version , Supported values for MEGACO are 1/2/3 */ -->
<param
name=
"transportProfileId"
value=
"1"
/>
<!-- /* Link to transport layer configuration -->
<param
name=
"localIp"
value=
"192.168.1.10
0
"
/>
<!-- /* Local node IP */ -->
<param
name=
"localIp"
value=
"192.168.1.10
1
"
/>
<!-- /* Local node IP */ -->
<param
name=
"port"
value=
"2944"
/>
<!-- /* Port */ -->
<param
name=
"myDomainName"
value=
"mg.sangoma.com"
/>
<!--/* Local domain name */ -->
<param
name=
"mid"
value=
"<lab.sangoma.com>"
/>
<!-- /* Message Identifier (MID) of MEGACO message */ -->
...
...
@@ -35,7 +36,7 @@
<sng_mg_peer_interface
name=
"MG_PEER1"
>
<param
name=
"id"
value=
"1"
/>
<!-- /* Peer profile ID */-->
<param
name=
"ip"
value=
"192.168.1.10
1
"
/>
<!-- /* Peer node IP */ -->
<param
name=
"ip"
value=
"192.168.1.10
0
"
/>
<!-- /* Peer node IP */ -->
<param
name=
"port"
value=
"2944"
/>
<!--/* peer port */ -->
<param
name=
"encodingScheme"
value=
"TEXT"
/>
<!--/* H.248 Encoding scheme TEXT/BINARY */ -->
<param
name=
"mid"
value=
"<remote.mgc.com>"
/>
<!-- /* Message Identifier (MID) of remote MGC MEGACO message */-->
...
...
src/mod/endpoints/mod_megaco/megaco.c
浏览文件 @
d147dcd5
...
...
@@ -45,7 +45,7 @@ static switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t r
goto
done
;
}
/* iterate through MG Interface list to build
all MG profiles
*/
/* iterate through MG Interface list to build
requested MG profile
*/
for
(
mg_interface
=
switch_xml_child
(
mg_interfaces
,
"sng_mg_interface"
);
mg_interface
;
mg_interface
=
mg_interface
->
next
)
{
const
char
*
name
=
switch_xml_attr_soft
(
mg_interface
,
"name"
);
...
...
@@ -161,9 +161,11 @@ switch_status_t megaco_profile_destroy(megaco_profile_t **profile)
switch_thread_rwlock_wrlock
((
*
profile
)
->
rwlock
);
/* TODO: Kapil: Insert stack per-interface shutdown code here */
/* stop MEGACP stack */
if
(
SWITCH_STATUS_FALSE
==
sng_mgco_stop
((
*
profile
)
->
name
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error stopping MEGACO Stack for profile %s
\n
"
,
(
*
profile
)
->
name
);
}
switch_thread_rwlock_unlock
((
*
profile
)
->
rwlock
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Stopped profile: %s
\n
"
,
(
*
profile
)
->
name
);
...
...
src/mod/endpoints/mod_megaco/megaco_stack.c
浏览文件 @
d147dcd5
差异被折叠。
点击展开。
src/mod/endpoints/mod_megaco/megaco_stack.h
浏览文件 @
d147dcd5
...
...
@@ -76,6 +76,7 @@ typedef struct sng_mg_cfg{
uint8_t
my_domain
[
MAX_DOMAIN_LEN
];
/* local domain name */
uint8_t
my_ipaddr
[
MAX_DOMAIN_LEN
];
/* local domain name */
uint32_t
port
;
/* port */
uint16_t
protocol_version
;
/* Protocol supported version */
uint16_t
peer_id
;
/* MGC Peer ID */
uint16_t
transport_prof_id
;
/* Transport profile id ..this also will be the spId for MG SAP*/
uint16_t
protocol_type
;
/* MEGACO/MGCP */
...
...
@@ -83,6 +84,7 @@ typedef struct sng_mg_cfg{
typedef
struct
sng_mg_gbl_cfg
{
int
num_of_mg_profiles
;
sng_mg_cfg_t
mgCfg
[
MAX_MG_PROFILES
+
1
];
sng_mg_transport_profile_t
mgTptProf
[
MG_MAX_PEERS
+
1
];
/* transport profile */
sng_mg_peers_t
mgPeer
;
...
...
@@ -108,7 +110,11 @@ void handle_tucl_alarm(Pst *pst, HiMngmt *sta);
switch_status_t
sng_mgco_init
(
sng_isup_event_interface_t
*
event
);
switch_status_t
sng_mgco_cfg
(
const
char
*
profilename
);
switch_status_t
sng_mgco_start
(
const
char
*
profilename
);
switch_status_t
sng_mgco_stop
(
const
char
*
profilename
);
switch_status_t
sng_mgco_stack_shutdown
(
void
);
int
sng_mgco_mg_get_status
(
int
elemId
,
MgMngmt
*
cfm
,
int
mg_cfg_idx
);
switch_status_t
megaco_profile_status
(
switch_stream_handle_t
*
stream
,
const
char
*
profilename
);
switch_status_t
megaco_profile_xmlstatus
(
switch_stream_handle_t
*
stream
,
const
char
*
profilename
);
/*****************************************************************************************************/
...
...
src/mod/endpoints/mod_megaco/megaco_xml.c
浏览文件 @
d147dcd5
...
...
@@ -46,6 +46,17 @@ switch_status_t sng_parse_mg_profile(switch_xml_t mg_interface)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" mg_interface protocol[%d]
\n
"
,
megaco_globals
.
g_mg_cfg
.
mgCfg
[
i
].
protocol_type
);
/********************************************************************************************/
}
else
if
(
!
strcasecmp
(
var
,
"version"
)){
/********************************************************************************************/
megaco_globals
.
g_mg_cfg
.
mgCfg
[
i
].
protocol_version
=
atoi
(
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" mg_interface protocol version[%s]
\n
"
,
val
);
if
((
megaco_globals
.
g_mg_cfg
.
mgCfg
[
i
].
protocol_version
<
1
)
||
(
megaco_globals
.
g_mg_cfg
.
mgCfg
[
i
].
protocol_version
>
3
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Invalid Protocol version[%s] , Supported values are [1/2/3]
\n
"
,
val
);
return
SWITCH_STATUS_FALSE
;
}
/********************************************************************************************/
}
else
if
(
!
strcasecmp
(
var
,
"transportProfileId"
)){
/********************************************************************************************/
megaco_globals
.
g_mg_cfg
.
mgCfg
[
i
].
transport_prof_id
=
atoi
(
val
);
...
...
@@ -214,6 +225,8 @@ switch_status_t sng_parse_mg_peer_profile(switch_xml_t mg_peer_profile)
}
}
strcpy
((
char
*
)
&
megaco_globals
.
g_mg_cfg
.
mgPeer
.
peers
[
i
].
name
[
0
],
prof_name
);
megaco_globals
.
g_mg_cfg
.
mgPeer
.
total_peer
++
;
return
SWITCH_STATUS_SUCCESS
;
}
...
...
src/mod/endpoints/mod_megaco/mod_megaco.c
浏览文件 @
d147dcd5
...
...
@@ -16,7 +16,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_megaco_shutdown);
SWITCH_MODULE_DEFINITION
(
mod_megaco
,
mod_megaco_load
,
mod_megaco_shutdown
,
NULL
);
#define MEGACO_FUNCTION_SYNTAX "profile [name] [start | stop]"
#define MEGACO_FUNCTION_SYNTAX "profile [name] [start | stop]
[status] [xmlstatus]
"
SWITCH_STANDARD_API
(
megaco_function
)
{
int
argc
;
...
...
@@ -56,7 +56,22 @@ SWITCH_STANDARD_API(megaco_function)
}
else
{
stream
->
write_function
(
stream
,
"-ERR No such profile
\n
"
);
}
}
else
if
(
!
strcmp
(
argv
[
2
],
"status"
))
{
megaco_profile_t
*
profile
=
megaco_profile_locate
(
argv
[
1
]);
if
(
profile
)
{
megaco_profile_status
(
stream
,
profile
->
name
);
}
else
{
stream
->
write_function
(
stream
,
"-ERR No such profile
\n
"
);
}
}
else
if
(
!
strcmp
(
argv
[
2
],
"xmlstatus"
))
{
megaco_profile_t
*
profile
=
megaco_profile_locate
(
argv
[
1
]);
if
(
profile
)
{
megaco_profile_xmlstatus
(
stream
,
profile
->
name
);
}
else
{
stream
->
write_function
(
stream
,
"-ERR No such profile
\n
"
);
}
}
}
goto
done
;
...
...
@@ -115,6 +130,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_megaco_load)
switch_console_set_complete
(
"add megaco profile ::megaco::list_profiles start"
);
switch_console_set_complete
(
"add megaco profile ::megaco::list_profiles stop"
);
switch_console_set_complete
(
"add megaco profile ::megaco::list_profiles status"
);
switch_console_set_complete
(
"add megaco profile ::megaco::list_profiles xmlstatus"
);
switch_console_add_complete_func
(
"::megaco::list_profiles"
,
list_profiles
);
...
...
@@ -209,16 +226,6 @@ void handle_mgco_audit_cfm(Pst *pst, SuId suId, MgMgtAudit* audit, Reason reason
}
/*****************************************************************************************************************************/
void
handle_mg_alarm
(
Pst
*
pst
,
MgMngmt
*
sta
)
{
/*TODO*/
}
/*****************************************************************************************************************************/
void
handle_tucl_alarm
(
Pst
*
pst
,
HiMngmt
*
sta
)
{
/*TODO*/
}
/*****************************************************************************************************************************/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论