What callers get
-
Open hours
Monday to Friday, 9 a.m. to 5 p.m. Eastern, calls ring reception.
-
After hours and weekends
Outside those hours, callers hear that the office is closed and when it opens.
-
Holidays by name
New Year’s Day, Independence Day, and Christmas fall on the same date every year; Memorial Day, Labor Day, and Thanksgiving are listed by date. Callers hear which holiday it is.
-
An early close
On Christmas Eve the office closes at noon instead of 5.
-
The office’s own time zone
Every check uses Eastern time, wherever the caller is, and daylight saving time is handled by the time zone name.
Before you start
- A VoiceML account with a phone number. See VoiceML or start a free trial.
- The number that should ring during open hours, your office’s time zone as an IANA name such as
America/Chicago, and your holiday dates.
The reception number in this document is fictional. It uses the 555-0100 to 555-0199 range, which is set aside for fiction. Replace it with a real number before you publish.
Step 1: Publish the document and point the number at it
Change the time zone, hours, holidays, and reception number to your own. Then publish it at voiceml.org and set the /r/ URL it returns as the phone number’s voice URL. Keep the URL exactly as returned, key included. The key is a shared secret, so don’t post the URL publicly.
main.xml
<Response>
{% comment %} Every date and time is read in the office's time zone. {% endcomment %}
{% assign tz = "America/New_York" %}
{% assign today = "now" | date: "%Y-%m-%d", tz %}
{% assign monthday = "now" | date: "%m-%d", tz %}
{% assign weekday = "now" | date: "%u", tz | plus: 0 %}
{% assign time = "now" | date: "%H%M", tz | plus: 0 %}
{% comment %} Holidays on the same date every year {% endcomment %}
{% case monthday %}
{% when "01-01" %}{% assign holiday = "New Year's Day" %}
{% when "07-04" %}{% assign holiday = "Independence Day" %}
{% when "12-25" %}{% assign holiday = "Christmas Day" %}
{% endcase %}
{% comment %} Holidays that move: list each year's date {% endcomment %}
{% case today %}
{% when "2026-05-25", "2027-05-31" %}{% assign holiday = "Memorial Day" %}
{% when "2026-07-03" %}{% assign holiday = "Independence Day" %}
{% when "2026-09-07", "2027-09-06" %}{% assign holiday = "Labor Day" %}
{% when "2026-11-26", "2027-11-25" %}{% assign holiday = "Thanksgiving" %}
{% endcase %}
{% comment %} Opening hours as HHMM; Christmas Eve closes at noon {% endcomment %}
{% assign opens = 900 %}
{% assign closes = 1700 %}
{% if monthday == "12-24" %}{% assign closes = 1200 %}{% endif %}
<Say>Thank you for calling Dunder Mifflin Paper Company, Scranton branch.</Say>
{% if holiday %}
<Say>Our office is closed today for {{ holiday }}. We will reopen on the next business day at 9 a.m. Eastern.</Say>
<Hangup/>
{% elsif weekday >= 6 %}
<Say>Our office is closed for the weekend. Even Dwight has gone home to the beet farm. Our hours are 9 a.m. to 5 p.m. Eastern, Monday through Friday.</Say>
<Hangup/>
{% elsif time < opens or time >= closes %}
<Say>Our office is closed. Our hours are 9 a.m. to 5 p.m. Eastern, Monday through Friday. Dwight Schrute, Assistant to the Regional Manager, asks that you do not call him at home.</Say>
<Hangup/>
{% else %}
<Say>Please hold while we connect you to reception.</Say>
<Dial timeout="25" ringTone="us">
<Number>+15705550100</Number>
</Dial>
<Say>Thank you for calling Dunder Mifflin. Goodbye.</Say>
<Hangup/>
{% endif %}
</Response>
Step 2: Test it
Call during your open hours and reception rings. To hear the closed message without waiting for the evening, change tz to a time zone where the office would be closed right now, such as Asia/Tokyo during a US workday, publish that copy, and point the number at it. Point the number back at the real document when you’re done.
How the schedule works
"now" | date: "%H%M", tz formats the moment the call arrives as hours and minutes in the office’s time zone, such as 0930, and | plus: 0 turns it into the number 930, so it can be compared with the opening and closing times. The document reads four values this way:
| Variable | Format | Example | Used for |
|---|---|---|---|
today | %Y-%m-%d | 2026-11-26 | Holidays that move from year to year |
monthday | %m-%d | 12-25 | Holidays on the same date every year, and the early close |
weekday | %u | 6 | Weekends: 1 is Monday and 7 is Sunday |
time | %H%M | 930 | Opening and closing times |
Two {% case %} blocks set holiday to the holiday’s name when today matches a date. The checks then run in order, and the first that applies decides the call: a holiday, then a weekend, then a time outside the opening hours. Only a call that passes all three rings reception. In 2026, Independence Day falls on a Saturday, so the office closes on Friday, July 3, which is listed as its own date.
Where the show turns up
| Where | Reference |
|---|---|
| The greeting | Dunder Mifflin Paper Company, Scranton branch. |
| After hours | Dwight Schrute, Assistant to the Regional Manager, who would rather you didn’t call him at home. |
| Weekends | Dwight’s family beet farm. |
Limits of this design
- Moving holidays need a yearly update. The document lists Memorial Day, Labor Day, and Thanksgiving for 2026 and 2027. Add each new year’s dates, and any weekday a weekend holiday is observed on, then publish again.
- Every change is a new document. Published documents can’t be edited, so a new holiday or new hours means publishing again and pointing the number at the new URL.
- The time is read once, when the call arrives. A caller who is still on hold at closing time stays connected.
- Closed callers can’t leave a message. To take voicemail after hours, add a
<Record>to the closed branches, as the PBX example does.
Credits
- Dunder Mifflin, its Scranton branch, and Dwight Schrute come from The Office (NBC, 2005–2013), developed by Greg Daniels from the British series created by Ricky Gervais and Stephen Merchant. Rainn Wilson plays Dwight Schrute; Steve Carell, John Krasinski, and Jenna Fischer play Michael Scott, Jim Halpert, and Pam Beesly.
- The branch’s hours, holidays, and phone number are fictional in this example. VoiceTel is not affiliated with the show or its rights holders.
- References: the voiceml.org publishing and integration guide, whose Liquid cookbook covers the date filter and time zones, and the VoiceML language reference.

