VoIP.info Troubleshooting

Asterisk AMI Getvar or Setvar is wrong, blank or missing a VarSet event

Trace manager framing, ActionID, exact channel lifetime, variable namespace, function policy, event filters and the later consumer before changing the dialplan.

Reviewed 2026-10-19Current branch-23 AMI Getvar, Setvar and VarSet references, channel-variable setting and inheritance guidance, global and shared-variable documentation, external-protocol function safeguards and AMI event filtering were reviewed October 19, 2026. Installed branch, manager permissions, channel lifetime, variable namespace, function availability, event selection, dialplan ownership and application outcomes remain deployment specific. No PBX, manager account, session, channel, variable, function, event, dialplan, packet, media stream or live call was inspected or testedAdvancedDocumentation based · not lab tested

Freeze one action and expected consumer

Record timestamp and timezone, Asterisk node and branch, manager user and connection, ActionID, action, exact Channel header or its deliberate omission, Variable, redacted Value, response, VarSet observation, a fresh Getvar result, channel Uniqueid and Linkedid, and the dialplan or application expected to consume the value.

Classify the first symptom: malformed or timed-out action, permission denial, missing channel, wrong scope, blank or unexpected read, blocked function, accepted write with no event, event with the wrong channel, child did not inherit, shared/global race, or correct variable with the wrong downstream outcome.

Prove framing, response correlation and authority

Confirm header: value framing and the terminating empty line, then match the response by ActionID. Verify the authenticated manager identity and the live action inventory before changing manager.conf. An AMI login does not prove authority to use every action.

Do not log secrets or broad variable dumps. Constrain the manager account, network reachability, action classes and application inputs to the smallest required scope.

Resolve the target at action time

If Channel is absent, test the expected global variable explicitly; do not interpret a global read as a failed channel read. If it is present, resolve the exact live channel and correlate Uniqueid and Linkedid. Check for hangup, rename, Local-channel optimization, transfer or replacement between channel discovery and the action.

Repeat a read on the exact channel and a deliberately different control channel. A familiar endpoint label or partial name is not sufficient channel identity.

Distinguish variables from functions and namespaces

Inspect the literal target: ordinary variable, _ or __ inheritance marker, GLOBAL(), SHARED(), LOCAL() or another dialplan function. For a function, confirm that its module is loaded, it supports the requested read or write, its arguments are correct and external execution is permitted without enabling unsafe compatibility behavior.

For inheritance, place the parent write before child creation and inspect both sides. For shared or global state, test concurrent writers and protect any read-modify-write sequence; a later correct value can hide an earlier race.

Explain a missing VarSet event independently

Keep the synchronous Setvar response separate from asynchronous events. Verify session event selection, read classes and configured filters, including exact case for the VarSet event name. The current filtering guide supports name and header matching; a filter that includes only other event types can suppress VarSet while the write succeeds.

Compare with a controlled write whose event is safe to observe, then issue a fresh Getvar. An event proves a reported change, not that every connected manager received it or that the business workflow succeeded.

Correct the earliest boundary and retest the consumer

Correct only the first demonstrated divergence: message framing, ActionID handling, manager authority, missing or stale channel, global-versus-channel scope, variable spelling, inheritance timing, function syntax or policy, event mask or filter, concurrency, or downstream dialplan logic. Avoid changing manager permissions, dialplan and event filters together.

Retest set, response, event where expected, fresh get, child inheritance if relevant and the intended dialplan branch. Confirm teardown so call-scoped data is not mistaken for durable state. No PBX, manager account, session, channel, variable, function, event, dialplan, packet, media stream or live call was inspected or tested.

Sources & applicability

Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.

Examples require adaptation to your topology. No live PBX or hardware testing is claimed.