Prove that playback already exists on the exact channel
Record the Asterisk node, installed release, manager identity, ActionID, exact Channel, Uniqueid, Linkedid, current application and application data, playback owner, media identifier and synchronized time. Resolve the channel immediately before control.
AMI ControlPlayback does not start media. Its documented target is the named channel that currently has a file playing, so an accepted request against a stale, bridged peer or channel without an active playback is not a substitute for proving the initiator and live target.
Choose only the documented control operation
The action documents stop, forward, reverse, pause and restart. Forward and reverse use the skipms value supplied by the operation that initiated playback; the documented default is 3000 ms. Preserve the configured interval instead of inferring movement from wall-clock listening alone.
Pause is a pause/unpause control when supported, not separate idempotent pause and resume states. Repeating it blindly can invert the intended result. Stop remains terminal for the current playback operation rather than a whole-call or channel hangup.
Match pause and restart to the playback initiator
Asterisk warns that pause and restart stop the playback when the media operation was not initiated by the ControlPlayback dialplan application or the CONTROL STREAM FILE AGI command. Identify the initiator before sending either control.
Ordinary Playback, Background, ARI playback objects, conference prompts and endpoint-local media have different control surfaces. Similar audible content does not make those mechanisms interchangeable with this AMI action.
Keep response, completion state and sound separate
Preserve the raw AMI response and matching ActionID as request-processing evidence. The ControlPlayback application and CONTROL STREAM FILE command document CPLAYBACKSTATUS, CPLAYBACKOFFSET and CPLAYBACKSTOPKEY after completion; read them only from the exact channel and workflow that owns them.
SUCCESS, USERSTOPPED, REMOTESTOPPED and ERROR describe completion state, while offset minus one identifies end of file. None alone proves that a listener heard the expected prompt, language, content, level or timing.
Rebuild identity after channel and bridge changes
CoreShowChannel can expose Channel, Uniqueid, Linkedid, BridgeId, Application, ApplicationData and Duration for a timestamped snapshot. Rebuild the intended target after transfer, Local-channel optimization, masquerade, bridge replacement or application transition.
The channel receiving audio and the channel executing the playback application may not match human caller and callee labels after topology changes. Bridge membership remains potential media relationship evidence rather than playback ownership or audible-result proof.
Validate control and recovery on disposable media
In an approved nonproduction call, use a known short file with authorized content and a recorded skip interval. Exercise one control at a time, preserving the response, current application, completion variables, packet or frame evidence and listener observation. Start a fresh playback before testing a terminal stop or an unsupported pause or restart path.
Use a dedicated least-privilege manager identity, bound retries and an application-owned recovery path. Documentation does not establish installed availability, compatibility, audible quality or safe behavior on production calls, and no live system was 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 ControlPlayback AMI action ↗
- Asterisk 22 ControlPlayback AMI action ↗
- Certified Asterisk 22.8 ControlPlayback AMI action ↗
- Asterisk 23 ControlPlayback dialplan application ↗
- Asterisk 22 ControlPlayback dialplan application ↗
- Asterisk 23 CONTROL STREAM FILE AGI command ↗
- Certified Asterisk 22.8 Playback application ↗
- Asterisk 23 CoreShowChannel event ↗
- Asterisk Manager TCP/IP API ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.