Name

Monitor() — Monitors (records) the audio on the current channel

Synopsis

    Monitor([file_format[:urlbase][,fname_base][,options]])

Starts monitoring a channel. The channel’s input and output voice packets are logged to files until the channel hangs up or monitoring is stopped by the StopMonitor() application.

Monitor() takes the following arguments:

file_format

Specifies the file format. If not set, defaults to wav.

fname_base

If set, changes the filename used to the one specified.

options

One of two options can be specified:

m

When the recording ends, mix the two leg files into one and delete the original leg files. If the variable ${MONITOR_EXEC} is set, the application referenced in it will be executed instead of soxmix, and the raw leg files will not be deleted automatically. soxmix (or ${MONITOR_EXEC}) is handed three arguments: the two leg files and the filename for the target mixed file, which is the same as the leg filenames but without the in/out designator. If ${MONITOR_EXEC_ARGS} is set, the contents will be passed on as additional arguments to ${MONITOR_EXEC}. Both ${MONITOR_EXEC} and the m flag can be set from the administrator interface

b

Don’t begin recording unless a call is bridged to another channel.

Returns -1 if monitor files can’t be opened or if the channel is already monitored; otherwise, returns 0.

    exten => 123,1,Answer()
    ; record the current channel, and mix the audio channels at the end of
    ; recording
    exten => 123,2,Monitor(wav,monitor_test,mb) exten => 123,3,SayDigits(12345678901234567890) ...

Get Asterisk: The Future of Telephony now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.