Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c58efca2
提交
c58efca2
authored
6月 24, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some cols to fifo_outbound
上级
3240a6f3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
6 行删除
+16
-6
mod_fifo.c
src/mod/applications/mod_fifo/mod_fifo.c
+16
-6
没有找到文件。
src/mod/applications/mod_fifo/mod_fifo.c
浏览文件 @
c58efca2
...
...
@@ -404,7 +404,7 @@ static fifo_node_t *create_node(const char *name, uint32_t importance, switch_mu
switch_mutex_init
(
&
node
->
mutex
,
SWITCH_MUTEX_NESTED
,
node
->
pool
);
cbt
.
buf
=
outbound_count
;
cbt
.
len
=
sizeof
(
outbound_count
);
sql
=
switch_mprintf
(
"select count(*) from fifo_outbound where fifo_name = '%q'"
,
name
);
sql
=
switch_mprintf
(
"select count(*) from fifo_outbound where
taking_calls = 1 and
fifo_name = '%q'"
,
name
);
fifo_execute_sql_callback
(
mutex
,
sql
,
sql2str_callback
,
&
cbt
);
if
(
atoi
(
outbound_count
)
>
0
)
{
node
->
has_outbound
=
1
;
...
...
@@ -580,7 +580,8 @@ static void find_consumers(fifo_node_t *node)
sql
=
switch_mprintf
(
"select uuid, fifo_name, originate_string, simo_count, use_count, timeout, lag, "
"next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname "
"from fifo_outbound where (fifo_name = '%q') and (use_count < simo_count) and (next_avail = 0 or next_avail <= %ld) "
"from fifo_outbound where taking_calls = 1 and "
"(fifo_name = '%q') and (use_count < simo_count) and (next_avail = 0 or next_avail <= %ld) "
"order by next_avail"
,
node
->
name
,
(
long
)
switch_epoch_time_now
(
NULL
));
switch_assert
(
sql
);
...
...
@@ -1658,6 +1659,8 @@ static int xml_callback(void *pArg, int argc, char **argv, char **columnNames)
switch_xml_set_attr_d
(
x_out
,
"lag"
,
argv
[
6
]);
switch_xml_set_attr_d
(
x_out
,
"outbound-call-count"
,
argv
[
10
]);
switch_xml_set_attr_d
(
x_out
,
"outbound-fail-count"
,
argv
[
11
]);
switch_xml_set_attr_d
(
x_out
,
"taking-calls"
,
argv
[
12
]);
switch_xml_set_attr_d
(
x_out
,
"status"
,
argv
[
13
]);
switch_xml_set_attr_d
(
x_out
,
"next-available"
,
expires
);
switch_xml_set_txt_d
(
x_out
,
argv
[
2
]);
...
...
@@ -1670,7 +1673,7 @@ static int xml_outbound(switch_xml_t xml, fifo_node_t *node, char *container, ch
struct
xml_helper
h
;
char
*
sql
=
switch_mprintf
(
"select uuid, fifo_name, originate_string, simo_count, use_count, timeout, "
"lag, next_avail, expires, static, outbound_call_count, outbound_fail_count, "
"hostname from fifo_outbound where fifo_name = '%q'"
,
node
->
name
);
"hostname
, taking_calls, status
from fifo_outbound where fifo_name = '%q'"
,
node
->
name
);
h
.
xml
=
xml
;
h
.
node
=
node
;
...
...
@@ -1907,7 +1910,14 @@ const char outbound_sql[] =
" timeout integer,
\n
"
" lag integer,
\n
"
" next_avail integer,
\n
"
" expires integer,
\n
"
" static integer,
\n
"
" outbound_call_count integer,"
" outbound_fail_count integer,"
" hostname varchar(255)
\n
"
");
\n
"
;
" expires integer,
\n
"
" static integer,
\n
"
" outbound_call_count integer,
\n
"
" outbound_fail_count integer,
\n
"
" hostname varchar(255),
\n
"
" taking_calls integer not null default 1,
\n
"
" status varchar(255)
\n
"
");
\n
"
;
static
switch_status_t
load_config
(
int
reload
,
int
del_all
)
...
...
@@ -1963,7 +1973,7 @@ static switch_status_t load_config(int reload, int del_all)
goto
done
;
}
switch_cache_db_test_reactive
(
dbh
,
"delete from fifo_outbound where static = 1"
,
"drop table fifo_outbound"
,
outbound_sql
);
switch_cache_db_test_reactive
(
dbh
,
"delete from fifo_outbound where static = 1
or taking_calls < 0
"
,
"drop table fifo_outbound"
,
outbound_sql
);
switch_cache_db_release_db_handle
(
&
dbh
);
if
(
reload
)
{
...
...
@@ -2201,7 +2211,7 @@ static void fifo_member_del(char *fifo_name, char *originate_string)
cbt
.
buf
=
outbound_count
;
cbt
.
len
=
sizeof
(
outbound_count
);
sql
=
switch_mprintf
(
"select count(*) from fifo_outbound where fifo_name = '%q'"
,
node
->
name
);
sql
=
switch_mprintf
(
"select count(*) from fifo_outbound where
taking_calls = 1 and
fifo_name = '%q'"
,
node
->
name
);
fifo_execute_sql_callback
(
globals
.
sql_mutex
,
sql
,
sql2str_callback
,
&
cbt
);
if
(
atoi
(
outbound_count
)
>
0
)
{
node
->
has_outbound
=
1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论