This commit is contained in:
Anthony Minessale committed 2012-10-23 18:19:32 -04:00
1 parent 7f46c7e290
commit 01dde19cbd
2 files changed
+59 -15

No files matched your search

@@ -79,6 +79,17 @@ static switch_status_t exec_app(switch_core_session_t *session, const char *app,
return status;
}
#define check_tz() tzoff = switch_channel_get_variable(channel, "tod_tz_offset"); \
do { \
if (!zstr(tzoff) && switch_is_number(tzoff)) { \
offset = atoi(tzoff); \
} else { \
tzoff = NULL; \
} \
break; \
} while(tzoff)
static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t xexten, switch_caller_extension_t **extension)
{
switch_xml_t xcond, xaction, xexpression, xregex;
@@ -88,13 +99,10 @@ 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 = switch_channel_get_variable(channel, "tod_tz_offset");
const char *tzoff;
check_tz();
if (!zstr(tzoff) && switch_is_number(tzoff)) {
offset = atoi(tzoff);
} else {
tzoff = NULL;
}
if (!exten_name) {
exten_name = "_anon_";
@@ -109,8 +117,11 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
int ovector[30];
switch_bool_t anti_action = SWITCH_TRUE;
break_t do_break_i = BREAK_ON_FALSE;
int time_match;
check_tz();
time_match = switch_xml_std_datetime_check(xcond, tzoff ? &offset : NULL);
int time_match = switch_xml_std_datetime_check(xcond, tzoff ? &offset : NULL);
switch_safe_free(field_expanded);
switch_safe_free(expression_expanded);
@@ -161,8 +172,9 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
switch_channel_del_variable_prefix(channel, "DP_REGEX_MATCH");
for (xregex = switch_xml_child(xcond, "regex"); xregex; xregex = xregex->next) {
check_tz();
time_match = switch_xml_std_datetime_check(xregex, tzoff ? &offset : NULL);
if (time_match == 1) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_DEBUG,
"Dialplan: %s Date/Time Match (PASS) [%s]\n",