Quantcast
Viewing all articles
Browse latest Browse all 5767

Asterisk cmd Monitor

Synopsis

Record a telephone conversation to a sound file

Description

  • Monitor(ext,basename)
  • Monitor(ext,basename,flags) — New feature added to CVS 2004-06-03

The Monitor command starts recording a channel. The channel's input and output voice packets are saved to separate sound files. You may change filenames during a recording by using the ChangeMonitor command. Recording continues until either the StopMonitor command is executed or the channel hangs up.
If you don't specify a full path, the file will be stored in the "monitor" subdir of the path specified with astspooldir in asterisk.conf (so default will be /var/spool/asterisk/monitor).

A more detailed description on recording with Asterisk can be found at Asterisk cmd Record.

Command Parameters

  • ext: The sound file format to save in, which will be also used as the filename extension. Default: wav

  • basename: The base filename to use when saving the sound files. If not supplied, the default basename is constructed on the channel name plus a number, for example, IAX2[foo@bar]-3. The channel's input voice packets will be saved to basename-in.ext and the output voice packets will be saved to basename-out.ext. The default location for saved files is the /var/spool/asterisk/monitor directory.

  • flags:
    • m - New in Asterisk v1.2.0 - If flags contains the letter m, then when recording finishes, Asterisk will execute a unix program to combine the two sound files into a single sound file. By default, Asterisk will execute soxmix and then delete the original two sound files. Note that sox/soxmix may not necessarily understand the sound format (e.g. alaw) and can't therefore mix the in and out files down to one single file. You may specify a different mixing method by setting the MONITOR_EXEC channel variable to the path of the unix program you wish executed, then call Monitor to begin recording. At the completion of recording, the specified unix program will be executed with three command-line parameters: the two sound files and the filename where the program should save the combined sound file. In this situation, earlier versions of Asterisk will not delete the two original sound files; it's up to your program to do that if you need/wish to. The "m" flag is settable through the manager interface.
    • b - New in Asterisk v1.2.0 - Don't begin recording unless a call is bridged to another channel.
    • i - New in Asterisk v1.6.0 - Skip recording of input stream (disables m option).
    • o - New in Asterisk v1.6.0 - Skip recording of output stream (disables m option).

Example 1

When a call is sent to extension 2060, recording of the call will begin, and the caller is sent to conference number 1 with the MeetMe command. ...

Viewing all articles
Browse latest Browse all 5767

Trending Articles