Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
11690aff
提交
11690aff
authored
7月 13, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove some unnecessary sql stmts
上级
9f1b7311
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
27 行增加
和
4 行删除
+27
-4
switch_core_sqldb.c
src/switch_core_sqldb.c
+27
-4
没有找到文件。
src/switch_core_sqldb.c
浏览文件 @
11690aff
...
...
@@ -964,6 +964,12 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
switch_mutex_lock
(
sql_manager
.
cond_mutex
);
switch_cache_db_execute_sql
(
sql_manager
.
event_db
,
"PRAGMA synchronous=OFF;"
,
NULL
);
switch_cache_db_execute_sql
(
sql_manager
.
event_db
,
"PRAGMA count_changes=OFF;"
,
NULL
);
switch_cache_db_execute_sql
(
sql_manager
.
event_db
,
"PRAGMA temp_store=MEMORY;"
,
NULL
);
switch_cache_db_execute_sql
(
sql_manager
.
event_db
,
"PRAGMA journal_mode=OFF;"
,
NULL
);
while
(
sql_manager
.
thread_running
==
1
)
{
if
(
save_sql
||
switch_queue_trypop
(
sql_manager
.
sql_queue
[
0
],
&
pop
)
==
SWITCH_STATUS_SUCCESS
||
switch_queue_trypop
(
sql_manager
.
sql_queue
[
1
],
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -1055,6 +1061,8 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
#ifdef DEBUG_SQL
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"DONE
\n
"
);
#endif
iterations
=
0
;
trans
=
0
;
len
=
0
;
...
...
@@ -1062,6 +1070,8 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
lc
=
0
;
if
(
do_sleep
)
{
switch_yield
(
200000
);
}
else
{
switch_yield
(
1000
);
}
wrote
=
1
;
}
...
...
@@ -1228,6 +1238,7 @@ static void core_event_handler(switch_event_t *event)
);
break
;
case
SWITCH_EVENT_CODEC
:
new_sql
()
=
switch_mprintf
(
"update channels set read_codec='%q',read_rate='%q',read_bit_rate='%q',write_codec='%q',write_rate='%q',write_bit_rate='%q' where uuid='%q' and hostname='%q'"
,
...
...
@@ -1322,9 +1333,18 @@ static void core_event_handler(switch_event_t *event)
break
;
case
SWITCH_EVENT_CHANNEL_CALLSTATE
:
{
char
*
num
=
switch_event_get_header_nil
(
event
,
"channel-call-state-number"
);
switch_channel_callstate_t
callstate
=
CCS_DOWN
;
if
(
num
)
{
callstate
=
atoi
(
num
);
}
if
(
callstate
!=
CCS_DOWN
&&
callstate
!=
CCS_HANGUP
)
{
new_sql
()
=
switch_mprintf
(
"update channels set callstate='%q' where uuid='%q' and hostname='%q'"
,
switch_event_get_header_nil
(
event
,
"channel-call-state"
),
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_core_get_switchname
());
}
}
break
;
...
...
@@ -1338,8 +1358,10 @@ static void core_event_handler(switch_event_t *event)
}
switch
(
state_i
)
{
case
CS_NEW
:
case
CS_HANGUP
:
case
CS_DESTROY
:
case
CS_REPORTING
:
break
;
case
CS_ROUTING
:
if
((
extra_cols
=
parse_presence_data_cols
(
event
)))
{
...
...
@@ -1802,8 +1824,9 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
switch_cache_db_execute_sql
(
dbh
,
"drop table tasks"
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
"PRAGMA synchronous=OFF;"
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
"PRAGMA count_changes=OFF;"
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
"PRAGMA cache_size=8000"
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
"PRAGMA
default_
cache_size=8000"
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
"PRAGMA temp_store=MEMORY;"
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
"PRAGMA journal_mode=OFF;"
,
NULL
);
}
break
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论