Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch-contrib
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch-contrib
Commits
4c8cc972
提交
4c8cc972
authored
6月 16, 2012
作者:
Mitch Capper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change default lifetime for pastebin posts to forever, add ability to specify different duration
上级
f09debc3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
3 行删除
+6
-3
fs_logger.pl
mitchcapper/fs_logger.pl
+6
-3
没有找到文件。
mitchcapper/fs_logger.pl
浏览文件 @
4c8cc972
#!/usr/bin/perl
#!/usr/bin/perl
##### NOTE: You need an fs_cli patched with: http://jira.freeswitch.org/browse/FS-3188 or FSClient for windows comes bundled with the patched fs_cli
use
strict
;
use
strict
;
$|
=
1
;
$|
=
1
;
my
$THREADS_SUPPORTED
;
#required for polling support on STDIN in windows...
my
$THREADS_SUPPORTED
;
#required for polling support on STDIN in windows...
...
@@ -22,7 +21,7 @@ my ($pid,$output_buffer,$in_cleanup,$proc_stdin);
...
@@ -22,7 +21,7 @@ my ($pid,$output_buffer,$in_cleanup,$proc_stdin);
my
@AUTOS
=
qw/-pb -do -st internal -l 7/
;
my
@AUTOS
=
qw/-pb -do -st internal -l 7/
;
push
@AUTOS
,
"-ia"
if
(
!
$IS_WINDOWS
||
$THREADS_SUPPORTED
);
push
@AUTOS
,
"-ia"
if
(
!
$IS_WINDOWS
||
$THREADS_SUPPORTED
);
my
(
$DISPLAY_OUTPUT
,
$ACCEPT_INPUT
,
$PASTEBIN_USER
,
$FILE
,
$OB_AUTO
,
$OB_FILE
,
@SIP_TRACE_ON
,
$SOFIA_LOG_LEVEL
,
$CLEANUP_COMMANDS
,
$DEBUG_MODE
,
$JUST_READ_FILE
);
my
(
$DISPLAY_OUTPUT
,
$ACCEPT_INPUT
,
$PASTEBIN_USER
,
$FILE
,
$OB_AUTO
,
$OB_FILE
,
@SIP_TRACE_ON
,
$SOFIA_LOG_LEVEL
,
$CLEANUP_COMMANDS
,
$DEBUG_MODE
,
$JUST_READ_FILE
,
$PASTEBIN_TIME
);
$SIG
{
INT
}
=
\&
cleanup
;
$SIG
{
INT
}
=
\&
cleanup
;
$0
=~
/^(.+[\\\/])[^\\\/]+[\\\/]*$/
;
$0
=~
/^(.+[\\\/])[^\\\/]+[\\\/]*$/
;
...
@@ -65,6 +64,7 @@ sub usage(){
...
@@ -65,6 +64,7 @@ sub usage(){
-ia --input-accept Pass input to the freeswitch console
-ia --input-accept Pass input to the freeswitch console
-D, --fslogger-debug FSLogger debug mode
-D, --fslogger-debug FSLogger debug mode
-jrf --just-read-file=<file> Read file instead of collecting log from fs_cli
-jrf --just-read-file=<file> Read file instead of collecting log from fs_cli
-pbt --pastebin-time=<time> Pastebin for day(d) month(m) forever(default)
The -st, -X, -x options can be used multiple times
The -st, -X, -x options can be used multiple times
fs_logger.pl will run until fs_cli ends or control+c
fs_logger.pl will run until fs_cli ends or control+c
...
@@ -258,7 +258,8 @@ sub pastebin_post($$){
...
@@ -258,7 +258,8 @@ sub pastebin_post($$){
~
;
~
;
$pb_post
=~
s/^\t//mg
;
$pb_post
=~
s/^\t//mg
;
my
$post_body
=
"parent_pid=&format=$type&poster="
.
$post_as
.
"&paste=Send&expiry=m&code2="
;
$PASTEBIN_TIME
=
"f"
if
(
$PASTEBIN_TIME
ne
"m"
&&
$PASTEBIN_TIME
ne
"d"
);
my
$post_body
=
"parent_pid=&format=$type&poster="
.
$post_as
.
"&paste=Send&expiry="
.
$PASTEBIN_TIME
.
"&code2="
;
$post_body
.=
$to_post
;
$post_body
.=
$to_post
;
my
$post_len
=
length
(
$post_body
);
my
$post_len
=
length
(
$post_body
);
$pb_post
=~
s/CONT_LEN/$post_len/
;
$pb_post
=~
s/CONT_LEN/$post_len/
;
...
@@ -450,6 +451,8 @@ sub puke($$){
...
@@ -450,6 +451,8 @@ sub puke($$){
(
$matches
,
$value
)
=
arg_test
(
"-jrf"
,
"--just-read-file"
,
1
,
1
);
(
$matches
,
$value
)
=
arg_test
(
"-jrf"
,
"--just-read-file"
,
1
,
1
);
die
"File to just read not found: $value"
if
(
$matches
&&
!
-
e
$value
);
die
"File to just read not found: $value"
if
(
$matches
&&
!
-
e
$value
);
$JUST_READ_FILE
=
$value
and
next
if
(
$matches
);
$JUST_READ_FILE
=
$value
and
next
if
(
$matches
);
(
$matches
,
$value
)
=
arg_test
(
"-pbt"
,
"--pastebin-time"
,
1
,
1
);
$PASTEBIN_TIME
=
$value
and
next
if
(
$matches
);
(
$matches
,
$value
)
=
arg_test
(
"-do"
,
"--display-output"
,
0
,
0
);
(
$matches
,
$value
)
=
arg_test
(
"-do"
,
"--display-output"
,
0
,
0
);
$DISPLAY_OUTPUT
=
1
and
next
if
(
$matches
);
$DISPLAY_OUTPUT
=
1
and
next
if
(
$matches
);
(
$matches
,
$value
)
=
arg_test
(
"-ia"
,
"--input-accept"
,
0
,
0
);
(
$matches
,
$value
)
=
arg_test
(
"-ia"
,
"--input-accept"
,
0
,
0
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论