Time Group Checker · for Asterisk-based PBXes

Asterisk accepted your time group. That doesn't mean it does what you meant.

Every combination here is valid Asterisk, and some of them route calls on days nobody intended. Build or paste your entries and see every day and hour they actually match.

    Days it matches

    Hours in a typical week

    calls match

    Week days and times only; month day and month are left out here. Asterisk counts the finish minute, so a finish of 17:00 still matches until 17:00:59.

    Time group mistakes and rules that work

    Common mistakes

    Each one loads into the tool with an explanation and, where possible, a fix.

    Rules that work

    Including holidays that move but never need editing.

    Traps a single entry can't show

    Trap

    Holidays in the business hours group

    Entries in one time group add up: a call matches if any entry matches. Add Dec 25 to the group that means "open" and the office is open all day on Dec 25, even when it falls on a Sunday. Holidays belong in their own group, on their own time condition.

    Trap

    The holiday check comes second

    A holiday time condition only works if calls reach it. Put it before the business hours time condition in the call flow. Placed after, callers on a weekday holiday are already sent to "open".

    Trap

    A forgotten override

    A time condition can be forced open or closed with a feature code, a BLF key or the admin page. A permanent override ignores the schedule until someone resets it, so a perfect time group changes nothing. A temporary one clears itself once the schedule reaches the state it forced.

    Note

    Whose clock?

    Times are checked against the PBX's timezone, or the one set on the time condition, not your office's. A hosted PBX in another timezone runs every entry shifted by the difference.

    FreePBX and VitalPBX time condition questions

    Why does my FreePBX or VitalPBX time condition send calls to the wrong destination?

    Usually the time group matches something other than what its entries look like. Asterisk accepts every combination, so nothing warns you. The usual causes: the finish minute counts, a time range crosses midnight on only some week days, a date range crosses into another month, holidays sit in the business hours group, the holiday time condition comes after the business hours one, someone left a permanent override on, or the PBX runs in a different timezone. Paste your entries into the tool above and it flags the ones that live in the entries. The rest are under "Traps a single entry can't show".

    Why is my FreePBX time condition still open at 17:00?

    Asterisk counts the finish minute. 08:00-17:00|mon-fri|*|* matches until 17:00:59, so a caller at 17:00:30 still reaches the open branch. To close at 17:00 exactly, finish at 16:59: 08:00-16:59|mon-fri|*|*.

    How do I make a VitalPBX or FreePBX time group that goes past midnight?

    If every week day is allowed, a wrapped range like 17:00-09:00|*|*|* covers the whole night. Limit the week days and it stops working, because Asterisk checks the time and the week day separately. 22:00-02:00|fri|*|* matches Friday from 22:00 to 23:59 and Friday from 00:00 to 02:00, but not Saturday morning. Split it in two: 22:00-23:59|fri|*|* and 00:00-02:00|sat|*|*.

    How do I close from Friday evening to Monday morning in FreePBX or VitalPBX?

    17:00-08:00|fri-mon|*|* looks like one stretch, but Asterisk applies 17:00 to 08:00 to each day from Friday to Monday on its own. Saturday and Sunday don't match during the day, and Friday morning and Monday evening do. One stretch takes three entries: 17:00-23:59|fri|*|*, *|sat-sun|*|* and 00:00-07:59|mon|*|*.

    How do I add a holiday closure across the new year, like Dec 24 to Jan 2, in FreePBX or VitalPBX?

    Not as one entry. *|*|24-2|dec-jan saves the days and the months as two separate ranges, and Asterisk matches the day range inside every month in the month range, so it also catches Dec 1 to 2 and Jan 24 to 31. Use one entry per month: *|*|24-31|dec and *|*|1-2|jan. Keep holidays in their own time group, on a time condition that calls reach before the business hours one.

    How do I match the last day of the month in a VitalPBX time group?

    Asterisk has no "last day of the month", and *|*|31|* only matches in the seven months that have a 31st. It takes seven entries: *|*|31|*, the 30th in April, June, September and November (*|*|30|apr and so on), and *|*|28|feb plus *|*|29|feb. In a leap year Feb 28 matches too.

    How do I add Thanksgiving or another holiday that moves to a FreePBX or VitalPBX time group?

    Pair one week day with a seven-day range of month days. The 4th Thursday in November always falls between the 22nd and the 28th, so Thanksgiving is *|thu|22-28|nov. The first Monday of every month is *|mon|1-7|*. The date moves every year and the entry never needs editing. For the last Monday of a 31-day month use the 25th to the 31st, so Memorial Day is *|mon|25-31|may. In a 30-day month use the 24th to the 30th.

    Can a FreePBX or VitalPBX time group close for one date in one year only?

    No. There is no year field, so *|*|3|mar matches March 3 every year. Delete the entry once the date has passed. If that might get forgotten, also set the week day that date falls on. The entry then stays quiet until a year when that date lands on the same week day again, and the tool shows you which year that is.

    Why does my FreePBX time condition only match for one minute?

    If you set a start time and leave the finish time blank, FreePBX saves the start time as both the start and the finish. 09:00|mon-fri|*|* matches the single minute 09:00, not "from 09:00 on". Set a finish time.

    What format do Asterisk GotoIfTime() and FreePBX time groups use?

    Four fields: time, week day, month day and month. FreePBX saves a time group entry with pipes between them, like 08:00-17:00|mon-fri|*|*. GotoIfTime() takes the same four fields separated by commas, with an optional timezone after them. * matches anything. Ranges include both ends and wrap around, so fri-mon and 28-3 both work. The finish minute counts through :59, and there is no year.

    Why does my VitalPBX or FreePBX time condition switch at the wrong hour?

    Times are checked against the PBX's timezone, or the one set on the time condition, not your office's. A hosted PBX in another timezone runs every entry shifted by the difference.

    Every example, every fix and 400 random entries (65,402 dated checks) were run through Asterisk's own GotoIfTime() on Asterisk 13, 20 and 22, and matched this page on every one. Ranges wrap around, the four fields are checked separately, and the finish minute counts through :59. The saved text was checked against FreePBX 14 and 17's own save code.
    Call Flow Studio draws your time conditions into the live call flow, and lets you pick any date and time to see which branch a call takes. See how it works