Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
9fc6b208
提交
9fc6b208
authored
9月 23, 2010
作者:
Mathieu Parent
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Skinny: no need for heartbeat event to handle keepalive timeout
上级
4f46bb91
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
11 行增加
和
24 行删除
+11
-24
mod_skinny.c
src/mod/endpoints/mod_skinny/mod_skinny.c
+7
-23
mod_skinny.h
src/mod/endpoints/mod_skinny/mod_skinny.h
+0
-1
skinny_protocol.c
src/mod/endpoints/mod_skinny/skinny_protocol.c
+4
-0
没有找到文件。
src/mod/endpoints/mod_skinny/mod_skinny.c
浏览文件 @
9fc6b208
...
@@ -1343,19 +1343,6 @@ static switch_status_t kill_listener(listener_t *listener, void *pvt)
...
@@ -1343,19 +1343,6 @@ static switch_status_t kill_listener(listener_t *listener, void *pvt)
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
kill_expired_listener
(
listener_t
*
listener
,
void
*
pvt
)
{
switch_event_t
*
event
=
NULL
;
if
(
listener
->
expire_time
<
switch_epoch_time_now
(
NULL
))
{
/* skinny::expire event */
skinny_device_event
(
listener
,
&
event
,
SWITCH_EVENT_CUSTOM
,
SKINNY_EVENT_EXPIRE
);
switch_event_fire
(
&
event
);
return
kill_listener
(
listener
,
pvt
);
}
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
keepalive_listener
(
listener_t
*
listener
,
void
*
pvt
)
switch_status_t
keepalive_listener
(
listener_t
*
listener
,
void
*
pvt
)
{
{
skinny_profile_t
*
profile
;
skinny_profile_t
*
profile
;
...
@@ -1414,6 +1401,13 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
...
@@ -1414,6 +1401,13 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
case
SWITCH_STATUS_TIMEOUT
:
case
SWITCH_STATUS_TIMEOUT
:
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Communication Time Out with %s:%d.
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Communication Time Out with %s:%d.
\n
"
,
listener
->
remote_ip
,
listener
->
remote_port
);
listener
->
remote_ip
,
listener
->
remote_port
);
if
(
listener
->
expire_time
<
switch_epoch_time_now
(
NULL
))
{
switch_event_t
*
event
=
NULL
;
/* skinny::expire event */
skinny_device_event
(
listener
,
&
event
,
SWITCH_EVENT_CUSTOM
,
SKINNY_EVENT_EXPIRE
);
switch_event_fire
(
&
event
);
}
break
;
break
;
default:
default:
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Communication Error with %s:%d.
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Communication Error with %s:%d.
\n
"
,
...
@@ -1917,11 +1911,6 @@ static switch_status_t load_skinny_config(void)
...
@@ -1917,11 +1911,6 @@ static switch_status_t load_skinny_config(void)
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
static
void
skinny_heartbeat_event_handler
(
switch_event_t
*
event
)
{
walk_listeners
(
kill_expired_listener
,
NULL
);
}
static
void
skinny_call_state_event_handler
(
switch_event_t
*
event
)
static
void
skinny_call_state_event_handler
(
switch_event_t
*
event
)
{
{
char
*
subclass
;
char
*
subclass
;
...
@@ -2129,10 +2118,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
...
@@ -2129,10 +2118,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
return
SWITCH_STATUS_TERM
;
return
SWITCH_STATUS_TERM
;
}
}
/* bind to events */
/* bind to events */
if
((
switch_event_bind_removable
(
modname
,
SWITCH_EVENT_HEARTBEAT
,
NULL
,
skinny_heartbeat_event_handler
,
NULL
,
&
globals
.
heartbeat_node
)
!=
SWITCH_STATUS_SUCCESS
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Couldn't bind our heartbeat handler!
\n
"
);
/* Not such severe to prevent loading */
}
if
((
switch_event_bind_removable
(
modname
,
SWITCH_EVENT_CUSTOM
,
SKINNY_EVENT_CALL_STATE
,
skinny_call_state_event_handler
,
NULL
,
&
globals
.
call_state_node
)
!=
SWITCH_STATUS_SUCCESS
))
{
if
((
switch_event_bind_removable
(
modname
,
SWITCH_EVENT_CUSTOM
,
SKINNY_EVENT_CALL_STATE
,
skinny_call_state_event_handler
,
NULL
,
&
globals
.
call_state_node
)
!=
SWITCH_STATUS_SUCCESS
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't bind our call_state handler!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't bind our call_state handler!
\n
"
);
return
SWITCH_STATUS_TERM
;
return
SWITCH_STATUS_TERM
;
...
@@ -2205,7 +2190,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skinny_shutdown)
...
@@ -2205,7 +2190,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skinny_shutdown)
skinny_api_unregister
();
skinny_api_unregister
();
/* release events */
/* release events */
switch_event_unbind
(
&
globals
.
heartbeat_node
);
switch_event_unbind
(
&
globals
.
call_state_node
);
switch_event_unbind
(
&
globals
.
call_state_node
);
switch_event_unbind
(
&
globals
.
message_waiting_node
);
switch_event_unbind
(
&
globals
.
message_waiting_node
);
switch_event_unbind
(
&
globals
.
trap_node
);
switch_event_unbind
(
&
globals
.
trap_node
);
...
...
src/mod/endpoints/mod_skinny/mod_skinny.h
浏览文件 @
9fc6b208
...
@@ -49,7 +49,6 @@ struct skinny_globals {
...
@@ -49,7 +49,6 @@ struct skinny_globals {
switch_memory_pool_t
*
pool
;
switch_memory_pool_t
*
pool
;
switch_mutex_t
*
mutex
;
switch_mutex_t
*
mutex
;
switch_hash_t
*
profile_hash
;
switch_hash_t
*
profile_hash
;
switch_event_node_t
*
heartbeat_node
;
switch_event_node_t
*
call_state_node
;
switch_event_node_t
*
call_state_node
;
switch_event_node_t
*
message_waiting_node
;
switch_event_node_t
*
message_waiting_node
;
switch_event_node_t
*
trap_node
;
switch_event_node_t
*
trap_node
;
...
...
src/mod/endpoints/mod_skinny/skinny_protocol.c
浏览文件 @
9fc6b208
...
@@ -135,6 +135,10 @@ switch_status_t skinny_read_packet(listener_t *listener, skinny_message_t **req)
...
@@ -135,6 +135,10 @@ switch_status_t skinny_read_packet(listener_t *listener, skinny_message_t **req)
status
=
switch_socket_recv
(
listener
->
sock
,
ptr
,
&
mlen
);
status
=
switch_socket_recv
(
listener
->
sock
,
ptr
,
&
mlen
);
if
(
listener
->
expire_time
&&
listener
->
expire_time
<
switch_epoch_time_now
(
NULL
))
{
return
SWITCH_STATUS_TIMEOUT
;
}
if
(
!
listener_is_ready
(
listener
))
{
if
(
!
listener_is_ready
(
listener
))
{
break
;
break
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论