Capture one wait, expression, timeline and status
Record timestamp and timezone, installed Asterisk branch, channel identity, context, extension, priority, exact loaded application arguments, mutable-state owner, writer, start time, relevant writer time, return time, immediate WAITFORCONDITIONSTATUS, next priority and caller-visible result. Redact secrets and caller data.
Classify the symptom as timeout, early TRUE, FAILURE, HANGUP, no return, missing status or correct return followed by wrong downstream behavior. Do not group all of them under polling delay.
Prove the installed application and loaded dialplan
Confirm the running system exposes WaitForCondition() and inspect its local help. Then prove that the active dialplan entered the expected context, extension and priority with the intended replacement character, expression, timeout and interval. A source-file edit or generated configuration fragment is not proof that the loaded dialplan executed it.
If the application, generated syntax or target priority differs, correct that boundary before changing variables or timing. Keep upstream documentation, installed help, loaded dialplan and one observed run separately labelled.
Determine whether the expression was deferred or pre-evaluated
Inspect the exact argument that reached the application. Verify that the replacement character stands in for $, does not appear elsewhere in the expression, and survives every configuration or templating layer. Compare the value visible at application entry with the value written later.
If runtime substitution collapsed the expression before polling began, the application can repeatedly test only that initial result. Repair quoting or replacement first. Do not compensate for a frozen expression with a longer timeout or faster interval.
Trace variable, global or shared-state ownership
Identify the exact object read by the expression and the exact object written by the producer. Channel variables, inherited variables, globals, SHARED state, AstDB and function-backed values have different scope and concurrency properties. Use VARIABLE_EXISTS() only for channel-variable presence and GLOBAL_EXISTS() only for global-variable presence when the installed version provides them.
Record writer channel, value, correlation key and timestamp. A similarly named value on another channel is not the same state. If cross-channel coordination is required, use one documented shared owner and protect any multi-step invariant rather than relying on naming coincidence.
Recalculate timeout, interval and repeated work
Write timeout and interval in seconds, compare them with observed start and return times, and account for the expected writer latency. The current generated reference documents a 0.05-second default interval and no timeout by default, but a production call path should use an explicit bound.
Inspect every function inside the expression. Repeated evaluation can multiply database, network or custom-function work, especially at a short interval. Treat cost and side effects as function-specific deployment evidence. A slow or failing lookup, wrong owner and genuinely false condition require different corrections.
Fix the first proved owner and test the status matrix
Correct only the first demonstrated divergence: application availability, loaded syntax, replacement character, expression, state owner, writer, existence test, truth comparison, function behavior, interval, timeout or result branch. Preserve rollback and remove temporary high-volume logging.
Repeat bounded true, timeout, failure and hangup cases as authorized, logging the immediate status and next executed priority. Accept the condition result separately from downstream application and caller outcome. No host, module, dialplan, channel, variable, global, function, poll, packet or live call was inspected or tested for this diagnostic.
Sources & applicability
Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.
- Asterisk 23 WaitForCondition application ↗
- Asterisk 22 WaitForCondition application ↗
- Asterisk dialplan expressions ↗
- Asterisk conditional applications ↗
- Asterisk 23 VARIABLE_EXISTS function ↗
- Asterisk 23 GLOBAL_EXISTS function ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.