Freeze one Local-channel chronology
Record installed branch, dial string and modifiers, both Local halves, stable IDs, linked ID, source and destination channels, bridge IDs, LocalBridge, manager request and response, correlated Begin and End events, final bridge membership, variables, recording state and caller-visible result.
Classify the first symptom: expected optimization, unexpected disappearance, no Begin event, Begin without End, unsuccessful End, stale channel target, variable or feature loss, bridge mismatch, recording discontinuity or one-way audio.
Decide whether disappearance is expected
Without /n, a bridged Local channel can optimize out of the media path. If the downstream call remains connected and the correlated optimization succeeds, a missing Local name may be the intended result. Follow its unique IDs, linked ID, bridge events and surviving channels instead of treating name lookup failure as teardown.
If later logic needs the Local identity or its state, retain it deliberately with /n rather than relying on timing.
Verify modifiers and action availability
Inspect the effective dial string. /n prevents automatic optimization; /j depends on /n; /b changes which underlying channel is returned to a query; /m changes music-on-hold indication handling. Do not merge their effects.
For explicit optimization, check local manager action help, loaded module state and manager permissions. Resolve a current Local half before sending LocalOptimizeAway; a name captured before replacement or optimization can already be stale.
Prove bridge eligibility and correlate the attempt
LocalOptimizeAway permits optimization for an /n Local channel; it does not by itself prove that the halves are in an eligible bridged state. Capture both memberships immediately before the action.
Match LocalOptimizationBegin and LocalOptimizationEnd by their operation Id, then read End Success. Treat no Begin, unmatched End and an unsuccessful End as different evidence paths rather than retrying blindly.
Rebuild the resulting topology
After a successful End, follow bridge-leave and bridge-enter events and take a new membership snapshot. Depending on the initial bridge sizes, a surviving channel may move or two bridges may merge. An old bridge ID or Local-channel name is not proof that the wrong call survived.
Use stable channel identifiers and the final party set to determine whether the intended endpoints remain connected.
Follow state and media beyond optimization
If the right parties remain but behavior changes, check which variables, time limits, features, recording hooks and continuation logic belonged to the optimized Local channel. Then verify negotiated streams, packet direction and audible media on the surviving path.
Do not repair an expected identity transition by changing registration, codecs or NAT. No PBX, AMI session, manager user, permission, dialplan, Local channel, bridge, packet, media stream or live call was inspected or tested for this diagnostic.
Take a fresh bounded channel snapshot after optimization
The channel snapshot diagnostic reconciles surviving names, stable IDs and final bridge membership.
Exclude filtered Local optimization events
The AMI event diagnostic rebuilds per-session delivery state after reconnect.
Compare the Local pair with the surviving endpoint channel
The channel lifetime diagnostic correlates name, Uniqueid, Linkedid, bridge and lifecycle evidence.
Sources & applicability
Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.
- Asterisk 23 AMI LocalOptimizeAway action ↗
- Asterisk 22 AMI LocalOptimizeAway action ↗
- Asterisk 23 AMI LocalOptimizationBegin event ↗
- Asterisk 23 AMI LocalOptimizationEnd event ↗
- Asterisk 23 AMI LocalBridge event ↗
- Asterisk AMI v2 specification: Local channel optimization ↗
- Asterisk Local channel optimization ↗
- Asterisk Local channel modifiers ↗
- Asterisk 23 AMI CoreShowChannelMap action ↗
- Asterisk 22 AMI CoreShowChannelMap action ↗
- Asterisk 23 AMI CoreShowChannelMapComplete event ↗
- Asterisk 22 AMI CoreShowChannelMapComplete event ↗
- Asterisk 23 AMI CoreShowChannels action ↗
- Asterisk 23 AMI CoreShowChannel event ↗
- Asterisk 23 AMI CoreShowChannelsComplete event ↗
- Asterisk 23 AMI Status action ↗
- Asterisk 23 AMI Status event ↗
- Asterisk 23 AMI StatusComplete event ↗
- Asterisk 23 AMI Newchannel event ↗
- Asterisk 23 AMI Rename event ↗
- Asterisk 23 AMI Events action ↗
- Asterisk 22 AMI Events action ↗
- Asterisk 23 AMI Filter action ↗
- Asterisk 22 AMI Filter action ↗
- Asterisk 23 AMI WaitEvent action ↗
- Asterisk 22 AMI WaitEvent action ↗
- Asterisk AMI event filtering ↗
- Asterisk Manager TCP/IP API ↗
- Asterisk 23 AMI Login action ↗
- Asterisk 23 AMI Ping action ↗
- Asterisk CHANNEL_EXISTS dialplan function ↗
- Asterisk CHANNELS dialplan function ↗
- Asterisk CHANNEL dialplan function ↗
- Asterisk CLI channel creation and manipulation ↗
- Asterisk func_channel implementation ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.