VoIP.info Guide

Asterisk ARI snoop channels: spy, whisper and directional media

Attach an application-owned snoop channel to one target channel, preserve spy and whisper direction separately, and prove the resulting media path without treating channel creation as audible success.

Reviewed 2026-10-09Current first-party Asterisk 22 and Certified Asterisk 22.8 ARI Channels, channel lifecycle, ARI configuration, REST-over-WebSocket, data-model and ChanSpy documentation reviewed October 9, 2026; no HTTP server, ARI identity, Stasis application, target channel, snoop channel, bridge, endpoint, packet, media stream, recording, monitor, whisper or call was inspected or testedAdvancedDocumentation based · not lab tested

Bind one snoop channel to one target channel

ARI starts snooping with POST /channels/{channelId}/snoop or the form that carries a snoop ID in the path. Preserve the running Asterisk version, Stasis application, target channel ID, application-owned snoop ID, spy, whisper, appArgs, request timestamp and response. The target and the returned snoop channel are different resources with different lifecycles.

Use a collision-resistant snoop ID and retain the target's UniqueID rather than a display label or endpoint name. A successful response establishes creation of the snoop channel; it does not prove that the target remained alive, that the intended direction carries samples, that a downstream consumer received them or that a listener heard a whisper.

Keep spy and whisper direction independent

The ARI API exposes separate spy and whisper controls. Each accepts none, both, out or in, and defaults to none. Preserve both values explicitly. A channel that requests neither operation can exist without carrying the media the application expected.

Interpret direction relative to the target channel and verify it with an authorized, known-source call. Do not translate in and out into caller, callee, agent or customer without first mapping which channel is the target and which way media crosses that channel. A correct directional choice can still sound one-way by design.

Treat the snoop as its own Stasis channel

The request places the snooping channel into the named Stasis application and can pass application arguments. Correlate the returned Channel object with its StasisStart, later channel events and StasisEnd. The target channel's events and the snoop channel's events answer different questions.

The application still needs an explicit consumer or producer for the snoop channel's media. A created snoop object is not a recording, External Media connection, bridge membership or monitor endpoint by itself. Preserve each later operation and resource ID instead of assuming the snoop request completed the entire media graph.

Separate monitoring, whisper and barge expectations

Spy observes selected target-channel audio. Whisper injects audio in the selected direction. Requesting both can produce a different operational result from monitoring alone, and neither should be described as a general conference or call-leg bridge. The dialplan ChanSpy reference is useful background for monitoring vocabulary, but ARI snoop parameters and the application's channel graph remain the controlling evidence here.

If an application needs both parties to hear an intervention, prove the target, direction and resulting far-leg audio rather than calling every injected stream a barge. If it needs an archive, use a deliberate recording workflow and verify the stored content separately.

Handle target races and cleanup deliberately

The documented snoop errors distinguish invalid parameters from a target channel that no longer exists. A target can hang up between the application's snapshot and the snoop request, so a 404 can be a lifecycle race rather than a permission or codec fault. Reconcile the exact target ID and hangup timeline before retrying on a replacement channel.

Hang up or delete the application-owned snoop channel when the operation ends, while leaving target-channel termination to the call owner. Make cleanup idempotent across application restart, WebSocket reconnect and duplicate terminal events. Do not let an orphaned monitor survive beyond its authorized interval.

Apply least privilege, notice and retention

Use HTTPS and WSS for ARI, a restricted ARI identity, bounded target selection and explicit authorization for monitoring or injected audio. Limit which application, queue, endpoint or call state can create a snoop; log the requester, target, directions, start, stop and disposition without exposing call content unnecessarily.

Monitoring, whispering and recording can carry separate legal, labor, privacy and retention obligations. ARI parameter acceptance does not establish participant notice, consent, permitted purpose or secure downstream handling. Pilot only with synthetic or otherwise authorized calls. No snoop channel or call 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.