Use an absolute epoch only when this channel should remain waiting
WaitUntil(epoch) waits until the current time reaches the supplied Unix epoch. The argument is an absolute target, not a number of seconds to delay and not a detached job-scheduler request. Confirm that keeping this exact channel and dialplan path alive is intended before selecting it.
For a long wait, document caller treatment, channel and bridge occupancy, cancellation behavior and what should happen if the call ends first. Those are deployment design questions derived from holding an active channel, not laboratory findings about a particular PBX.
Convert civil time once with an explicit timezone and format
An epoch identifies an instant without carrying a timezone. Timezone and format become material when a human date or time is converted to that epoch or when the epoch is displayed. Asterisk documents STRPTIME(datetime,timezone,format) for parsing a date-time string and STRFTIME(epoch,timezone,format) for formatting an epoch.
Record the original civil-time string, explicit zone, format, resulting epoch and conversion timestamp. Daylight-saving gaps or duplicated local times are conversion-boundary questions; do not describe WaitUntil() itself as choosing a timezone or resolving an ambiguous local time.
Validate the target before entering the wait
Reject missing, malformed or policy-invalid input before invoking the application, and log a privacy-safe representation of the target. Compare the epoch with a captured current time and define an allowed future window so a stale or unit-mismatched value does not unexpectedly enter the call path.
Do not infer that every PAST result is an application error. The current reference defines PAST specifically for a target time that has already passed. A correct past-time classification, a bad civil-time conversion and an invalid application argument remain separate findings.
Keep WaitUntil separate from the channel absolute timeout
TIMEOUT(absolute) sets the maximum time permitted for the call in seconds; setting it to zero disables that timeout. WaitUntil() instead accepts a target epoch. A seconds-based call-lifetime ceiling and an absolute wall-clock target are different controls and can both affect one run.
Record the existing absolute timeout before the wait and the intended relationship between the two. Do not “fix” a wait by disabling a safety timeout without separately reviewing the call-lifetime policy. The digit and response timeout types govern digit collection and are not alternative epoch schedulers.
Design explicitly for hangup and clock uncertainty
The documented HANGUP status means the channel ended before the target time elapsed. Treat that as a channel-lifecycle outcome rather than proof that the scheduler failed. Put any required external cleanup or durable work under its own authorized and observable contract.
Host clock synchronization, the source of the epoch and behavior during clock correction remain deployment specific. Capture the clock source and relevant before-and-after timestamps when timing accuracy matters; this guide makes no universal monotonicity or precision claim.
Branch on status, then verify the downstream action
The generated reference documents WAITUNTILSTATUS values OK, FAILURE, HANGUP and PAST. Preserve the value immediately after the application on the channel that ran it. FAILURE identifies an invalid argument, while OK identifies a completed wait under the application contract.
Application return does not prove that a later playback, call, alert, bridge or caller outcome succeeded. Test authorized future, exact-boundary, past, invalid and hangup cases with bounded timing and rollback. No host, module, dialplan, channel, epoch source, timezone database, clock, packet, scheduler or live call was inspected or tested for this guide.
Sources & applicability
Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.
- Asterisk 23 WaitUntil application ↗
- Asterisk 22 WaitUntil application ↗
- Asterisk 23 TIMEOUT function ↗
- Asterisk 23 STRFTIME function ↗
- Asterisk 23 STRPTIME function ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.