VoIP.info Troubleshooting

Asterisk AMI Hangup is accepted but the wrong channel ends or no final event appears

Find the first divergence across target scope, channel lifetime, authority, cause semantics, request events, cleanup, event visibility and linked-leg outcomes.

Reviewed 2026-10-25Current branch-23-generated, Asterisk 22 and Certified Asterisk 22.8 Hangup action references, current HangupRequest, SoftHangupRequest and Hangup events, the official cause-mapping table, current CHANNEL, Asterisk 22 HANGUPCAUSE and the AMI v2 specification were reviewed October 25, 2026; installed release, manager authority, live channel identity, bridge topology, hangup handlers, dialplan ownership, channel technology, signaling, cause translation, event filters and downstream workflow remain deployment-specific; no PBX, manager session, action, regular expression, dialplan, channel, bridge, event stream, endpoint, packet, signaling exchange, media stream or live call was inspected or testedAdvancedDocumentation based · not lab tested

Freeze one request and one observed symptom

Record node, release, manager identity and permissions, ActionID, literal Channel field, exact Channel, Uniqueid, Linkedid, bridge peers, creation time, application, requested Cause, raw response, request events, final events, event filters, handler events and synchronized timestamps.

Classify the first symptom as unknown or denied action, no match, multiple matches, stale channel, wrong leg, accepted request with no final event, unexpected cause, linked leg surviving, handler delay or endpoint result mismatch. Do not combine several calls into one timeline.

Reject stale and overbroad targets first

Resolve the channel again immediately before the action and require the same Uniqueid. If the Channel field is a regular expression, enumerate every match at send time and stop if its scope is broader than the approved maintenance set.

Transfers, Local optimization, queue dialing and completed channels can invalidate a cached name. A successful response against a broad pattern does not establish which channels matched, and a caller number does not identify one channel lifetime.

Separate authorization from CLI-equivalent access

Confirm the dedicated Hangup action is present and the manager has only the required write authority. The AMI specification warns that Command authorization can execute CLI operations that overlap other action classes, including channel request hangup.

Do not grant Command or write=all to repair a denied Hangup action. Treat unavailable action, denied action and accepted action as different boundaries, and preserve the running manager configuration and action inventory rather than assuming a template is loaded.

Correlate request and final events by Uniqueid

Match the response by ActionID, then HangupRequest or SoftHangupRequest and final Hangup by exact Uniqueid. Preserve Cause, Cause-txt, TechCause and the event-filter state. A request event can precede dialplan cleanup and final disposal.

If no final event is visible, check whether the client filtered CALL events, disconnected, started listening late or followed the wrong replacement channel. Do not resend destructive Hangup requests merely because one observer missed an event.

Audit cause translation, handlers and every linked leg

Compare the requested numeric cause with the final Asterisk cause and technology-specific evidence without assuming a universal SIP result. Then inspect hangup-handler and h-extension execution on the exact channel, including any slow external dependency.

Inventory all channels sharing the Linkedid before and after the action. A surviving transfer, bridge peer or Local leg does not mean the selected Uniqueid survived; a final event for the selected leg does not prove the entire business call ended.

Repair only the first proved boundary and retest once

Correct only the demonstrated fault: stale identity, broad expression, missing authority, event filter, cause assumption, handler delay or call-flow owner. Retest on one disposable authorized call with a negative case and synchronized capture.

Use PJSIPHangup only when its documented incoming-PJSIP final-response semantics fit the call phase; do not swap it for generic Hangup by name alone. No PBX, manager session, action, regular expression, channel, event, endpoint, packet, signaling exchange, 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.