Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
174ad6ed
提交
174ad6ed
authored
5月 11, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sip reg
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1433
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
64c80bd8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
279 行增加
和
22 行删除
+279
-22
switch_core.h
src/include/switch_core.h
+19
-1
mod_exosip.c
src/mod/endpoints/mod_exosip/mod_exosip.c
+249
-11
switch_core.c
src/switch_core.c
+11
-10
没有找到文件。
src/include/switch_core.h
浏览文件 @
174ad6ed
...
...
@@ -758,10 +758,28 @@ SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_write_codec(switch_core
/*!
\brief Open a core db (SQLite) file
\param filename the path to the db file to open
\return
\return
the db handle
*/
SWITCH_DECLARE
(
switch_core_db_t
*
)
switch_core_db_open_file
(
char
*
filename
);
/*!
\brief Execute a sql stmt until it is accepted
\param db the db handle
\param sql the sql to execute
\param retries the number of retries to use
\return SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_db_persistant_execute
(
switch_core_db_t
*
db
,
char
*
sql
,
uint32_t
retries
);
/*!
\brief perform a test query then perform a reactive query if the first one fails
\param db the db handle
\param test_sql the test sql
\param reactive_sql the reactive sql
*/
SWITCH_DECLARE
(
void
)
switch_core_db_test_reactive
(
switch_core_db_t
*
db
,
char
*
test_sql
,
char
*
reactive_sql
);
#define SWITCH_CORE_DB "core"
/*!
\brief Open the default system database
...
...
src/mod/endpoints/mod_exosip/mod_exosip.c
浏览文件 @
174ad6ed
差异被折叠。
点击展开。
src/switch_core.c
浏览文件 @
174ad6ed
...
...
@@ -135,8 +135,9 @@ SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(char *filename)
return
db
;
}
#if 0
static void check_table_exists(switch_core_db_t *db, char *test_sql, char *create_sql) {
SWITCH_DECLARE
(
void
)
switch_core_db_test_reactive
(
switch_core_db_t
*
db
,
char
*
test_sql
,
char
*
reactive_sql
)
{
char
*
errmsg
;
if
(
db
)
{
...
...
@@ -155,13 +156,13 @@ static void check_table_exists(switch_core_db_t *db, char *test_sql, char *creat
errmsg
=
NULL
;
switch_core_db_exec
(
db
,
creat
e_sql,
reactiv
e_sql
,
NULL
,
NULL
,
&
errmsg
);
if
(
errmsg
)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQL ERR [%s]\n[%s]\n", errmsg,
creat
e_sql);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"SQL ERR [%s]
\n
[%s]
\n
"
,
errmsg
,
reactiv
e_sql
);
switch_core_db_free
(
errmsg
);
errmsg
=
NULL
;
}
...
...
@@ -170,7 +171,7 @@ static void check_table_exists(switch_core_db_t *db, char *test_sql, char *creat
}
}
#endif
SWITCH_DECLARE
(
switch_status_t
)
switch_core_set_console
(
char
*
console
)
...
...
@@ -2499,7 +2500,7 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_by_name(char
return
switch_core_session_request
(
endpoint_interface
,
pool
);
}
static
switch_status_t
switch_core_sql
_persistant_execute
(
switch_core_db_t
*
db
,
char
*
sql
,
uint32_t
retries
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_db
_persistant_execute
(
switch_core_db_t
*
db
,
char
*
sql
,
uint32_t
retries
)
{
char
*
errmsg
;
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
...
...
@@ -2513,7 +2514,7 @@ static switch_status_t switch_core_sql_persistant_execute(switch_core_db_t *db,
&
errmsg
);
if
(
errmsg
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"SQL ERR
[%s]
\n
"
,
errmsg
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"SQL ERR
\n
[%s]
\n
[%s]
\n
"
,
sql
,
errmsg
);
switch_core_db_free
(
errmsg
);
switch_yield
(
100000
);
retries
--
;
...
...
@@ -2547,7 +2548,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
work
++
;
if
(
itterations
==
0
)
{
char
*
isql
=
"begin transaction CORE1;"
;
if
(
switch_core_
sql
_persistant_execute
(
runtime
.
event_db
,
isql
,
25
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_
db
_persistant_execute
(
runtime
.
event_db
,
isql
,
25
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"SQL exec error! [%s]
\n
"
,
isql
);
}
else
{
trans
=
1
;
...
...
@@ -2556,7 +2557,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
itterations
++
;
if
(
switch_core_
sql
_persistant_execute
(
runtime
.
event_db
,
sql
,
25
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_
db
_persistant_execute
(
runtime
.
event_db
,
sql
,
25
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"SQL exec error! [%s]
\n
"
,
sql
);
}
free
(
sql
);
...
...
@@ -2573,7 +2574,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
if
(
trans
&&
(
itterations
==
target
||
diff
>=
freq
))
{
char
*
sql
=
"end transaction CORE1"
;
work
++
;
if
(
switch_core_
sql
_persistant_execute
(
runtime
.
event_db
,
sql
,
25
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_
db
_persistant_execute
(
runtime
.
event_db
,
sql
,
25
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"SQL exec error! [%s]
\n
"
,
sql
);
}
last_commit
=
switch_time_now
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论