Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
bf6d91c3
提交
bf6d91c3
authored
5月 26, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reloadxml
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1509
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
ab3f42c9
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
33 行增加
和
4 行删除
+33
-4
mod_commands.c
src/mod/applications/mod_commands/mod_commands.c
+22
-1
switch_xml.c
src/switch_xml.c
+11
-3
没有找到文件。
src/mod/applications/mod_commands/mod_commands.c
浏览文件 @
bf6d91c3
...
@@ -80,6 +80,20 @@ static switch_status_t load_function(char *mod, switch_stream_handle_t *stream)
...
@@ -80,6 +80,20 @@ static switch_status_t load_function(char *mod, switch_stream_handle_t *stream)
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
reload_function
(
char
*
mod
,
switch_stream_handle_t
*
stream
)
{
const
char
*
err
;
switch_xml_t
xml_root
;
if
((
xml_root
=
switch_xml_open_root
(
1
,
&
err
)))
{
switch_xml_free
(
xml_root
);
}
stream
->
write_function
(
stream
,
"OK [%s]
\n
"
,
err
);
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
kill_function
(
char
*
dest
,
switch_stream_handle_t
*
stream
)
static
switch_status_t
kill_function
(
char
*
dest
,
switch_stream_handle_t
*
stream
)
{
{
switch_core_session_t
*
session
=
NULL
;
switch_core_session_t
*
session
=
NULL
;
...
@@ -231,12 +245,19 @@ static switch_api_interface_t load_api_interface = {
...
@@ -231,12 +245,19 @@ static switch_api_interface_t load_api_interface = {
/*.next */
&
transfer_api_interface
/*.next */
&
transfer_api_interface
};
};
static
switch_api_interface_t
reload_api_interface
=
{
/*.interface_name */
"reloadxml"
,
/*.desc */
"Reload XML"
,
/*.function */
reload_function
,
/*.next */
&
load_api_interface
,
};
static
switch_api_interface_t
commands_api_interface
=
{
static
switch_api_interface_t
commands_api_interface
=
{
/*.interface_name */
"killchan"
,
/*.interface_name */
"killchan"
,
/*.desc */
"Kill Channel"
,
/*.desc */
"Kill Channel"
,
/*.function */
kill_function
,
/*.function */
kill_function
,
/*.next */
&
load_api_interface
/*.next */
&
re
load_api_interface
};
};
static
const
switch_loadable_module_interface_t
mod_commands_module_interface
=
{
static
const
switch_loadable_module_interface_t
mod_commands_module_interface
=
{
...
...
src/switch_xml.c
浏览文件 @
bf6d91c3
...
@@ -94,6 +94,7 @@ static switch_xml_t MAIN_XML_ROOT = NULL;
...
@@ -94,6 +94,7 @@ static switch_xml_t MAIN_XML_ROOT = NULL;
static
switch_memory_pool_t
*
XML_MEMORY_POOL
;
static
switch_memory_pool_t
*
XML_MEMORY_POOL
;
static
switch_mutex_t
*
XML_LOCK
;
static
switch_mutex_t
*
XML_LOCK
;
static
switch_thread_rwlock_t
*
RWLOCK
;
static
switch_thread_rwlock_t
*
RWLOCK
;
static
uint32_t
lock_count
=
0
;
struct
xml_section_t
{
struct
xml_section_t
{
const
char
*
name
;
const
char
*
name
;
...
@@ -844,7 +845,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(char *section,
...
@@ -844,7 +845,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(char *section,
for
(;;)
{
for
(;;)
{
if
(
!
xml
)
{
if
(
!
xml
)
{
if
(
!
(
xml
=
MAIN_XML_ROOT
))
{
if
(
!
(
xml
=
switch_xml_root
()
))
{
*
node
=
NULL
;
*
node
=
NULL
;
*
root
=
NULL
;
*
root
=
NULL
;
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
...
@@ -870,8 +871,10 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(char *section,
...
@@ -870,8 +871,10 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(char *section,
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_root
(
void
)
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_root
(
void
)
{
{
lock_count
++
;
switch_thread_rwlock_rdlock
(
RWLOCK
);
switch_thread_rwlock_rdlock
(
RWLOCK
);
return
MAIN_XML_ROOT
;
return
MAIN_XML_ROOT
;
}
}
...
@@ -880,7 +883,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
...
@@ -880,7 +883,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
{
{
char
path_buf
[
1024
];
char
path_buf
[
1024
];
uint8_t
hasmain
=
0
;
uint8_t
hasmain
=
0
;
switch_mutex_lock
(
XML_LOCK
);
switch_mutex_lock
(
XML_LOCK
);
if
(
MAIN_XML_ROOT
)
{
if
(
MAIN_XML_ROOT
)
{
...
@@ -905,6 +908,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
...
@@ -905,6 +908,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
switch_xml_free
(
MAIN_XML_ROOT
);
switch_xml_free
(
MAIN_XML_ROOT
);
MAIN_XML_ROOT
=
NULL
;
MAIN_XML_ROOT
=
NULL
;
}
else
{
}
else
{
*
err
=
"Success"
;
switch_set_flag
(
MAIN_XML_ROOT
,
SWITCH_XML_ROOT
);
switch_set_flag
(
MAIN_XML_ROOT
,
SWITCH_XML_ROOT
);
}
}
}
else
{
}
else
{
...
@@ -915,6 +919,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
...
@@ -915,6 +919,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
switch_thread_rwlock_unlock
(
RWLOCK
);
switch_thread_rwlock_unlock
(
RWLOCK
);
}
}
switch_mutex_unlock
(
XML_LOCK
);
switch_mutex_unlock
(
XML_LOCK
);
return
switch_xml_root
();
return
switch_xml_root
();
}
}
...
@@ -1100,7 +1105,10 @@ SWITCH_DECLARE(void) switch_xml_free(switch_xml_t xml)
...
@@ -1100,7 +1105,10 @@ SWITCH_DECLARE(void) switch_xml_free(switch_xml_t xml)
if
(
!
xml
)
return
;
if
(
!
xml
)
return
;
if
(
switch_test_flag
(
xml
,
SWITCH_XML_ROOT
))
{
if
(
switch_test_flag
(
xml
,
SWITCH_XML_ROOT
))
{
switch_thread_rwlock_unlock
(
RWLOCK
);
if
(
lock_count
>
0
)
{
switch_thread_rwlock_unlock
(
RWLOCK
);
lock_count
--
;
}
}
}
if
(
xml
==
MAIN_XML_ROOT
)
{
if
(
xml
==
MAIN_XML_ROOT
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论