Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e3eed73e
提交
e3eed73e
authored
6月 25, 2012
作者:
kapil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adding mg and peer profile cleanup code during shutdown and removing
"unused variables" warnings
上级
fa616a37
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
59 行增加
和
6 行删除
+59
-6
media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway.c
+15
-0
media_gateway_xml.c
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
+9
-0
mod_media_gateway.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
+33
-6
mod_media_gateway.h
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
+2
-0
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway.c
浏览文件 @
e3eed73e
...
...
@@ -107,6 +107,21 @@ switch_status_t megaco_profile_destroy(megaco_profile_t **profile)
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
megaco_peer_profile_destroy
(
mg_peer_profile_t
**
profile
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Stopping peer profile: %s
\n
"
,
(
*
profile
)
->
name
);
switch_core_hash_delete_wrlock
(
megaco_globals
.
peer_profile_hash
,
(
*
profile
)
->
name
,
megaco_globals
.
peer_profile_rwlock
);
mg_peer_config_cleanup
(
*
profile
);
switch_core_destroy_memory_pool
(
&
(
*
profile
)
->
pool
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Stopped peer profile: %s
\n
"
,
(
*
profile
)
->
name
);
return
SWITCH_STATUS_SUCCESS
;
}
/* For Emacs:
* Local Variables:
* mode:c
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
浏览文件 @
e3eed73e
...
...
@@ -133,6 +133,15 @@ switch_status_t mg_config_cleanup(megaco_profile_t* profile)
return
SWITCH_STATUS_SUCCESS
;
}
/****************************************************************************************************************************/
switch_status_t
mg_peer_config_cleanup
(
mg_peer_profile_t
*
profile
)
{
switch_xml_config_item_t
*
instructions
=
(
profile
?
get_peer_instructions
(
profile
)
:
NULL
);
switch_xml_config_cleanup
(
instructions
);
return
SWITCH_STATUS_SUCCESS
;
}
/****************************************************************************************************************************/
static
switch_xml_config_item_t
*
get_peer_instructions
(
mg_peer_profile_t
*
profile
)
{
switch_xml_config_item_t
*
dup
;
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
浏览文件 @
e3eed73e
...
...
@@ -97,6 +97,32 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_media_gateway_load)
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_media_gateway_shutdown
)
{
void
*
val
=
NULL
;
const
void
*
key
=
NULL
;
switch_ssize_t
keylen
;
switch_hash_index_t
*
hi
=
NULL
;
megaco_profile_t
*
profile
=
NULL
;
mg_peer_profile_t
*
peer_profile
=
NULL
;
/* destroy all the mg profiles */
while
((
hi
=
switch_hash_first
(
NULL
,
megaco_globals
.
profile_hash
)))
{
switch_hash_this
(
hi
,
&
key
,
&
keylen
,
&
val
);
profile
=
(
megaco_profile_t
*
)
val
;
megaco_profile_destroy
(
&
profile
);
profile
=
NULL
;
}
hi
=
NULL
;
key
=
NULL
;
val
=
NULL
;
/* destroy all the mg peer profiles */
while
((
hi
=
switch_hash_first
(
NULL
,
megaco_globals
.
peer_profile_hash
)))
{
switch_hash_this
(
hi
,
&
key
,
&
keylen
,
&
val
);
peer_profile
=
(
mg_peer_profile_t
*
)
val
;
megaco_peer_profile_destroy
(
&
peer_profile
);
peer_profile
=
NULL
;
}
sng_mgco_stack_shutdown
();
return
SWITCH_STATUS_SUCCESS
;
...
...
@@ -156,7 +182,7 @@ static void mgco_print_sdp(CmSdpInfoSet *sdp)
}
if
(
s
->
attrSet
.
numComp
.
pres
)
{
for
(
mediaId
=
0
;
mediaId
<
s
->
attrSet
.
numComp
.
val
;
mediaId
++
)
{
CmSdpAttr
*
a
=
s
->
attrSet
.
attr
[
mediaId
];
/*CmSdpAttr *a = s->attrSet.attr[mediaId];*/
}
...
...
@@ -221,9 +247,10 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg)
/* Loop over command list */
for
(
cmdIter
=
0
;
cmdIter
<
(
actnReq
->
cl
.
num
.
val
);
cmdIter
++
)
{
MgMgcoCommandReq
*
cmdReq
=
actnReq
->
cl
.
cmds
[
cmdIter
];
MgMgcoTermId
*
termId
=
NULLP
;
/*MgMgcoTermId *termId = NULLP;*/
/* The reply we'll send */
MgMgcoCommand
mgCmd
=
{
0
};
MgMgcoCommand
mgCmd
;
memset
(
&
mgCmd
,
0
,
sizeof
(
mgCmd
));
mgCmd
.
peerId
=
msg
->
lcl
.
id
;
mgCmd
.
transId
=
transId
;
mgCmd
.
u
.
mgCmdInd
[
0
]
=
cmdReq
;
...
...
@@ -328,18 +355,18 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg)
}
case
MGT_MODIFY
:
{
MgMgcoAmmReq
*
addReq
=
&
cmdReq
->
cmd
.
u
.
mod
;
/*MgMgcoAmmReq *addReq = &cmdReq->cmd.u.mod;*/
break
;
}
case
MGT_MOVE
:
{
MgMgcoAmmReq
*
addReq
=
&
cmdReq
->
cmd
.
u
.
move
;
/*MgMgcoAmmReq *addReq = &cmdReq->cmd.u.move;*/
break
;
}
case
MGT_SUB
:
{
MgMgcoSubAudReq
*
addReq
=
&
cmdReq
->
cmd
.
u
.
sub
;
/*MgMgcoSubAudReq *addReq = &cmdReq->cmd.u.sub;*/
}
case
MGT_SVCCHG
:
case
MGT_NTFY
:
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
浏览文件 @
e3eed73e
...
...
@@ -84,6 +84,8 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload);
switch_status_t
sng_mgco_start
(
megaco_profile_t
*
profile
);
switch_status_t
sng_mgco_stop
(
megaco_profile_t
*
profile
);
switch_status_t
mg_config_cleanup
(
megaco_profile_t
*
profile
);
switch_status_t
mg_peer_config_cleanup
(
mg_peer_profile_t
*
profile
);
switch_status_t
megaco_peer_profile_destroy
(
mg_peer_profile_t
**
profile
);
switch_status_t
mg_process_cli_cmd
(
const
char
*
cmd
,
switch_stream_handle_t
*
stream
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论