Skip to content
Phone Guides

Asterisk time, holiday and timezone routing

Define whose local time controls the route and which rule wins when schedules overlap. A weekly opening-hours rule does not automatically know your organisation's holidays, temporary closures or after-hours service arrangement.

Source-reviewed, 18 October 2026. Prepared from the cited documentation. These examples have not been independently tested by Phone Guides. Scope: Asterisk 22 file-based dialplans and an OS with the required timezone data.

State the schedule in ordinary language

Record the timezone, days, opening interval, exceptional closures, destination during each state and owner of changes. For multiple sites, keep each site's timezone and exceptions separate. Do not equate the server's clock display with the business's desired local time.

Rule Decision to record
Weekly hours Exact days, interval and timezone
Holiday or special closure Source, date, precedence and expiry
Temporary override Who may set it and when it is removed
Open route Intended menu, queue or extension
Closed route Intended message, voicemail or other bounded destination

Use a current authoritative calendar for the relevant location when entering holiday data. A configuration example does not establish which dates apply to your organisation.

Read a weekly-hours example

This original illustration uses Sydney time and sends the open branch to the auto attendant. The closed branch deliberately ends the call:


[pg-hours]
exten => s,1,GotoIfTime(09:00-16:59,mon-fri,*,*,Australia/Sydney?open:closed)
 same => n(open),Goto(pg-menu,s,1)
 same => n(closed),Hangup()

The example expresses minutes 09:00 through 16:59 on Monday-Friday. It contains no holiday exception or closed-hours announcement. Add the intended caller treatment before using it as a business incoming route.

The Asterisk 22 GotoIfTime reference documents the time fields, optional timezone and true/false destinations. The timezone identifier must be available on the actual OS. Keep the system clock and timezone data maintained through that OS's supported process.

Put exceptions before the general rule

If a closure overrides a normal Monday, evaluate the closure rule before the weekly open rule. Record the exact date/year handling and what happens when an exception expires. Avoid adding a permanent annual match for a closure that was intended to happen once.

If using an external calendar or database, decide the fallback when it is unavailable. A missing lookup result should not silently grant an unintended open route. Keep time routing separate from calling permissions: switching to an after-hours context must not make paid calling available to an incoming caller.

Review the edge cases

Inspect the loaded context and every destination label after a file-based reload. For your own checks, include the minute before opening, opening, the final open minute, closing, a weekend and a closure that falls on a working day. Include the relevant daylight-saving transition and any other site timezone.

Do not change the production host clock merely to simulate a schedule. Use an appropriate controlled verification method and record what it establishes. Phone Guides has not performed these execution checks.

Preserve the old route and prompt when changing the schedule. A published opening-hours statement, a calendar entry and the live route should agree; identify an owner for resolving disagreements. See contexts and patterns and routing. Return to Asterisk documentation.