[Home]

Summary:ASTERISK-22616: timestring set by TESTTIME is ignored by IFTIME as well as GotoIfTime
Reporter:Olaf Winkler (abw1oim)Labels:
Date Opened:2013-09-30 10:02:05Date Closed:2013-09-30 14:44:42
Priority:MinorRegression?
Status:Closed/CompleteComponents:PBX/General
Versions:1.8.23.1 11.5.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:When using TESTTIME it's expected, that the TIME-functions will honor the value and make the correct decision which may be different from the one valid for server-time.
Unfortunately the test seems to ignore TESTTIME:

ServerTime is in CEST (GMT+2) and the following snippet is executed between 14:00 GMT and 15:00 GMT:
{noformat}
Set(LTZ=Europe/London);
Set(datewithtz=${STRFTIME(${EPOCH},${LTZ},%Y/%m/%d %H:%M:%S)});
Set(TESTTIME=${datewithtz});
ifTime(08:00-16:00|*|*|*) {
     NoOp(fitted);
} else {
     NoOp(NOT fitted);
}
{noformat}

For local time (without TESTTIME) its correct to have the "NOT fitted" output. But I would expect to have the "fitted" output here as the TESTTIME ist one hour less (GMT+1).
Comments:By: Michael L. Young (elguero) 2013-09-30 14:30:40.494-0500

We require a complete debug log to help triage the issue. This document will provide instructions on how to collect debugging logs from an Asterisk machine for the purpose of helping bug marshals troubleshoot an issue: https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information



By: Michael L. Young (elguero) 2013-09-30 14:42:22.433-0500

Olaf,

Please check the syntax.  You are not using the right date format and you are not setting the time argument correctly (no comma between date and time).

From the docs:
{noformat}
[Syntax]
TESTTIME(date,time[,zone])

[Arguments]
date
   Date in ISO 8601 format
time
   Time in HH:MM:SS format (24-hour time)
zone
   Timezone name
{noformat}

By: Michael L. Young (elguero) 2013-09-30 14:44:42.113-0500

Closing this out as not a bug since it appears that this is a configuration problem.

If you find that there is still a bug after insuring your configuration is correct, you can always ask a bug-marshal to re-open this issue.

By: Olaf Winkler (abw1oim) 2013-09-30 15:48:46.780-0500

I don't understand the clue (and I've read the documentation as well as the ISO as well as the intention of the function). Lets assume a simple example:

{noformat}
Set(TESTTIME=2013-12-30,21:30:00,Europe/London);
if (${IFTIME(08:00-22:00,*,*,dec,Europe/London?1:0)}=1) {
NoOp(OK, TESTTIME used);
} else {
NoOp(NOK, TESTTIME not used);
}
{noformat}

Assuming the actual month is sep(tember) the IFTIME-condition should be false whenever using of TESTTIME fails. If TESTTIME is used (as expected) the IFTIME-condition should give true and we should end up in our OK.
Unfortunately I get a NOK, which I - after all - still don't understand and consider to be a bug. Or am I still missing something really simple ????

By: Michael L. Young (elguero) 2013-09-30 16:43:28.927-0500

Olaf,

The issue tracker is not for configuration questions.  You should ask on the asterisk-users list or on the IRC channel.

I still see some syntax problems even with your basic example.  To be honest, I am not very familiar with AEL.  It looks like you are not using the TESTTIME function properly.

This probably should be:

{noformat}
Set(TESTTIME()=2013-12-30,21:30:00,Europe/London);
{noformat}

For further help, please go to the asterisk-users mailing list or IRC.  If the community determines it is a bug, you can then ask to have this issue re-opened.

Thanks