Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
94297df2
提交
94297df2
authored
8月 27, 2012
作者:
Kapil Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adding "spantermstatus <span_name>" cli command to show terms status based on span name
上级
c6704894
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
86 行增加
和
0 行删除
+86
-0
media_gateway_cli.c
src/mod/endpoints/mod_media_gateway/media_gateway_cli.c
+86
-0
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway_cli.c
浏览文件 @
94297df2
...
...
@@ -22,6 +22,7 @@ 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
);
switch_status_t
handle_span_term_status_cli_cmd
(
switch_stream_handle_t
*
stream
,
megaco_profile_t
*
mg_profile
,
char
*
span_name
);
/******************************************************************************/
...
...
@@ -226,6 +227,16 @@ switch_status_t mg_process_cli_cmd(const char *cmd, switch_stream_handle_t *stre
}
megaco_profile_release
(
profile
);
handle_term_status_cli_cmd
(
stream
,
profile
,
argv
[
4
]);
/*******************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
3
],
"spantermstatus"
)){
/*******************************************************************/
/* mg <mg-profile> show spantermstatus <span-name> */
if
(
zstr
(
argv
[
4
]))
{
goto
usage
;
}
megaco_profile_release
(
profile
);
handle_span_term_status_cli_cmd
(
stream
,
profile
,
argv
[
4
]);
/*******************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
3
],
"stackmem"
)){
/*******************************************************************/
...
...
@@ -304,6 +315,7 @@ void megaco_cli_print_usage(switch_stream_handle_t *stream)
//stream->write_function(stream, "mg profile <profile-name> send ito notify \n");
//stream->write_function(stream, "mg profile <profile-name> send cng <term-id> \n");
stream
->
write_function
(
stream
,
"mg profile <profile-name> show activecalls
\n
"
);
stream
->
write_function
(
stream
,
"mg profile <profile-name> show spantermstatus <span_name>
\n
"
);
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
"
);
...
...
@@ -781,6 +793,80 @@ switch_status_t handle_all_term_status_cli_cmd(switch_stream_handle_t *stream, m
return
SWITCH_STATUS_SUCCESS
;
}
/******************************************************************************/
switch_status_t
handle_span_term_status_cli_cmd
(
switch_stream_handle_t
*
stream
,
megaco_profile_t
*
mg_profile
,
char
*
span_name
)
{
void
*
val
=
NULL
;
switch_hash_index_t
*
hi
=
NULL
;
mg_termination_t
*
term
=
NULL
;
const
void
*
var
;
int
found
=
0x00
;
int
first
=
0x01
;
if
(
!
mg_profile
||
!
span_name
){
stream
->
write_function
(
stream
,
"-ERR NULL profile or NULL span_name
\n
"
);
return
SWITCH_STATUS_FALSE
;
}
switch_thread_rwlock_rdlock
(
mg_profile
->
terminations_rwlock
);
for
(
hi
=
switch_hash_first
(
NULL
,
mg_profile
->
terminations
);
hi
;
hi
=
switch_hash_next
(
hi
))
{
switch_hash_this
(
hi
,
&
var
,
NULL
,
&
val
);
term
=
(
mg_termination_t
*
)
val
;
if
(
!
term
)
continue
;
if
(
MG_TERM_RTP
==
term
->
type
)
continue
;
if
(
!
term
->
u
.
tdm
.
span_name
)
continue
;
if
(
strcasecmp
(
span_name
,
term
->
u
.
tdm
.
span_name
))
continue
;
found
=
0x01
;
if
(
first
){
stream
->
write_function
(
stream
,
" Termination Name"
);
stream
->
write_function
(
stream
,
"
\t
Termination State"
);
stream
->
write_function
(
stream
,
"
\t
Call State"
);
stream
->
write_function
(
stream
,
"
\t
Termination Type"
);
stream
->
write_function
(
stream
,
"
\t
Span-Id "
);
stream
->
write_function
(
stream
,
"
\t
Channel-Id "
);
first
=
0x00
;
}
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
" %s"
,(
NULL
!=
term
->
name
)
?
term
->
name
:
"NULL"
);
if
(
MG_TERM_RTP
==
term
->
type
){
stream
->
write_function
(
stream
,
"
\t\t\t
IN-SERVICE"
);
}
else
{
stream
->
write_function
(
stream
,
"
\t\t\t
%s"
,
(
switch_test_flag
(
term
,
MG_IN_SERVICE
))
?
"IN-SERVICE"
:
"OUT-OF-SERVICE"
);
}
stream
->
write_function
(
stream
,
"
\t\t
%s"
,(
NULL
!=
term
->
uuid
)
?
"IN-CALL "
:
"IDLE "
);
stream
->
write_function
(
stream
,
"
\t\t
%s"
,(
MG_TERM_RTP
==
term
->
type
)
?
"MG_TERM_RTP"
:
"MG_TERM_TDM"
);
if
(
MG_TERM_TDM
==
term
->
type
){
stream
->
write_function
(
stream
,
"
\t\t
%s"
,
(
NULL
!=
term
->
u
.
tdm
.
span_name
)
?
term
->
u
.
tdm
.
span_name
:
"NULL"
);
stream
->
write_function
(
stream
,
"
\t\t
%d"
,
term
->
u
.
tdm
.
channel
);
}
else
{
stream
->
write_function
(
stream
,
"
\t\t
-"
);
stream
->
write_function
(
stream
,
"
\t\t
-"
);
}
stream
->
write_function
(
stream
,
"
\n
"
);
}
if
(
!
found
){
stream
->
write_function
(
stream
,
"No span[%s] configured
\n
"
,
span_name
);
}
switch_thread_rwlock_unlock
(
mg_profile
->
terminations_rwlock
);
return
SWITCH_STATUS_SUCCESS
;
}
/******************************************************************************/
switch_status_t
handle_term_status_cli_cmd
(
switch_stream_handle_t
*
stream
,
megaco_profile_t
*
mg_profile
,
char
*
term_id
)
{
mg_termination_t
*
term
=
NULL
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论