mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 21:38:34 +00:00
FS-4741 parse timezone variable and adjust time for time based routing
This commit is contained in:
1 parent
c50336b1f8
commit
a4a44fb140
4 files changed
+25
-6
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user