Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
dc85ef18
提交
dc85ef18
authored
8月 12, 2015
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7951 #resolve #comment completely clean up mod_rayo if it fails to load
上级
367848e0
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
112 行增加
和
67 行删除
+112
-67
mod_rayo.c
src/mod/event_handlers/mod_rayo/mod_rayo.c
+98
-61
rayo_cpa_component.c
src/mod/event_handlers/mod_rayo/rayo_cpa_component.c
+3
-1
rayo_cpa_detector.c
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c
+4
-2
rayo_input_component.c
src/mod/event_handlers/mod_rayo/rayo_input_component.c
+3
-1
rayo_output_component.c
src/mod/event_handlers/mod_rayo/rayo_output_component.c
+4
-2
没有找到文件。
src/mod/event_handlers/mod_rayo/mod_rayo.c
浏览文件 @
dc85ef18
...
...
@@ -885,9 +885,15 @@ static void start_deliver_message_thread(switch_memory_pool_t *pool)
static
void
stop_all_threads
(
void
)
{
globals
.
shutdown
=
1
;
switch_queue_interrupt_all
(
globals
.
msg_queue
);
switch_queue_interrupt_all
(
globals
.
offer_queue
);
switch_thread_rwlock_wrlock
(
globals
.
shutdown_rwlock
);
if
(
globals
.
msg_queue
)
{
switch_queue_interrupt_all
(
globals
.
msg_queue
);
}
if
(
globals
.
offer_queue
)
{
switch_queue_interrupt_all
(
globals
.
offer_queue
);
}
if
(
globals
.
shutdown_rwlock
)
{
switch_thread_rwlock_wrlock
(
globals
.
shutdown_rwlock
);
}
}
/**
...
...
@@ -5054,6 +5060,79 @@ static switch_status_t list_input(const char *line, const char *cursor, switch_c
return
list_actors
(
line
,
cursor
,
matches
,
is_input_actor
);
}
/**
* Shutdown module on load failure or shutdown from FreeSWITCH core
*/
static
switch_status_t
do_shutdown
(
void
)
{
switch_console_del_complete_func
(
"::rayo::list_all"
);
switch_console_del_complete_func
(
"::rayo::list_internal"
);
switch_console_del_complete_func
(
"::rayo::list_external"
);
switch_console_del_complete_func
(
"::rayo::list_server"
);
switch_console_del_complete_func
(
"::rayo::list_call"
);
switch_console_del_complete_func
(
"::rayo::list_component"
);
switch_console_del_complete_func
(
"::rayo::list_record"
);
switch_console_del_complete_func
(
"::rayo::list_output"
);
switch_console_del_complete_func
(
"::rayo::list_input"
);
switch_console_set_complete
(
"del rayo"
);
/* stop XMPP streams */
if
(
globals
.
xmpp_context
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Waiting for XMPP threads to stop
\n
"
);
xmpp_stream_context_destroy
(
globals
.
xmpp_context
);
}
/* stop threads */
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Waiting for message and offer timeout threads to stop
\n
"
);
stop_all_threads
();
if
(
globals
.
console
)
{
RAYO_RELEASE
(
globals
.
console
);
RAYO_DESTROY
(
globals
.
console
);
globals
.
console
=
NULL
;
}
if
(
globals
.
server
)
{
RAYO_RELEASE
(
globals
.
server
);
RAYO_DESTROY
(
globals
.
server
);
globals
.
server
=
NULL
;
}
rayo_components_shutdown
();
switch_event_unbind_callback
(
route_call_event
);
switch_event_unbind_callback
(
on_call_end_event
);
switch_event_unbind_callback
(
route_mixer_event
);
if
(
globals
.
command_handlers
)
{
switch_core_hash_destroy
(
&
globals
.
command_handlers
);
}
if
(
globals
.
event_handlers
)
{
switch_core_hash_destroy
(
&
globals
.
event_handlers
);
}
if
(
globals
.
clients_roster
)
{
switch_core_hash_destroy
(
&
globals
.
clients_roster
);
}
if
(
globals
.
actors
)
{
switch_core_hash_destroy
(
&
globals
.
actors
);
}
if
(
globals
.
destroy_actors
)
{
switch_core_hash_destroy
(
&
globals
.
destroy_actors
);
}
if
(
globals
.
actors_by_id
)
{
switch_core_hash_destroy
(
&
globals
.
actors_by_id
);
}
if
(
globals
.
dial_gateways
)
{
switch_core_hash_destroy
(
&
globals
.
dial_gateways
);
}
if
(
globals
.
cmd_aliases
)
{
switch_core_hash_destroy
(
&
globals
.
cmd_aliases
);
}
return
SWITCH_STATUS_SUCCESS
;
}
/**
* Load module
*/
...
...
@@ -5116,12 +5195,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load)
/* set up rayo components */
if
(
rayo_components_load
(
module_interface
,
pool
,
RAYO_CONFIG_FILE
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_TERM
;
goto
error
;
}
/* configure / open sockets */
if
(
do_config
(
globals
.
pool
,
RAYO_CONFIG_FILE
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_TERM
;
goto
error
;
}
/* create admin client */
globals
.
console
=
rayo_console_client_create
();
if
(
!
globals
.
console
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Failed to create console client entity!
\n
"
);
goto
error
;
}
/* start up message threads */
...
...
@@ -5133,13 +5219,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load)
}
start_offer_timeout_thread
(
pool
);
/* create admin client */
globals
.
console
=
rayo_console_client_create
();
if
(
!
globals
.
console
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Failed to create console client entity!
\n
"
);
return
SWITCH_STATUS_TERM
;
}
switch_console_set_complete
(
"add rayo status"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_all"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_all chat"
);
...
...
@@ -5159,6 +5238,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load)
switch_console_add_complete_func
(
"::rayo::list_input"
,
list_input
);
return
SWITCH_STATUS_SUCCESS
;
error
:
do_shutdown
();
return
SWITCH_STATUS_TERM
;
}
/**
...
...
@@ -5166,56 +5250,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load)
*/
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_rayo_shutdown
)
{
switch_console_del_complete_func
(
"::rayo::list_all"
);
switch_console_del_complete_func
(
"::rayo::list_internal"
);
switch_console_del_complete_func
(
"::rayo::list_external"
);
switch_console_del_complete_func
(
"::rayo::list_server"
);
switch_console_del_complete_func
(
"::rayo::list_call"
);
switch_console_del_complete_func
(
"::rayo::list_component"
);
switch_console_del_complete_func
(
"::rayo::list_record"
);
switch_console_del_complete_func
(
"::rayo::list_output"
);
switch_console_del_complete_func
(
"::rayo::list_input"
);
switch_console_set_complete
(
"del rayo"
);
/* stop XMPP streams */
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Waiting for XMPP threads to stop
\n
"
);
xmpp_stream_context_destroy
(
globals
.
xmpp_context
);
/* stop threads */
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Waiting for message and offer timeout threads to stop
\n
"
);
stop_all_threads
();
if
(
globals
.
console
)
{
RAYO_RELEASE
(
globals
.
console
);
RAYO_DESTROY
(
globals
.
console
);
globals
.
console
=
NULL
;
}
if
(
globals
.
server
)
{
RAYO_RELEASE
(
globals
.
server
);
RAYO_DESTROY
(
globals
.
server
);
globals
.
server
=
NULL
;
}
rayo_components_shutdown
();
/* cleanup module */
switch_event_unbind_callback
(
route_call_event
);
switch_event_unbind_callback
(
on_call_end_event
);
switch_event_unbind_callback
(
route_mixer_event
);
switch_core_hash_destroy
(
&
globals
.
command_handlers
);
switch_core_hash_destroy
(
&
globals
.
event_handlers
);
switch_core_hash_destroy
(
&
globals
.
clients_roster
);
switch_core_hash_destroy
(
&
globals
.
actors
);
switch_core_hash_destroy
(
&
globals
.
destroy_actors
);
switch_core_hash_destroy
(
&
globals
.
actors_by_id
);
switch_core_hash_destroy
(
&
globals
.
dial_gateways
);
switch_core_hash_destroy
(
&
globals
.
cmd_aliases
);
switch_status_t
result
=
do_shutdown
();
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Module shutdown
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
return
result
;
}
/**
...
...
src/mod/event_handlers/mod_rayo/rayo_cpa_component.c
浏览文件 @
dc85ef18
...
...
@@ -390,7 +390,9 @@ void rayo_cpa_component_shutdown(void)
switch_event_unbind_callback
(
on_rayo_cpa_detector_event
);
switch_event_unbind_callback
(
on_channel_hangup_complete_event
);
rayo_cpa_detector_shutdown
();
switch_core_hash_destroy
(
&
globals
.
subscribers
);
if
(
globals
.
subscribers
)
{
switch_core_hash_destroy
(
&
globals
.
subscribers
);
}
}
/* For Emacs:
...
...
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c
浏览文件 @
dc85ef18
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2014, Grasshopper
* Copyright (C) 2014
-2015
, Grasshopper
*
* Version: MPL 1.1
*
...
...
@@ -452,7 +452,9 @@ void rayo_cpa_detector_shutdown(void)
{
switch_console_set_complete
(
"del rayo_cpa"
);
switch_console_del_complete_func
(
"::rayo_cpa::list_signal_types"
);
switch_core_hash_destroy
(
&
globals
.
detectors
);
if
(
globals
.
detectors
)
{
switch_core_hash_destroy
(
&
globals
.
detectors
);
}
switch_event_unbind_callback
(
rayo_cpa_detector_event
);
}
...
...
src/mod/event_handlers/mod_rayo/rayo_input_component.c
浏览文件 @
dc85ef18
...
...
@@ -1066,7 +1066,9 @@ switch_status_t rayo_input_component_shutdown(void)
{
switch_event_unbind_callback
(
on_detected_speech_event
);
srgs_parser_destroy
(
globals
.
parser
);
if
(
globals
.
parser
)
{
srgs_parser_destroy
(
globals
.
parser
);
}
srgs_destroy
();
nlsml_destroy
();
...
...
src/mod/event_handlers/mod_rayo/rayo_output_component.c
浏览文件 @
dc85ef18
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013-201
4
, Grasshopper
* Copyright (C) 2013-201
5
, Grasshopper
*
* Version: MPL 1.1
*
...
...
@@ -1259,7 +1259,9 @@ switch_status_t rayo_output_component_load(switch_loadable_module_interface_t **
*/
switch_status_t
rayo_output_component_shutdown
(
void
)
{
switch_core_hash_destroy
(
&
fileman_globals
.
hash
);
if
(
fileman_globals
.
hash
)
{
switch_core_hash_destroy
(
&
fileman_globals
.
hash
);
}
return
SWITCH_STATUS_SUCCESS
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论