VoIP.info Guide

Asterisk AMI Monitor: legacy lifecycle and MixMonitor migration

Identify the Asterisk 20-and-earlier res_monitor lifecycle, keep rename, pause, stop and file evidence distinct, and migrate without assuming the actions exist on current branches.

Reviewed 2026-10-25Asterisk 20 Monitor, ChangeMonitor, PauseMonitor, UnpauseMonitor and StopMonitor AMI action references, the Asterisk 20 Monitor application, the Asterisk 21 removal notice, and current branch-23-generated MixMonitor, StopMixMonitor and CoreShowChannel references were reviewed October 25, 2026; res_monitor was deprecated in Asterisk 16 and removed in Asterisk 21, so legacy Monitor actions must not be represented as current-branch capabilities; installed release, vendor patches, loaded modules, action inventory, manager permissions, exact channel identity, monitor directory, filenames, formats, file ownership, storage, mix command, audio contents, retention and generated FreePBX dialplan remain deployment-specific; no PBX, module, manager account, action, channel, file, packet, recording, processor, endpoint or live call was inspected or testedAdvancedDocumentation based · not lab tested

Gate the workflow by exact Asterisk version

The documented Monitor, ChangeMonitor, PauseMonitor, UnpauseMonitor and StopMonitor AMI actions belong to res_monitor. Asterisk documents res_monitor as deprecated in Asterisk 16 and removed in Asterisk 21. Treat this workflow as legacy Asterisk 20-and-earlier behavior, not a current-branch control surface.

Record the full runtime version, package source, node and loaded-module and action inventories before sending anything. An action missing on Asterisk 21 or later is an expected version boundary, not evidence of a damaged recording, permission defect or incomplete module reload.

Bind Monitor to one exact channel and output plan

The Monitor action records the named Channel. Preserve ActionID, exact Channel, Uniqueid, Linkedid, bridge identity, File, Format, Mix and synchronized time before the request. Asterisk 20 documents wav as the default format and a default filename derived from the channel when File is omitted.

Those defaults do not prove the path or artifact observed on a particular system. Resolve the live channel immediately before the request, generate a safe server-side filename, and preserve the configured monitor directory, service account, mount and policy owner separately.

Treat rename, pause and resume as lifecycle transitions

ChangeMonitor changes the filename used by a Monitor session and requires both Channel and the new File. PauseMonitor temporarily stops recording on the named channel; UnpauseMonitor re-enables a recording that was previously paused. Preserve each request, response, ActionID and timestamp in order.

An accepted rename does not prove that a file was moved, closed or contains the expected interval. A pause response does not establish silence in an already buffered or downstream copy, and an unpause response does not prove that new media frames were written. Inspect the artifact timeline only after the correct session is stopped.

Close Monitor before interpreting mixed output

StopMonitor ends a previously started Monitor action on the named channel. The Asterisk 20 Monitor application records input and output to files until hangup or stop. Its mix option combines the two leg files after recording ends and normally deletes the raw legs; MONITOR_EXEC can replace that mixer, receive the two leg files and target name, and leave raw files undeleted.

Therefore, request acceptance, stop, leg-file closure, optional external command, mixed target creation, raw-file cleanup and durable storage are separate checkpoints. Do not open or upload the intended final artifact while the lifecycle or mixer is still active.

Migrate semantics rather than action names

Current Asterisk documents MixMonitor and StopMixMonitor under app_mixmonitor. MixMonitor records through a different mechanism, accepts application-style options and may expose a MixMonitor ID; StopMixMonitor can use that ID and is required to guarantee that the file is available for processing during dialplan execution.

Do not mechanically replace Monitor with MixMonitor while preserving assumptions about two raw leg files, ChangeMonitor, PauseMonitor, UnpauseMonitor or MONITOR_EXEC. Rebuild filename, direction, mute, scoped-stop, post-processing, retention and event correlation around the documented MixMonitor interface and the owning dialplan or application.

Validate legacy behavior and migration separately

For an authorized nonproduction legacy node, use one disposable call and prove exact channel identity, start, safe rename if required, pause interval, resume, stop, handle release, expected raw or mixed files, decode, duration and authorized playback. For the replacement, run an independent MixMonitor acceptance test including transfer behavior, scoped stop and one call that policy says must not record.

Keep the old and new evidence sets distinct. Documentation does not establish package availability, compatibility, file ownership, storage capacity, audio quality, legal basis or retention outcome, 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.

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