Time Conditions (GoToIfTime) across years

Hi All,
I’ve been having some trouble with time-based routing lately. From what I can tell, one of our GoToIfTime conditions is jumping incorrectly.
The time condition is question is as follows:

The time condition appears to be triggering at the moment (14:00 02/01/2013) however it should have stopped at 09:00 this morning.

Is this the correct behavior for my rule when spanning over two years, or is this a bug?


The code treats the fields separately, so the matching of time of day will not be affected by any year wrap-round. This also means that you will get a true out of the test between 13:00 an 23:59 today.

Are you sure you have the right timezone? Times are processed in the local timezone of the Asterisk process.

Note that “|” is not a documented separator, although it was still supported in at least some versions after the official change to “,”.

Hi David,
If the fields are treated separately, that would explain why they are triggering incorrectly.
Is there any way of requiring all of the fields to match before the jump?

They do all have to match, but not treated as a single time range. It’s basically the same logic as Unix cron, but with wraparounds.

Any time between 13:00 and midnight and between midnight and 09:00 will match, if the day is any of 31, 1 or 2, and the month is January or December.

Dec 31 00:00 to 09:01:59
Dec 31 13:00 to 23:59:59
Dec 01 00:00 to 09:01:59
Dec 01 13:00 to 23:59:59
Dec 02 00:00 to 09:01:59
Dec 02 13:00 to 23:59:59
Jan 31 00:00 to 09:01:59
Jan 31 13:00 to 23:59:59
Jan 01 00:00 to 09:01:59
Jan 01 13:00 to 23:59:59
Jan 02 00:00 to 09:01:59
Jan 02 13:00 to 23:59:59

Hi Dave,
That makes sense now, thanks for your help