ChanSpy() — Listens to the audio on a channel, and optionally whisper to the calling channel



This application is used to listen to the audio going to and from an Asterisk channel. If the chanprefix parameter is specified, only channels beginning with this value will be spied upon.

While a channel is being spied upon, the following actions may be performed:

  • Dialing # cycles the volume level.

  • Dialing * will cause the application to spy on the next available channel.

  • Dialing a series of digits followed by # builds a channel name (which will be appended to chanprefix). For example, placing ChanSpy(Zap) and then dialing the digits 42# while spying will begin spying on the channel Zap/42.

The options parameter may contain zero or more of the following options:


Only spy on channels that are involved in a bridged call.


Only spy on channels that contain a channel variable named SPYGROUP, which should contain group in an optional colon-delimited list.


Quiet mode. Tells the application not to beep or read the selected channel’s name when spying begins.


Records the channel audio to the monitor spool directory (usually /var/spool/asterisk/monitor). An optional basename set the base filename of the recordings, which defaults to chanspy.


Adjusts the volume of the audio being listened to. The value must be in the range of 4 to -4. A negative value will make the volume quieter, while a positive value will make it louder.


Whisper mode. This allows the spying channel to talk to the spied-upon channel, without any other bridged channel being able to hear the audio.


Private whisper mode. This enables the spying channel to speak to the spied-upon channel without being able to hear the audio from the spied-upon channel.

; Spy on the Zap channels in whisper mode
exten => 123,1,ChannelSpy(Zap,w)

See Also