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

 

    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)
    exten => 123,4,StopMonitor(  )

 

See Also

ChangeMonitor( ), StopMonitor( )