Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
34243806
提交
34243806
authored
8月 27, 2012
作者:
Kapil Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixing minor issues observed during load testing
上级
9c35f46e
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
47 行增加
和
14 行删除
+47
-14
media_gateway_cli.c
src/mod/endpoints/mod_media_gateway/media_gateway_cli.c
+18
-1
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+19
-9
media_gateway_utils.c
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
+9
-3
mod_media_gateway.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
+1
-1
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway_cli.c
浏览文件 @
34243806
...
...
@@ -21,6 +21,7 @@ void get_peer_xml_buffer(char* prntBuf, MgPeerSta* cfm);
void
megaco_cli_print_usage
(
switch_stream_handle_t
*
stream
);
switch_status_t
handle_show_activecalls_cli_cmd
(
switch_stream_handle_t
*
stream
,
megaco_profile_t
*
mg_profile
);
switch_status_t
handle_show_stats
(
switch_stream_handle_t
*
stream
,
megaco_profile_t
*
mg_profile
);
switch_status_t
handle_show_stack_mem
(
switch_stream_handle_t
*
stream
);
/******************************************************************************/
...
...
@@ -194,6 +195,7 @@ switch_status_t mg_process_cli_cmd(const char *cmd, switch_stream_handle_t *stre
}
else
if
(
!
strcmp
(
argv
[
2
],
"show"
))
{
/**********************************************************************************/
/* mg <mg-profile> show activecalls*/
if
(
zstr
(
argv
[
3
]))
{
goto
usage
;
}
...
...
@@ -228,7 +230,7 @@ switch_status_t mg_process_cli_cmd(const char *cmd, switch_stream_handle_t *stre
}
else
if
(
!
strcasecmp
(
argv
[
3
],
"stackmem"
)){
/*******************************************************************/
megaco_profile_release
(
profile
);
sng_mg_reg_info_show
(
);
handle_show_stack_mem
(
stream
);
/*******************************************************************/
#ifdef LEAK_TEST
}
else
if
(
!
strcasecmp
(
argv
[
3
],
"leak-report"
)){
...
...
@@ -305,6 +307,7 @@ void megaco_cli_print_usage(switch_stream_handle_t *stream)
stream
->
write_function
(
stream
,
"mg profile <profile-name> show termstatus <term-id>
\n
"
);
stream
->
write_function
(
stream
,
"mg profile <profile-name> show alltermstatus
\n
"
);
stream
->
write_function
(
stream
,
"mg profile <profile-name> show stackmem
\n
"
);
stream
->
write_function
(
stream
,
"mg profile <profile-name> show stats
\n
"
);
stream
->
write_function
(
stream
,
"Usage: Logging
\n
"
);
stream
->
write_function
(
stream
,
"mg logging enable
\n
"
);
...
...
@@ -913,6 +916,20 @@ switch_status_t handle_show_stats(switch_stream_handle_t *stream, megaco_profile
return
SWITCH_STATUS_SUCCESS
;
}
/******************************************************************************/
switch_status_t
handle_show_stack_mem
(
switch_stream_handle_t
*
stream
)
{
U32
availMem
=
0
;
char
buffer
[
4098
];
memset
(
buffer
,
0
,
sizeof
(
buffer
));
SGetMemInfoBuffer
(
S_REG
,
&
availMem
,
buffer
);
stream
->
write_function
(
stream
,
"%s"
,
buffer
);
return
SWITCH_STATUS_SUCCESS
;
}
/******************************************************************************/
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
34243806
...
...
@@ -595,16 +595,19 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
mg_context_t
*
mg_ctxt
;
int
mediaId
;
MgMgcoLocalDesc
*
local
=
NULL
;
char
term_name
[
128
];
/*CmSdpInfoSet *psdp = NULL;*/
/* TODO - Kapil dummy line , will need to add with proper code */
memset
(
&
term_name
,
0
,
sizeof
(
term_name
));
inc_med_desc
=
&
cmd
->
dl
.
descs
[
0
]
->
u
.
media
;
/********************************************************************/
ctxtId
=
&
inc_cmd
->
contextId
;
termLst
=
mg_get_term_id_list
(
inc_cmd
);
termId
=
termLst
->
terms
[
0
];
/* For Matt - termId->name.lcl.val - to get the termination id name */
MG_MEM_COPY
(
&
term_name
,
termId
->
name
.
lcl
.
val
,
sizeof
(
U8
)
*
termId
->
name
.
lcl
.
len
);
/********************************************************************/
/* Validating ADD request *******************************************/
...
...
@@ -683,13 +686,13 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
/********************************************************************/
}
else
{
/* Physical termination */
term
=
megaco_find_termination
(
mg_profile
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
term
=
megaco_find_termination
(
mg_profile
,
term_name
);
mg_profile
->
mg_stats
->
total_num_of_phy_add_recvd
++
;
if
(
NULL
==
term
){
mg_profile
->
mg_stats
->
total_num_of_find_term_failed_error
++
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
" megaco_find_termination failed for term-id[%s]
\n
"
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
" megaco_find_termination failed for term-id[%s]
\n
"
,
term_name
);
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
...
...
@@ -904,12 +907,16 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
int
mediaId
;
/*MgMgcoAmmReq *cmd = &inc_cmd->u.mgCmdInd[0]->cmd.u.mod;*/
U32
txn_id
=
inc_cmd
->
transId
.
val
;
char
term_name
[
128
];
memset
(
&
term_name
,
0
,
sizeof
(
term_name
));
/********************************************************************/
ctxtId
=
&
inc_cmd
->
contextId
;
termLst
=
mg_get_term_id_list
(
inc_cmd
);
termId
=
termLst
->
terms
[
0
];
/* For Matt - termId->name.lcl.val - to get the termination id name */
MG_MEM_COPY
(
&
term_name
,
termId
->
name
.
lcl
.
val
,
sizeof
(
U8
)
*
termId
->
name
.
lcl
.
len
);
/********************************************************************/
/* Validation *******************************************/
...
...
@@ -964,7 +971,7 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
termId
->
name
.
lcl
.
val
,
ctxtId
->
type
.
val
,
ctxtId
->
val
.
val
);
#endif
term
=
megaco_find_termination
(
mg_profile
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
term
=
megaco_find_termination
(
mg_profile
,
term_name
);
if
(
NULL
==
term
){
mg_profile
->
mg_stats
->
total_num_of_find_term_failed_error
++
;
...
...
@@ -1200,7 +1207,9 @@ switch_status_t handle_mg_subtract_cmd(megaco_profile_t* mg_profile, MgMgcoComma
mg_context_t
*
mg_ctxt
=
NULL
;
mg_termination_t
*
term
=
NULL
;
uint8_t
wild
=
0x00
;
char
term_name
[
128
];
memset
(
&
term_name
,
0
,
sizeof
(
term_name
));
wild
=
inc_cmd
->
u
.
mgCmdReq
[
0
]
->
wild
.
pres
;
...
...
@@ -1208,6 +1217,7 @@ switch_status_t handle_mg_subtract_cmd(megaco_profile_t* mg_profile, MgMgcoComma
ctxtId
=
&
inc_cmd
->
contextId
;
termLst
=
mg_get_term_id_list
(
inc_cmd
);
termId
=
termLst
->
terms
[
0
];
MG_MEM_COPY
(
&
term_name
,
termId
->
name
.
lcl
.
val
,
sizeof
(
U8
)
*
termId
->
name
.
lcl
.
len
);
mg_profile
->
mg_stats
->
total_num_of_sub_recvd
++
;
...
...
@@ -1277,14 +1287,14 @@ switch_status_t handle_mg_subtract_cmd(megaco_profile_t* mg_profile, MgMgcoComma
}
else
if
(
MGT_TERMID_OTHER
==
termId
->
type
.
val
){
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" SUB Request for termination[%s]
\n
"
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" SUB Request for termination[%s]
\n
"
,
term_name
);
term
=
megaco_find_termination
(
mg_profile
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
term
=
megaco_find_termination
(
mg_profile
,
term_name
);
if
(
NULL
==
term
){
mg_profile
->
mg_stats
->
total_num_of_find_term_failed_error
++
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Subtract request Failed, no termination found for input term string[%s]
\n
"
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
"Subtract request Failed, no termination found for input term string[%s]
\n
"
,
term_name
);
mg_util_set_term_string
(
&
errTxt
,
termId
);
err_code
=
MGT_MGCO_RSP_CODE_UNKNOWN_TERM_ID
;
goto
error
;
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
浏览文件 @
34243806
...
...
@@ -86,12 +86,18 @@ switch_status_t mg_stack_termination_is_in_service(megaco_profile_t* mg_profile,
mg_termination_t
*
term
=
NULL
;
term
=
megaco_find_termination
(
mg_profile
,
term_str
);
if
(
term
&&
MG_TERM_RTP
==
term
->
type
)
{
return
SWITCH_STATUS_SUCCESS
;
}
else
if
(
term
&&
(
MG_TERM_TDM
==
term
->
type
)
&&
switch_test_flag
(
term
,
MG_IN_SERVICE
)){
return
SWITCH_STATUS_SUCCESS
;
}
else
if
(
term
&&
(
MG_TERM_TDM
==
term
->
type
)){
if
(
switch_test_flag
(
term
,
MG_IN_SERVICE
)){
return
SWITCH_STATUS_SUCCESS
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
" Term[%s] not in service
\n
"
,
term_str
);
return
SWITCH_STATUS_FALSE
;
}
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
" Failed to find term for term string[%s]
\n
"
,
term_str
);
return
SWITCH_STATUS_FALSE
;
}
}
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
浏览文件 @
34243806
...
...
@@ -556,8 +556,8 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
if
((
CH_CMD_TYPE_IND
==
cmd
->
cmdType
.
val
)
&&
(
MGT_TERMID_OTHER
==
termId
->
type
.
val
)
&&
(
MGT_AUDITVAL
!=
cmd
->
u
.
mgCmdInd
[
0
]
->
cmd
.
type
.
val
)){
if
(
SWITCH_STATUS_FALSE
==
mg_stack_termination_is_in_service
(
mg_profile
,
(
char
*
)
termId
->
name
.
lcl
.
val
,
termId
->
name
.
lcl
.
len
)){
MG_MEM_COPY
(
&
prnt_buf
,
termId
->
name
.
lcl
.
val
,
sizeof
(
U8
)
*
termId
->
name
.
lcl
.
len
);
if
(
SWITCH_STATUS_FALSE
==
mg_stack_termination_is_in_service
(
mg_profile
,
prnt_buf
,
strlen
(
prnt_buf
))){
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Termination[%s] not in service
\n
"
,(
strlen
(
prnt_buf
))
?
prnt_buf
:
"NULL"
);
mg_profile
->
mg_stats
->
total_num_of_term_not_in_service_error
++
;
mg_util_set_term_string
(
&
errTxt
,
termId
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论