Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
a4a44fb1
提交
a4a44fb1
authored
10月 31, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-4741 parse timezone variable and adjust time for time based routing
上级
c50336b1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
25 行增加
和
6 行删除
+25
-6
switch_xml.h
src/include/switch_xml.h
+1
-1
mod_sms.c
src/mod/applications/mod_sms/mod_sms.c
+17
-1
mod_dialplan_xml.c
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
+4
-3
switch_xml.c
src/switch_xml.c
+3
-1
没有找到文件。
src/include/switch_xml.h
浏览文件 @
a4a44fb1
...
...
@@ -423,7 +423,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function_ptr(_In_ switc
///\return the section mask
SWITCH_DECLARE
(
switch_xml_section_t
)
switch_xml_parse_section_string
(
_In_opt_z_
const
char
*
str
);
SWITCH_DECLARE
(
int
)
switch_xml_std_datetime_check
(
switch_xml_t
xcond
,
int
*
offset
);
SWITCH_DECLARE
(
int
)
switch_xml_std_datetime_check
(
switch_xml_t
xcond
,
int
*
offset
,
const
char
*
tzname
);
SWITCH_DECLARE
(
switch_status_t
)
switch_xml_locate_language
(
switch_xml_t
*
root
,
switch_xml_t
*
node
,
switch_event_t
*
params
,
switch_xml_t
*
language
,
switch_xml_t
*
phrases
,
switch_xml_t
*
macros
,
const
char
*
str_language
);
...
...
src/mod/applications/mod_sms/mod_sms.c
浏览文件 @
a4a44fb1
...
...
@@ -64,6 +64,16 @@ typedef enum {
}
break_t
;
#define check_tz() tzoff = switch_event_get_header(event, "tod_tz_offset"); \
tzname = switch_event_get_header(event, "timezone"); \
do { \
if (!zstr(tzoff) && switch_is_number(tzoff)) { \
offset = atoi(tzoff); \
} else { \
tzoff = NULL; \
} \
break; \
} while(tzoff)
static
int
parse_exten
(
switch_event_t
*
event
,
switch_xml_t
xexten
,
switch_event_t
**
extension
)
{
...
...
@@ -73,6 +83,10 @@ static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_
char
*
expression_expanded
=
NULL
,
*
field_expanded
=
NULL
;
switch_regex_t
*
re
=
NULL
;
const
char
*
to
=
switch_event_get_header
(
event
,
"to"
);
const
char
*
tzoff
=
NULL
,
*
tzname
=
NULL
;
int
offset
=
0
;
check_tz
();
if
(
!
to
)
{
to
=
"nobody"
;
...
...
@@ -90,8 +104,10 @@ static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_
int
ovector
[
30
];
switch_bool_t
anti_action
=
SWITCH_TRUE
;
break_t
do_break_i
=
BREAK_ON_FALSE
;
int
time_match
;
int
time_match
=
switch_xml_std_datetime_check
(
xcond
,
NULL
);
check_tz
();
time_match
=
switch_xml_std_datetime_check
(
xcond
,
tzoff
?
&
offset
:
NULL
,
tzname
);
switch_safe_free
(
field_expanded
);
switch_safe_free
(
expression_expanded
);
...
...
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
浏览文件 @
a4a44fb1
...
...
@@ -81,6 +81,7 @@ static switch_status_t exec_app(switch_core_session_t *session, const char *app,
#define check_tz() tzoff = switch_channel_get_variable(channel, "tod_tz_offset"); \
tzname = switch_channel_get_variable(channel, "timezone"); \
do { \
if (!zstr(tzoff) && switch_is_number(tzoff)) { \
offset = atoi(tzoff); \
...
...
@@ -99,7 +100,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
char
*
expression_expanded
=
NULL
,
*
field_expanded
=
NULL
;
switch_regex_t
*
re
=
NULL
,
*
save_re
=
NULL
;
int
offset
=
0
;
const
char
*
tzoff
;
const
char
*
tzoff
=
NULL
,
*
tzname
=
NULL
;
check_tz
();
...
...
@@ -120,7 +121,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
int
time_match
;
check_tz
();
time_match
=
switch_xml_std_datetime_check
(
xcond
,
tzoff
?
&
offset
:
NULL
);
time_match
=
switch_xml_std_datetime_check
(
xcond
,
tzoff
?
&
offset
:
NULL
,
tzname
);
switch_safe_free
(
field_expanded
);
...
...
@@ -173,7 +174,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
for
(
xregex
=
switch_xml_child
(
xcond
,
"regex"
);
xregex
;
xregex
=
xregex
->
next
)
{
check_tz
();
time_match
=
switch_xml_std_datetime_check
(
xregex
,
tzoff
?
&
offset
:
NULL
);
time_match
=
switch_xml_std_datetime_check
(
xregex
,
tzoff
?
&
offset
:
NULL
,
tzname
);
if
(
time_match
==
1
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG_CLEAN
(
session
),
SWITCH_LOG_DEBUG
,
...
...
src/switch_xml.c
浏览文件 @
a4a44fb1
...
...
@@ -2883,7 +2883,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_cut(switch_xml_t xml)
return
xml
;
}
SWITCH_DECLARE
(
int
)
switch_xml_std_datetime_check
(
switch_xml_t
xcond
,
int
*
offset
)
SWITCH_DECLARE
(
int
)
switch_xml_std_datetime_check
(
switch_xml_t
xcond
,
int
*
offset
,
const
char
*
tzname
)
{
const
char
*
xdt
=
switch_xml_attr
(
xcond
,
"date-time"
);
...
...
@@ -2921,6 +2921,8 @@ SWITCH_DECLARE(int) switch_xml_std_datetime_check(switch_xml_t xcond, int *offse
if
(
offset
)
{
eoffset
=
*
offset
;
switch_time_exp_tz
(
&
tm
,
ts
,
*
offset
*
3600
);
}
else
if
(
!
zstr
(
tzname
))
{
switch_time_exp_tz_name
(
tzname
,
&
tm
,
ts
);
}
else
{
tm
=
tm2
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论