Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
19dad4a5
提交
19dad4a5
authored
12月 08, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3750 --resolve
上级
1868e145
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
1 行删除
+15
-1
mod_event_socket.c
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
+15
-1
没有找到文件。
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
浏览文件 @
19dad4a5
...
...
@@ -94,6 +94,7 @@ struct listener {
char
remote_ip
[
50
];
switch_port_t
remote_port
;
switch_event_t
*
filters
;
time_t
linger_timeout
;
struct
listener
*
next
;
};
...
...
@@ -1343,6 +1344,12 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
}
}
if
(
switch_test_flag
(
listener
,
LFLAG_HANDLE_DISCO
)
&&
switch_epoch_time_now
(
NULL
)
>
listener
->
linger_timeout
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
listener
->
session
),
SWITCH_LOG_DEBUG
,
"linger timeout, closing socket
\n
"
);
status
=
SWITCH_STATUS_FALSE
;
break
;
}
if
(
channel
&&
switch_channel_down
(
channel
)
&&
!
switch_test_flag
(
listener
,
LFLAG_HANDLE_DISCO
))
{
switch_set_flag_locked
(
listener
,
LFLAG_HANDLE_DISCO
);
if
(
switch_test_flag
(
listener
,
LFLAG_LINGER
))
{
...
...
@@ -2260,8 +2267,15 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
}
}
else
if
(
!
strncasecmp
(
cmd
,
"linger"
,
6
))
{
if
(
listener
->
session
)
{
uint32_t
linger_time
=
600
;
/* sounds reasonable? */
if
(
*
(
cmd
+
6
)
==
' '
&&
*
(
cmd
+
7
))
{
/*how long do you want to linger?*/
linger_time
=
(
uint32_t
)
atoi
(
cmd
+
7
);
}
/*do we need a mutex to update linger_timeout ?*/
listener
->
linger_timeout
=
switch_epoch_time_now
(
NULL
)
+
linger_time
;
switch_set_flag_locked
(
listener
,
LFLAG_LINGER
);
switch_snprintf
(
reply
,
reply_len
,
"+OK will linger
"
);
switch_snprintf
(
reply
,
reply_len
,
"+OK will linger
%d seconds"
,
linger_time
);
}
else
{
switch_snprintf
(
reply
,
reply_len
,
"-ERR not controlling a session"
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论