Asterisk Call Recordings with MixMonitor

Asterisk Call Recordings with MixMonitor

MixMonitor() — Records a channel in the background, mixing both directions synchronously.

Synopsis

MixMonitor(filename.ext,options,command)

Records the audio on the current channel to the specified file. If the filename is an absolute path, MixMonitor() uses that path; otherwise it creates the file in the configured monitoring directory from asterisk.conf.

If command is specified, it will be run when recording ends, either by hangup or by calling StopMixMonitor().

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

Arguments
  • file
    • filename – If filename is an absolute path, uses that path, otherwise creates the file in the configured monitoring directory from asterisk.conf.
    • extension
  • options
    • a – Append to the file instead of overwriting it.
    • b – Only save audio to the file while the channel is bridged.
    • B( interval ) – Play a periodic beep while this call is being recorded.
      • interval – Interval, in seconds. Default is 15.
    • vx ) – Adjust the heard volume by a factor of x (range -4 to 4)
      • x
    • Vx ) – Adjust the spoken volume by a factor of x (range -4 to 4)
      • x
    • Wx ) – Adjust both, heard and spoken volumes by a factor of x (range -4 to 4)
      • x
    • rfile ) – Use the specified file to record the receive audio feed. Like with the basic filename argument, if an absolute path isn’t given, it will create the file in the configured monitoring directory.
      • file
    • tfile ) – Use the specified file to record the transmit audio feed. Like with the basic filename argument, if an absolute path isn’t given, it will create the file in the configured monitoring directory.
      • file
    • S – When combined with the r or t option, inserts silence when necessary to maintain synchronization between the receive and transmit audio streams.
    • ichanvar ) – Stores the MixMonitor’s ID on this channel variable.
      • chanvar
    • p – Play a beep on the channel that starts the recording.
    • P – Play a beep on the channel that stops the recording.
    • mmailbox ) – Create a copy of the recording as a voicemail in the indicated mailbox(es) separated by commas eg. m(1111default,…). Folders can be optionally specified using the syntax: mailbox@context/folder
      • mailbox
  • command – Will be executed when the recording is over.
    Any strings matching ^{X} will be unescaped to X.
    All variables will be evaluated at the time MixMonitor is called.

 

How to Use MixMonitor

; Record channel
exten => 123,1,MixMonitor(/var/lib/asterisk/sounds/123.wav)