Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
61033f42
提交
61033f42
authored
10月 03, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revert
上级
6d01ad5e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
4 行增加
和
56 行删除
+4
-56
switch_core.h
src/include/switch_core.h
+0
-3
switch_console.c
src/switch_console.c
+2
-2
switch_core_sqldb.c
src/switch_core_sqldb.c
+2
-51
没有找到文件。
src/include/switch_core.h
浏览文件 @
61033f42
...
...
@@ -2303,9 +2303,6 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t
SWITCH_DECLARE
(
switch_status_t
)
_switch_core_recovery_db_handle
(
switch_cache_db_handle_t
**
dbh
,
const
char
*
file
,
const
char
*
func
,
int
line
);
#define switch_core_recovery_db_handle(_a) _switch_core_recovery_db_handle(_a, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE
(
switch_status_t
)
_switch_core_persist_db_handle
(
switch_cache_db_handle_t
**
dbh
,
const
char
*
file
,
const
char
*
func
,
int
line
);
#define switch_core_persist_db_handle(_a) _switch_core_persist_db_handle(_a, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE
(
switch_bool_t
)
switch_cache_db_test_reactive
(
switch_cache_db_handle_t
*
db
,
const
char
*
test_sql
,
const
char
*
drop_sql
,
const
char
*
reactive_sql
);
SWITCH_DECLARE
(
switch_status_t
)
switch_cache_db_persistant_execute
(
switch_cache_db_handle_t
*
dbh
,
const
char
*
sql
,
uint32_t
retries
);
...
...
src/switch_console.c
浏览文件 @
61033f42
...
...
@@ -248,7 +248,7 @@ SWITCH_DECLARE(char *) switch_console_expand_alias(char *cmd, char *arg)
return
NULL
;
}
if
(
switch_core_
persist_
db_handle
(
&
db
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_db_handle
(
&
db
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Database Error
\n
"
);
return
NULL
;
}
...
...
@@ -1859,7 +1859,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string)
switch_cache_db_handle_t
*
db
=
NULL
;
char
*
sql
=
NULL
;
if
(
switch_core_
persist_
db_handle
(
&
db
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_db_handle
(
&
db
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Database Error
\n
"
);
free
(
mydata
);
return
SWITCH_STATUS_FALSE
;
...
...
src/switch_core_sqldb.c
浏览文件 @
61033f42
...
...
@@ -176,7 +176,7 @@ static switch_cache_db_handle_t *get_handle(const char *db_str, const char *user
}
#define SWITCH_CORE_DB "
file:scoreboard?mode=memory&cache=shared
"
#define SWITCH_CORE_DB "
core
"
/*!
\brief Open the default system database
*/
...
...
@@ -218,49 +218,6 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t
return
r
;
}
#define SWITCH_CORE_PERSIST_DB "core"
/*!
\brief Open the default system database
*/
SWITCH_DECLARE
(
switch_status_t
)
_switch_core_persist_db_handle
(
switch_cache_db_handle_t
**
dbh
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
switch_cache_db_connection_options_t
options
=
{
{
0
}
};
switch_status_t
r
;
if
(
!
sql_manager
.
manage
)
{
return
SWITCH_STATUS_FALSE
;
}
if
(
zstr
(
runtime
.
odbc_dsn
))
{
if
(
switch_test_flag
((
&
runtime
),
SCF_CORE_ODBC_REQ
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
runtime
.
dbname
)
{
options
.
core_db_options
.
db_path
=
runtime
.
dbname
;
}
else
{
options
.
core_db_options
.
db_path
=
SWITCH_CORE_PERSIST_DB
;
}
r
=
_switch_cache_db_get_db_handle
(
dbh
,
SCDB_TYPE_CORE_DB
,
&
options
,
file
,
func
,
line
);
}
else
{
options
.
odbc_options
.
dsn
=
runtime
.
odbc_dsn
;
options
.
odbc_options
.
user
=
runtime
.
odbc_user
;
options
.
odbc_options
.
pass
=
runtime
.
odbc_pass
;
r
=
_switch_cache_db_get_db_handle
(
dbh
,
SCDB_TYPE_ODBC
,
&
options
,
file
,
func
,
line
);
}
/* I *think* we can do without this now, if not let me know
if (r == SWITCH_STATUS_SUCCESS && !(*dbh)->io_mutex) {
(*dbh)->io_mutex = sql_manager.io_mutex;
}
*/
return
r
;
}
#define SWITCH_CORE_RECOVERY_DB "core_recovery"
SWITCH_DECLARE
(
switch_status_t
)
_switch_core_recovery_db_handle
(
switch_cache_db_handle_t
**
dbh
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
...
...
@@ -2409,13 +2366,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
break
;
}
{
switch_cache_db_handle_t
*
db
=
NULL
;
switch_core_persist_db_handle
(
&
db
);
switch_cache_db_test_reactive
(
db
,
"select hostname from aliases"
,
"DROP TABLE aliases"
,
create_alias_sql
);
switch_cache_db_release_db_handle
(
&
db
);
}
switch_cache_db_test_reactive
(
sql_manager
.
dbh
,
"select hostname from aliases"
,
"DROP TABLE aliases"
,
create_alias_sql
);
switch_cache_db_test_reactive
(
sql_manager
.
dbh
,
"select hostname from complete"
,
"DROP TABLE complete"
,
create_complete_sql
);
switch_cache_db_test_reactive
(
sql_manager
.
dbh
,
"select hostname from nat"
,
"DROP TABLE nat"
,
create_nat_sql
);
switch_cache_db_test_reactive
(
sql_manager
.
dbh
,
"delete from registrations where reg_user='' or network_proto='tcp' or network_proto='tls'"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论