Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d7e4b509
提交
d7e4b509
authored
7月 23, 2012
作者:
Kapil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
integrating term/context alloc/delete api to megaco command handler code
上级
63c53a85
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
365 行增加
和
183 行删除
+365
-183
media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway.c
+39
-2
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+313
-180
media_gateway_stack.h
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
+1
-0
media_gateway_utils.c
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
+7
-0
mod_media_gateway.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
+1
-1
mod_media_gateway.h
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
+4
-0
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway.c
浏览文件 @
d7e4b509
...
@@ -167,6 +167,7 @@ mg_termination_t *megaco_choose_termination(megaco_profile_t *profile, const cha
...
@@ -167,6 +167,7 @@ mg_termination_t *megaco_choose_termination(megaco_profile_t *profile, const cha
term
->
pool
=
pool
;
term
->
pool
=
pool
;
term
->
type
=
termtype
;
term
->
type
=
termtype
;
term
->
active_events
=
NULL
;
term
->
active_events
=
NULL
;
term
->
profile
=
profile
;
if
(
termtype
==
MG_TERM_RTP
)
{
if
(
termtype
==
MG_TERM_RTP
)
{
/* Fill in local address and reserve an rtp port */
/* Fill in local address and reserve an rtp port */
...
@@ -212,6 +213,23 @@ void megaco_termination_destroy(mg_termination_t *term)
...
@@ -212,6 +213,23 @@ void megaco_termination_destroy(mg_termination_t *term)
switch_core_destroy_memory_pool
(
&
term
->
pool
);
switch_core_destroy_memory_pool
(
&
term
->
pool
);
}
}
switch_status_t
megaco_context_is_term_present
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
)
{
switch_assert
(
ctx
!=
NULL
);
switch_assert
(
term
!=
NULL
);
if
(
ctx
->
terminations
[
0
]
&&
(
term
==
ctx
->
terminations
[
0
]))
{
return
SWITCH_STATUS_SUCCESS
;
}
if
(
ctx
->
terminations
[
1
]
&&
(
term
==
ctx
->
terminations
[
1
]))
{
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_FALSE
;
}
switch_status_t
megaco_context_add_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
)
switch_status_t
megaco_context_add_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
)
{
{
...
@@ -247,6 +265,21 @@ switch_status_t megaco_context_add_termination(mg_context_t *ctx, mg_termination
...
@@ -247,6 +265,21 @@ switch_status_t megaco_context_add_termination(mg_context_t *ctx, mg_termination
}
}
switch_status_t
megaco_context_sub_all_termination
(
mg_context_t
*
ctx
)
{
switch_assert
(
ctx
!=
NULL
);
/* Channels will automatically go to park once the bridge ends */
if
(
ctx
->
terminations
[
0
])
{
megaco_termination_destroy
(
ctx
->
terminations
[
0
]);
ctx
->
terminations
[
0
]
=
NULL
;
}
else
if
(
ctx
->
terminations
[
1
])
{
megaco_termination_destroy
(
ctx
->
terminations
[
1
]);
}
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
megaco_context_sub_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
)
switch_status_t
megaco_context_sub_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
)
{
{
switch_assert
(
ctx
!=
NULL
);
switch_assert
(
ctx
!=
NULL
);
...
@@ -315,7 +348,8 @@ mg_context_t *megaco_get_context(megaco_profile_t *profile, uint32_t context_id)
...
@@ -315,7 +348,8 @@ mg_context_t *megaco_get_context(megaco_profile_t *profile, uint32_t context_id)
mg_context_t
*
megaco_choose_context
(
megaco_profile_t
*
profile
)
mg_context_t
*
megaco_choose_context
(
megaco_profile_t
*
profile
)
{
{
mg_context_t
*
ctx
;
mg_context_t
*
ctx
;
int
i
=
0x0
;;
int
i
=
0x0
;
int
j
=
0x0
;
switch_thread_rwlock_wrlock
(
profile
->
contexts_rwlock
);
switch_thread_rwlock_wrlock
(
profile
->
contexts_rwlock
);
/* Try the next one */
/* Try the next one */
...
@@ -332,7 +366,10 @@ mg_context_t *megaco_choose_context(megaco_profile_t *profile)
...
@@ -332,7 +366,10 @@ mg_context_t *megaco_choose_context(megaco_profile_t *profile)
ctx
=
malloc
(
sizeof
*
ctx
);
ctx
=
malloc
(
sizeof
*
ctx
);
ctx
->
context_id
=
profile
->
next_context_id
;
ctx
->
context_id
=
profile
->
next_context_id
;
ctx
->
profile
=
profile
;
ctx
->
profile
=
profile
;
for
(
j
=
0
;
j
<
MG_CONTEXT_MAX_TERMS
;
j
++
){
ctx
->
terminations
[
j
]
=
NULL
;
}
if
(
!
profile
->
contexts
[
i
])
{
if
(
!
profile
->
contexts
[
i
])
{
profile
->
contexts
[
i
]
=
ctx
;
profile
->
contexts
[
i
]
=
ctx
;
}
else
{
}
else
{
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
d7e4b509
差异被折叠。
点击展开。
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
浏览文件 @
d7e4b509
...
@@ -132,6 +132,7 @@ void handle_mg_alarm(Pst *pst, MgMngmt *sta);
...
@@ -132,6 +132,7 @@ void handle_mg_alarm(Pst *pst, MgMngmt *sta);
void
handle_tucl_alarm
(
Pst
*
pst
,
HiMngmt
*
sta
);
void
handle_tucl_alarm
(
Pst
*
pst
,
HiMngmt
*
sta
);
int
mg_enable_logging
(
void
);
int
mg_enable_logging
(
void
);
int
mg_disable_logging
(
void
);
int
mg_disable_logging
(
void
);
void
mg_util_set_err_string
(
MgStr
*
errTxt
,
char
*
str
);
switch_status_t
sng_mgco_cfg
(
megaco_profile_t
*
profile
);
switch_status_t
sng_mgco_cfg
(
megaco_profile_t
*
profile
);
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
浏览文件 @
d7e4b509
...
@@ -318,6 +318,13 @@ void mg_util_set_txn_string(MgStr *errTxt, U32 *txnId)
...
@@ -318,6 +318,13 @@ void mg_util_set_txn_string(MgStr *errTxt, U32 *txnId)
}
}
/*****************************************************************************************************************************/
void
mg_util_set_err_string
(
MgStr
*
errTxt
,
char
*
str
)
{
MG_ZERO
((
errTxt
->
val
),
sizeof
(
errTxt
->
val
));
errTxt
->
len
=
strlen
(
str
);
strcpy
((
char
*
)
&
errTxt
->
val
,
str
);
}
/*****************************************************************************************************************************/
/*****************************************************************************************************************************/
void
mg_util_set_ctxt_string
(
MgStr
*
errTxt
,
MgMgcoContextId
*
ctxtId
)
void
mg_util_set_ctxt_string
(
MgStr
*
errTxt
,
MgMgcoContextId
*
ctxtId
)
{
{
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
浏览文件 @
d7e4b509
...
@@ -500,7 +500,7 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
...
@@ -500,7 +500,7 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
/*If term type is other then check if that term is configured with us..for term type CHOOSE/ALL , no need to check */
/*If term type is other then check if that term is configured with us..for term type CHOOSE/ALL , no need to check */
if
(
MGT_TERMID_OTHER
==
termId
->
type
.
val
){
if
(
MGT_TERMID_OTHER
==
termId
->
type
.
val
){
if
(
SWITCH_STATUS_FALSE
!
=
mg_stack_termination_is_in_service
((
char
*
)
termId
->
name
.
lcl
.
val
,
termId
->
name
.
lcl
.
len
)){
if
(
SWITCH_STATUS_FALSE
=
=
mg_stack_termination_is_in_service
((
char
*
)
termId
->
name
.
lcl
.
val
,
termId
->
name
.
lcl
.
len
)){
mg_util_set_term_string
(
&
errTxt
,
termId
);
mg_util_set_term_string
(
&
errTxt
,
termId
);
err_code
=
MGT_MGCO_RSP_CODE_UNKNOWN_TERM_ID
;
err_code
=
MGT_MGCO_RSP_CODE_UNKNOWN_TERM_ID
;
goto
error
;
goto
error
;
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
浏览文件 @
d7e4b509
...
@@ -210,6 +210,8 @@ void mg_rtp_release_id(megaco_profile_t *profile, uint32_t id);
...
@@ -210,6 +210,8 @@ void mg_rtp_release_id(megaco_profile_t *profile, uint32_t id);
mg_context_t
*
megaco_get_context
(
megaco_profile_t
*
profile
,
uint32_t
context_id
);
mg_context_t
*
megaco_get_context
(
megaco_profile_t
*
profile
,
uint32_t
context_id
);
mg_context_t
*
megaco_choose_context
(
megaco_profile_t
*
profile
);
mg_context_t
*
megaco_choose_context
(
megaco_profile_t
*
profile
);
void
megaco_release_context
(
mg_context_t
*
ctx
);
void
megaco_release_context
(
mg_context_t
*
ctx
);
switch_status_t
megaco_context_sub_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
);
switch_status_t
megaco_context_sub_all_termination
(
mg_context_t
*
ctx
);
mg_termination_t
*
megaco_choose_termination
(
megaco_profile_t
*
profile
,
const
char
*
prefix
);
mg_termination_t
*
megaco_choose_termination
(
megaco_profile_t
*
profile
,
const
char
*
prefix
);
mg_termination_t
*
megaco_find_termination
(
megaco_profile_t
*
profile
,
const
char
*
name
);
mg_termination_t
*
megaco_find_termination
(
megaco_profile_t
*
profile
,
const
char
*
name
);
...
@@ -225,6 +227,8 @@ switch_status_t mg_config_cleanup(megaco_profile_t* profile);
...
@@ -225,6 +227,8 @@ 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
mg_peer_config_cleanup
(
mg_peer_profile_t
*
profile
);
switch_status_t
megaco_peer_profile_destroy
(
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
);
switch_status_t
mg_process_cli_cmd
(
const
char
*
cmd
,
switch_stream_handle_t
*
stream
);
switch_status_t
megaco_context_add_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
);
switch_status_t
megaco_context_is_term_present
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
);
#endif
/* MOD_MEGACO_H */
#endif
/* MOD_MEGACO_H */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论