Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
bf5ff90f
提交
bf5ff90f
authored
11月 24, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile
Conflicts: src/mod/applications/mod_fifo/mod_fifo.c
上级
9fa722fc
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
41 行增加
和
3 行删除
+41
-3
mod_fifo.c
src/mod/applications/mod_fifo/mod_fifo.c
+41
-3
没有找到文件。
src/mod/applications/mod_fifo/mod_fifo.c
浏览文件 @
bf5ff90f
...
@@ -1498,9 +1498,9 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
...
@@ -1498,9 +1498,9 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
if
(
!
total
)
goto
end
;
if
(
!
total
)
goto
end
;
if
(
!
globals
.
allow_transcoding
&&
!
switch_true
(
switch_event_get_header
(
pop
,
"variable_fifo_allow_transcoding"
))
&&
if
(
!
globals
.
allow_transcoding
&&
!
switch_true
(
switch_event_get_header
(
pop
,
"variable_fifo_allow_transcoding"
))
&&
(
codec
=
switch_event_get_header
(
pop
,
"variable_
si
p_use_codec_name"
)))
{
(
codec
=
switch_event_get_header
(
pop
,
"variable_
rt
p_use_codec_name"
)))
{
const
char
*
rate
=
switch_event_get_header
(
pop
,
"variable_
si
p_use_codec_rate"
);
const
char
*
rate
=
switch_event_get_header
(
pop
,
"variable_
rt
p_use_codec_rate"
);
const
char
*
ptime
=
switch_event_get_header
(
pop
,
"variable_
si
p_use_codec_ptime"
);
const
char
*
ptime
=
switch_event_get_header
(
pop
,
"variable_
rt
p_use_codec_ptime"
);
char
nstr
[
256
]
=
""
;
char
nstr
[
256
]
=
""
;
if
(
strcasecmp
(
codec
,
"PCMU"
)
&&
strcasecmp
(
codec
,
"PCMA"
))
{
if
(
strcasecmp
(
codec
,
"PCMU"
)
&&
strcasecmp
(
codec
,
"PCMA"
))
{
...
@@ -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"
,
"%"
SWITCH_TIME_T_FMT
,
originator_cp
->
times
->
bridged
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-us"
,
"%"
SWITCH_TIME_T_FMT
,
tt_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
tt_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
tt_usec
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-us"
,
"%"
SWITCH_TIME_T_FMT
,
hold_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
hold_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
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"
,
"%"
SWITCH_TIME_T_FMT
,
originator_cp
->
times
->
bridged
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Bridge-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
originator_cp
->
times
->
bridged
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-us"
,
"%"
SWITCH_TIME_T_FMT
,
tt_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
tt_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Talk-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
tt_usec
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-us"
,
"%"
SWITCH_TIME_T_FMT
,
hold_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
hold_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Consumer-Hold-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
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"
,
"%"
SWITCH_TIME_T_FMT
,
tt_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Talk-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
tt_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Talk-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
tt_usec
/
1000000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Hold-Time-us"
,
"%"
SWITCH_TIME_T_FMT
,
hold_usec
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Hold-Time-ms"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
hold_usec
/
1000
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"FIFO-Caller-Hold-Time-s"
,
"%"
SWITCH_TIME_T_FMT
,
(
uint64_t
)(
hold_usec
/
1000000
));
switch_event_fire
(
&
event
);
switch_event_fire
(
&
event
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论