Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5227d503
提交
5227d503
authored
12月 08, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3746 --resolve
上级
f2f0eae5
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
26 行增加
和
10 行删除
+26
-10
mod_fifo.c
src/mod/applications/mod_fifo/mod_fifo.c
+26
-10
没有找到文件。
src/mod/applications/mod_fifo/mod_fifo.c
浏览文件 @
5227d503
...
...
@@ -298,6 +298,7 @@ struct fifo_node {
int
caller_count
;
int
consumer_count
;
int
ring_consumer_count
;
int
member_count
;
switch_time_t
start_waiting
;
uint32_t
importance
;
switch_thread_rwlock_t
*
rwlock
;
...
...
@@ -848,9 +849,12 @@ static fifo_node_t *create_node(const char *name, uint32_t importance, switch_mu
cbt
.
len
=
sizeof
(
outbound_count
);
sql
=
switch_mprintf
(
"select count(*) from fifo_outbound where fifo_name = '%q'"
,
name
);
fifo_execute_sql_callback
(
mutex
,
sql
,
sql2str_callback
,
&
cbt
);
if
(
atoi
(
outbound_count
)
>
0
)
{
node
->
member_count
=
atoi
(
outbound_count
);
if
(
node
->
member_count
>
0
)
{
node
->
has_outbound
=
1
;
}
}
else
{
node
->
has_outbound
=
0
;
}
switch_safe_free
(
sql
);
node
->
importance
=
importance
;
...
...
@@ -3825,7 +3829,7 @@ SWITCH_STANDARD_API(fifo_api_function)
switch_hash_this
(
hi
,
&
var
,
NULL
,
&
val
);
node
=
(
fifo_node_t
*
)
val
;
switch_mutex_lock
(
node
->
update_mutex
);
stream
->
write_function
(
stream
,
"%s:%d:%d
\n
"
,
(
char
*
)
var
,
node
->
consumer_count
,
node_caller_count
(
node
));
stream
->
write_function
(
stream
,
"%s:%d:%d
:%d:%d:%d
\n
"
,
(
char
*
)
var
,
node
->
consumer_count
,
node_caller_count
(
node
),
node
->
member_count
,
node
->
ring_consumer_count
,
node_idle_consumers
(
node
));
switch_mutex_unlock
(
node
->
update_mutex
);
x
++
;
}
...
...
@@ -3835,7 +3839,7 @@ SWITCH_STANDARD_API(fifo_api_function)
}
}
else
if
((
node
=
switch_core_hash_find
(
globals
.
fifo_hash
,
argv
[
1
])))
{
switch_mutex_lock
(
node
->
update_mutex
);
stream
->
write_function
(
stream
,
"%s:%d:%d
\n
"
,
argv
[
1
],
node
->
consumer_count
,
node_caller_count
(
node
));
stream
->
write_function
(
stream
,
"%s:%d:%d
:%d:%d:%d
\n
"
,
argv
[
1
],
node
->
consumer_count
,
node_caller_count
(
node
),
node
->
member_count
,
node
->
ring_consumer_count
,
node_idle_consumers
(
node
));
switch_mutex_unlock
(
node
->
update_mutex
);
}
else
{
stream
->
write_function
(
stream
,
"none
\n
"
);
...
...
@@ -4198,7 +4202,7 @@ static switch_status_t load_config(int reload, int del_all)
free
(
sql
);
free
(
name_dup
);
node
->
has_outbound
=
1
;
node
->
member_count
++
;
}
node
->
ready
=
1
;
node
->
is_static
=
1
;
...
...
@@ -4237,6 +4241,8 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_co
{
char
digest
[
SWITCH_MD5_DIGEST_STRING_SIZE
]
=
{
0
};
char
*
sql
,
*
name_dup
,
*
p
;
char
outbound_count
[
80
]
=
""
;
callback_t
cbt
=
{
0
};
fifo_node_t
*
node
=
NULL
;
if
(
!
fifo_name
)
return
;
...
...
@@ -4260,8 +4266,6 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_co
}
switch_mutex_unlock
(
globals
.
mutex
);
node
->
has_outbound
=
1
;
name_dup
=
strdup
(
fifo_name
);
if
((
p
=
strchr
(
name_dup
,
'@'
)))
{
*
p
=
'\0'
;
...
...
@@ -4278,6 +4282,17 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_co
free
(
sql
);
free
(
name_dup
);
cbt
.
buf
=
outbound_count
;
cbt
.
len
=
sizeof
(
outbound_count
);
sql
=
switch_mprintf
(
"select count(*) from fifo_outbound where fifo_name = '%q'"
,
fifo_name
);
fifo_execute_sql_callback
(
globals
.
sql_mutex
,
sql
,
sql2str_callback
,
&
cbt
);
node
->
member_count
=
atoi
(
outbound_count
);
if
(
node
->
member_count
>
0
)
{
node
->
has_outbound
=
1
;
}
else
{
node
->
has_outbound
=
0
;
}
switch_safe_free
(
sql
);
}
static
void
fifo_member_del
(
char
*
fifo_name
,
char
*
originate_string
)
...
...
@@ -4313,10 +4328,11 @@ static void fifo_member_del(char *fifo_name, char *originate_string)
cbt
.
len
=
sizeof
(
outbound_count
);
sql
=
switch_mprintf
(
"select count(*) from fifo_outbound where 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
;
node
->
member_count
=
atoi
(
outbound_count
);
if
(
node
->
member_count
>
0
)
{
node
->
has_outbound
=
1
;
}
else
{
node
->
has_outbound
=
0
;
node
->
has_outbound
=
0
;
}
switch_safe_free
(
sql
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论