Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
676ef808
提交
676ef808
authored
6月 27, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add last_hold_time and hold_accum vars for cdr data
上级
94148095
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
45 行增加
和
2 行删除
+45
-2
switch_channel.h
src/include/switch_channel.h
+2
-0
switch_channel.c
src/switch_channel.c
+31
-2
switch_ivr.c
src/switch_ivr.c
+12
-0
没有找到文件。
src/include/switch_channel.h
浏览文件 @
676ef808
...
@@ -50,6 +50,8 @@ SWITCH_BEGIN_EXTERN_C struct switch_channel_timetable {
...
@@ -50,6 +50,8 @@ SWITCH_BEGIN_EXTERN_C struct switch_channel_timetable {
switch_time_t
transferred
;
switch_time_t
transferred
;
switch_time_t
resurrected
;
switch_time_t
resurrected
;
switch_time_t
bridged
;
switch_time_t
bridged
;
switch_time_t
last_hold
;
switch_time_t
hold_accum
;
struct
switch_channel_timetable
*
next
;
struct
switch_channel_timetable
*
next
;
};
};
...
...
src/switch_channel.c
浏览文件 @
676ef808
...
@@ -1495,6 +1495,9 @@ SWITCH_DECLARE(void) switch_channel_set_flag_value(switch_channel_t *channel, sw
...
@@ -1495,6 +1495,9 @@ SWITCH_DECLARE(void) switch_channel_set_flag_value(switch_channel_t *channel, sw
if
(
HELD
)
{
if
(
HELD
)
{
switch_channel_set_callstate
(
channel
,
CCS_HELD
);
switch_channel_set_callstate
(
channel
,
CCS_HELD
);
switch_mutex_lock
(
channel
->
profile_mutex
);
channel
->
caller_profile
->
times
->
last_hold
=
switch_time_now
();
switch_mutex_unlock
(
channel
->
profile_mutex
);
}
}
if
(
flag
==
CF_OUTBOUND
)
{
if
(
flag
==
CF_OUTBOUND
)
{
...
@@ -1630,6 +1633,11 @@ SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch
...
@@ -1630,6 +1633,11 @@ SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch
if
(
ACTIVE
)
{
if
(
ACTIVE
)
{
switch_channel_set_callstate
(
channel
,
CCS_ACTIVE
);
switch_channel_set_callstate
(
channel
,
CCS_ACTIVE
);
switch_mutex_lock
(
channel
->
profile_mutex
);
if
(
channel
->
caller_profile
->
times
->
last_hold
)
{
channel
->
caller_profile
->
times
->
hold_accum
+=
(
switch_time_now
()
-
channel
->
caller_profile
->
times
->
last_hold
);
}
switch_mutex_unlock
(
channel
->
profile_mutex
);
}
}
if
(
flag
==
CF_OUTBOUND
)
{
if
(
flag
==
CF_OUTBOUND
)
{
...
@@ -3508,13 +3516,14 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
...
@@ -3508,13 +3516,14 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
switch_caller_profile_t
*
caller_profile
,
*
ocp
;
switch_caller_profile_t
*
caller_profile
,
*
ocp
;
switch_app_log_t
*
app_log
,
*
ap
;
switch_app_log_t
*
app_log
,
*
ap
;
char
*
last_app
=
NULL
,
*
last_arg
=
NULL
;
char
*
last_app
=
NULL
,
*
last_arg
=
NULL
;
char
start
[
80
]
=
""
,
resurrect
[
80
]
=
""
,
answer
[
80
]
=
""
,
bridge
[
80
]
=
""
,
progress
[
80
]
=
""
,
progress_media
[
80
]
=
""
,
end
[
80
]
=
""
,
tmp
[
80
]
=
""
,
char
start
[
80
]
=
""
,
resurrect
[
80
]
=
""
,
answer
[
80
]
=
""
,
hold
[
80
],
bridge
[
80
]
=
""
,
progress
[
80
]
=
""
,
progress_media
[
80
]
=
""
,
end
[
80
]
=
""
,
tmp
[
80
]
=
""
,
profile_start
[
80
]
=
""
;
profile_start
[
80
]
=
""
;
int32_t
duration
=
0
,
legbillsec
=
0
,
billsec
=
0
,
mduration
=
0
,
billmsec
=
0
,
legbillmsec
=
0
,
progressmsec
=
0
,
progress_mediamsec
=
0
;
int32_t
duration
=
0
,
legbillsec
=
0
,
billsec
=
0
,
mduration
=
0
,
billmsec
=
0
,
legbillmsec
=
0
,
progressmsec
=
0
,
progress_mediamsec
=
0
;
int32_t
answersec
=
0
,
answermsec
=
0
,
waitsec
=
0
,
waitmsec
=
0
;
int32_t
answersec
=
0
,
answermsec
=
0
,
waitsec
=
0
,
waitmsec
=
0
;
switch_time_t
answerusec
=
0
;
switch_time_t
answerusec
=
0
;
switch_time_t
uduration
=
0
,
legbillusec
=
0
,
billusec
=
0
,
progresssec
=
0
,
progressusec
=
0
,
progress_mediasec
=
0
,
progress_mediausec
=
0
,
waitusec
=
0
;
switch_time_t
uduration
=
0
,
legbillusec
=
0
,
billusec
=
0
,
progresssec
=
0
,
progressusec
=
0
,
progress_mediasec
=
0
,
progress_mediausec
=
0
,
waitusec
=
0
;
time_t
tt_created
=
0
,
tt_answered
=
0
,
tt_resurrected
=
0
,
tt_bridged
,
time_t
tt_created
=
0
,
tt_answered
=
0
,
tt_resurrected
=
0
,
tt_bridged
,
tt_last_hold
,
tt_hold_accum
,
tt_progress
=
0
,
tt_progress_media
=
0
,
tt_hungup
=
0
,
mtt_created
=
0
,
mtt_answered
=
0
,
mtt_bridged
=
0
,
tt_progress
=
0
,
tt_progress_media
=
0
,
tt_hungup
=
0
,
mtt_created
=
0
,
mtt_answered
=
0
,
mtt_bridged
=
0
,
mtt_hungup
=
0
,
tt_prof_created
,
mtt_prof_created
,
mtt_progress
=
0
,
mtt_progress_media
=
0
;
mtt_hungup
=
0
,
tt_prof_created
,
mtt_prof_created
,
mtt_progress
=
0
,
mtt_progress_media
=
0
;
void
*
pop
;
void
*
pop
;
...
@@ -3593,6 +3602,12 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
...
@@ -3593,6 +3602,12 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
switch_channel_set_variable
(
channel
,
"bridge_stamp"
,
bridge
);
switch_channel_set_variable
(
channel
,
"bridge_stamp"
,
bridge
);
}
}
if
(
caller_profile
->
times
->
last_hold
)
{
switch_time_exp_lt
(
&
tm
,
caller_profile
->
times
->
last_hold
);
switch_strftime_nocheck
(
hold
,
&
retsize
,
sizeof
(
hold
),
fmt
,
&
tm
);
switch_channel_set_variable
(
channel
,
"hold_stamp"
,
hold
);
}
if
(
caller_profile
->
times
->
resurrected
)
{
if
(
caller_profile
->
times
->
resurrected
)
{
switch_time_exp_lt
(
&
tm
,
caller_profile
->
times
->
resurrected
);
switch_time_exp_lt
(
&
tm
,
caller_profile
->
times
->
resurrected
);
switch_strftime_nocheck
(
resurrect
,
&
retsize
,
sizeof
(
resurrect
),
fmt
,
&
tm
);
switch_strftime_nocheck
(
resurrect
,
&
retsize
,
sizeof
(
resurrect
),
fmt
,
&
tm
);
...
@@ -3643,6 +3658,20 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
...
@@ -3643,6 +3658,20 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
bridged
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
bridged
);
switch_channel_set_variable
(
channel
,
"bridge_uepoch"
,
tmp
);
switch_channel_set_variable
(
channel
,
"bridge_uepoch"
,
tmp
);
tt_last_hold
=
(
time_t
)
(
caller_profile
->
times
->
last_hold
/
1000000
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
TIME_T_FMT
,
tt_last_hold
);
switch_channel_set_variable
(
channel
,
"last_hold_epoch"
,
tmp
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
last_hold
);
switch_channel_set_variable
(
channel
,
"last_hold_uepoch"
,
tmp
);
tt_hold_accum
=
(
time_t
)
(
caller_profile
->
times
->
hold_accum
/
1000000
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
TIME_T_FMT
,
tt_hold_accum
);
switch_channel_set_variable
(
channel
,
"hold_accum_seconds"
,
tmp
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
hold_accum
);
switch_channel_set_variable
(
channel
,
"hold_accum_usec"
,
tmp
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
hold_accum
/
1000
);
switch_channel_set_variable
(
channel
,
"hold_accum_ms"
,
tmp
);
tt_resurrected
=
(
time_t
)
(
caller_profile
->
times
->
resurrected
/
1000000
);
tt_resurrected
=
(
time_t
)
(
caller_profile
->
times
->
resurrected
/
1000000
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
TIME_T_FMT
,
tt_resurrected
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
TIME_T_FMT
,
tt_resurrected
);
switch_channel_set_variable
(
channel
,
"resurrect_epoch"
,
tmp
);
switch_channel_set_variable
(
channel
,
"resurrect_epoch"
,
tmp
);
...
...
src/switch_ivr.c
浏览文件 @
676ef808
...
@@ -2286,6 +2286,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_
...
@@ -2286,6 +2286,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
bridged
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
bridged
);
switch_xml_set_txt_d
(
time_tag
,
tmp
);
switch_xml_set_txt_d
(
time_tag
,
tmp
);
if
(
!
(
time_tag
=
switch_xml_add_child_d
(
x_times
,
"last_hold_time"
,
t_off
++
)))
{
goto
error
;
}
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
last_hold
);
switch_xml_set_txt_d
(
time_tag
,
tmp
);
if
(
!
(
time_tag
=
switch_xml_add_child_d
(
x_times
,
"hold_accum_time"
,
t_off
++
)))
{
goto
error
;
}
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
hold_accum
);
switch_xml_set_txt_d
(
time_tag
,
tmp
);
if
(
!
(
time_tag
=
switch_xml_add_child_d
(
x_times
,
"hangup_time"
,
t_off
++
)))
{
if
(
!
(
time_tag
=
switch_xml_add_child_d
(
x_times
,
"hangup_time"
,
t_off
++
)))
{
goto
error
;
goto
error
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论