O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required