Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d3616deb
提交
d3616deb
authored
5月 24, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@8568
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
ef695ddf
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
57 行增加
和
2 行删除
+57
-2
switch_channel.h
src/include/switch_channel.h
+2
-0
switch_channel.c
src/switch_channel.c
+42
-2
switch_ivr.c
src/switch_ivr.c
+13
-0
没有找到文件。
src/include/switch_channel.h
浏览文件 @
d3616deb
...
...
@@ -44,6 +44,8 @@ SWITCH_BEGIN_EXTERN_C struct switch_channel_timetable {
switch_time_t
profile_created
;
switch_time_t
created
;
switch_time_t
answered
;
switch_time_t
progress
;
switch_time_t
progress_media
;
switch_time_t
hungup
;
switch_time_t
transferred
;
struct
switch_channel_timetable
*
next
;
...
...
src/switch_channel.c
浏览文件 @
d3616deb
...
...
@@ -1141,6 +1141,8 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel
if
(
channel
->
caller_profile
&&
channel
->
caller_profile
->
times
)
{
channel
->
caller_profile
->
times
->
transferred
=
caller_profile
->
times
->
profile_created
;
caller_profile
->
times
->
answered
=
channel
->
caller_profile
->
times
->
answered
;
caller_profile
->
times
->
progress
=
channel
->
caller_profile
->
times
->
progress
;
caller_profile
->
times
->
progress_media
=
channel
->
caller_profile
->
times
->
progress_media
;
caller_profile
->
times
->
created
=
channel
->
caller_profile
->
times
->
created
;
caller_profile
->
times
->
hungup
=
channel
->
caller_profile
->
times
->
hungup
;
}
else
{
...
...
@@ -1373,6 +1375,12 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_ch
return
SWITCH_STATUS_SUCCESS
;
}
if
(
channel
->
caller_profile
&&
channel
->
caller_profile
->
times
)
{
switch_mutex_lock
(
channel
->
profile_mutex
);
channel
->
caller_profile
->
times
->
progress
=
switch_timestamp_now
();
switch_mutex_unlock
(
channel
->
profile_mutex
);
}
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -1394,6 +1402,12 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
switch_event_fire
(
&
event
);
}
if
(
channel
->
caller_profile
&&
channel
->
caller_profile
->
times
)
{
switch_mutex_lock
(
channel
->
profile_mutex
);
channel
->
caller_profile
->
times
->
progress_media
=
switch_timestamp_now
();
switch_mutex_unlock
(
channel
->
profile_mutex
);
}
/* if we're the child of another channel and the other channel is in a blocking read they will never realize we have answered so send
a SWITCH_SIG_BREAK to interrupt any blocking reads on that channel
*/
...
...
@@ -1922,10 +1936,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
switch_caller_profile_t
*
caller_profile
,
*
ocp
;
switch_app_log_t
*
app_log
,
*
ap
;
char
*
last_app
=
NULL
,
*
last_arg
=
NULL
;
char
start
[
80
]
=
""
,
answer
[
80
]
=
""
,
end
[
80
]
=
""
,
tmp
[
80
]
=
""
,
profile_start
[
80
]
=
""
;
char
start
[
80
]
=
""
,
answer
[
80
]
=
""
,
progress
[
80
]
=
""
,
progress_media
[
80
]
=
""
,
end
[
80
]
=
""
,
tmp
[
80
]
=
""
,
profile_start
[
80
]
=
""
;
int32_t
duration
=
0
,
legbillsec
=
0
,
billsec
=
0
,
mduration
=
0
,
billmsec
=
0
,
legbillmsec
=
0
;
switch_time_t
uduration
=
0
,
legbillusec
=
0
,
billusec
=
0
;
time_t
tt_created
=
0
,
tt_answered
=
0
,
tt_
hungup
=
0
,
mtt_created
=
0
,
mtt_answered
=
0
,
mtt_hungup
=
0
,
tt_prof_created
,
mtt_prof_created
;
time_t
tt_created
=
0
,
tt_answered
=
0
,
tt_
progress
=
0
,
tt_progress_media
=
0
,
tt_hungup
=
0
,
mtt_created
=
0
,
mtt_answered
=
0
,
mtt_hungup
=
0
,
tt_prof_created
,
mtt_prof_created
,
mtt_progress
=
0
,
mtt_progress_media
=
0
;
if
(
!
(
caller_profile
=
switch_channel_get_caller_profile
(
channel
))
||
!
channel
->
variables
)
{
return
SWITCH_STATUS_FALSE
;
...
...
@@ -1968,6 +1982,18 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
switch_channel_set_variable
(
channel
,
"answer_stamp"
,
answer
);
}
if
(
caller_profile
->
times
->
progress
)
{
switch_time_exp_lt
(
&
tm
,
caller_profile
->
times
->
progress
);
switch_strftime
(
progress
,
&
retsize
,
sizeof
(
progress
),
fmt
,
&
tm
);
switch_channel_set_variable
(
channel
,
"progress_stamp"
,
progress
);
}
if
(
caller_profile
->
times
->
progress_media
)
{
switch_time_exp_lt
(
&
tm
,
caller_profile
->
times
->
progress_media
);
switch_strftime
(
progress_media
,
&
retsize
,
sizeof
(
progress_media
),
fmt
,
&
tm
);
switch_channel_set_variable
(
channel
,
"progress_media_stamp"
,
progress_media
);
}
switch_time_exp_lt
(
&
tm
,
caller_profile
->
times
->
hungup
);
switch_strftime
(
end
,
&
retsize
,
sizeof
(
end
),
fmt
,
&
tm
);
switch_channel_set_variable
(
channel
,
"end_stamp"
,
end
);
...
...
@@ -1993,6 +2019,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
->
answered
);
switch_channel_set_variable
(
channel
,
"answer_uepoch"
,
tmp
);
tt_progress
=
(
time_t
)
(
caller_profile
->
times
->
progress
/
1000000
);
mtt_progress
=
(
time_t
)
(
caller_profile
->
times
->
progress
/
1000
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
TIME_T_FMT
,
tt_progress
);
switch_channel_set_variable
(
channel
,
"answer_epoch"
,
tmp
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
progress
);
switch_channel_set_variable
(
channel
,
"answer_uepoch"
,
tmp
);
tt_progress_media
=
(
time_t
)
(
caller_profile
->
times
->
progress_media
/
1000000
);
mtt_progress_media
=
(
time_t
)
(
caller_profile
->
times
->
progress_media
/
1000
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
TIME_T_FMT
,
tt_progress_media
);
switch_channel_set_variable
(
channel
,
"answer_epoch"
,
tmp
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
progress_media
);
switch_channel_set_variable
(
channel
,
"answer_uepoch"
,
tmp
);
tt_hungup
=
(
time_t
)
(
caller_profile
->
times
->
hungup
/
1000000
);
mtt_hungup
=
(
time_t
)
(
caller_profile
->
times
->
hungup
/
1000
);
...
...
src/switch_ivr.c
浏览文件 @
d3616deb
...
...
@@ -1583,6 +1583,19 @@ 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
->
profile_created
);
switch_xml_set_txt_d
(
time_tag
,
tmp
);
if
(
!
(
time_tag
=
switch_xml_add_child_d
(
x_times
,
"progress_time"
,
t_off
++
)))
{
goto
error
;
}
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
progress
);
switch_xml_set_txt_d
(
time_tag
,
tmp
);
if
(
!
(
time_tag
=
switch_xml_add_child_d
(
x_times
,
"progress_media_time"
,
t_off
++
)))
{
goto
error
;
}
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%"
SWITCH_TIME_T_FMT
,
caller_profile
->
times
->
progress_media
);
switch_xml_set_txt_d
(
time_tag
,
tmp
);
if
(
!
(
time_tag
=
switch_xml_add_child_d
(
x_times
,
"answered_time"
,
t_off
++
)))
{
goto
error
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论