Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c7f00c3e
提交
c7f00c3e
authored
11月 22, 2013
作者:
Eliot Gable
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add queue talk time and hold time stats to consumer and caller stop events.
上级
94939d1b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
38 行增加
和
0 行删除
+38
-0
mod_fifo.c
src/mod/applications/mod_fifo/mod_fifo.c
+38
-0
没有找到文件。
src/mod/applications/mod_fifo/mod_fifo.c
浏览文件 @
c7f00c3e
...
@@ -2244,6 +2244,10 @@ static void dec_use_count(switch_core_session_t *session, const char *type)
...
@@ -2244,6 +2244,10 @@ static void dec_use_count(switch_core_session_t *session, const char *type)
if
(
type
)
{
if
(
type
)
{
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
FIFO_EVENT
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
FIFO_EVENT
)
==
SWITCH_STATUS_SUCCESS
)
{
uint64_t
hold_usec
=
0
,
tt_usec
=
0
;
switch_caller_profile_t
*
originator_cp
=
NULL
;
originator_cp
=
switch_channel_get_caller_profile
(
channel
);
switch_channel_event_set_data
(
channel
,
event
);
switch_channel_event_set_data
(
channel
,
event
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Name"
,
MANUAL_QUEUE_NAME
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Name"
,
MANUAL_QUEUE_NAME
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Action"
,
"channel-consumer-stop"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Action"
,
"channel-consumer-stop"
);
...
@@ -2252,6 +2256,18 @@ static void dec_use_count(switch_core_session_t *session, const char *type)
...
@@ -2252,6 +2256,18 @@ static void dec_use_count(switch_core_session_t *session, const char *type)
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Outbound-ID"
,
outbound_id
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Outbound-ID"
,
outbound_id
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Use-Count"
,
"%d"
,
fifo_get_use_count
(
outbound_id
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Use-Count"
,
"%d"
,
fifo_get_use_count
(
outbound_id
));
}
}
hold_usec
=
originator_cp
->
times
->
hold_accum
;
tt_usec
=
(
switch_micro_time_now
()
-
originator_cp
->
times
->
bridged
)
-
hold_usec
;
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-us"
,
"%lu"
,
originator_cp
->
times
->
bridged
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-ms"
,
"%lu"
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-s"
,
"%lu"
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-us"
,
"%lu"
,
tt_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-ms"
,
"%lu"
,
(
uint64_t
)(
tt_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-s"
,
"%lu"
,
(
uint64_t
)(
tt_usec
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-us"
,
"%lu"
,
hold_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-ms"
,
"%lu"
,
(
uint64_t
)(
hold_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-s"
,
"%lu"
,
(
uint64_t
)(
hold_usec
/
1000000
));
switch_event_fire
(
&
event
);
switch_event_fire
(
&
event
);
}
}
}
}
...
@@ -3260,6 +3276,7 @@ SWITCH_STANDARD_APP(fifo_function)
...
@@ -3260,6 +3276,7 @@ SWITCH_STANDARD_APP(fifo_function)
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
FIFO_EVENT
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
FIFO_EVENT
)
==
SWITCH_STATUS_SUCCESS
)
{
uint64_t
hold_usec
=
0
,
tt_usec
=
0
;
switch_channel_event_set_data
(
channel
,
event
);
switch_channel_event_set_data
(
channel
,
event
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Name"
,
arg_fifo_name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Name"
,
arg_fifo_name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Action"
,
"channel-consumer-stop"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Action"
,
"channel-consumer-stop"
);
...
@@ -3268,6 +3285,18 @@ SWITCH_STANDARD_APP(fifo_function)
...
@@ -3268,6 +3285,18 @@ SWITCH_STANDARD_APP(fifo_function)
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Outbound-ID"
,
outbound_id
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Outbound-ID"
,
outbound_id
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Use-Count"
,
"%d"
,
fifo_get_use_count
(
outbound_id
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Use-Count"
,
"%d"
,
fifo_get_use_count
(
outbound_id
));
}
}
hold_usec
=
originator_cp
->
times
->
hold_accum
;
tt_usec
=
(
switch_micro_time_now
()
-
originator_cp
->
times
->
bridged
)
-
hold_usec
;
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-us"
,
"%lu"
,
originator_cp
->
times
->
bridged
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-ms"
,
"%lu"
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-s"
,
"%lu"
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-us"
,
"%lu"
,
tt_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-ms"
,
"%lu"
,
(
uint64_t
)(
tt_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-s"
,
"%lu"
,
(
uint64_t
)(
tt_usec
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-us"
,
"%lu"
,
hold_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-ms"
,
"%lu"
,
(
uint64_t
)(
hold_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-s"
,
"%lu"
,
(
uint64_t
)(
hold_usec
/
1000000
));
switch_event_fire
(
&
event
);
switch_event_fire
(
&
event
);
}
}
...
@@ -3286,9 +3315,18 @@ SWITCH_STANDARD_APP(fifo_function)
...
@@ -3286,9 +3315,18 @@ SWITCH_STANDARD_APP(fifo_function)
switch_event_fire
(
&
event
);
switch_event_fire
(
&
event
);
}
}
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
FIFO_EVENT
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
FIFO_EVENT
)
==
SWITCH_STATUS_SUCCESS
)
{
uint64_t
hold_usec
=
0
,
tt_usec
=
0
;
switch_channel_event_set_data
(
other_channel
,
event
);
switch_channel_event_set_data
(
other_channel
,
event
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Name"
,
argv
[
0
]);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Name"
,
argv
[
0
]);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Action"
,
"bridge-caller-stop"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Action"
,
"bridge-caller-stop"
);
hold_usec
=
originatee_cp
->
times
->
hold_accum
;
tt_usec
=
(
switch_micro_time_now
()
-
originatee_cp
->
times
->
bridged
)
-
hold_usec
;
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Talk-Time-us"
,
"%lu"
,
tt_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Talk-Time-ms"
,
"%lu"
,
(
uint64_t
)(
tt_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Talk-Time-s"
,
"%lu"
,
(
uint64_t
)(
tt_usec
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Hold-Time-us"
,
"%lu"
,
hold_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Hold-Time-ms"
,
"%lu"
,
(
uint64_t
)(
hold_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Hold-Time-s"
,
"%lu"
,
(
uint64_t
)(
hold_usec
/
1000000
));
switch_event_fire
(
&
event
);
switch_event_fire
(
&
event
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论