Records the current channel in two separate files.
Monitor([format[,fileprefix[,options]]])
Starts audio recording on the current channel. Incoming and
outgoing audio packets are written to separate files until the channel is
hung up or monitoring is stopped with
StopMonitor().
The parameter format sets the file
format. If this is not specified, wav is used.
The parameter fileprefix specifies the
filename without extension. If this is not specified, the filename is
assembled out of the channel name and a number, for example,
IAX2[foo@bar]-3. Incoming audio is written to
,
outgoing audio in
fileprefix-in.format,
both in fileprefix-out.format/var/spool/asterisk/monitor/.
Two options may be specified:
m
After recording is complete, mixes the incoming and
outgoing audio files into a single file and deletes the originals.
Requires that soxmix from the
sox package be installed on the
server.[52]If the variable ${MONITOR_EXEC} is
defined, this application is executed instead of
soxmix and the original incoming and outgoing
audio files are not deleted.[53]. soxmix (or
${MONITOR_EXEC} if specified) is passed three
values: the names of the incoming and outgoing audio files and the
name of the mixed file, which is the fileprefix without
-in/-out. If
${MONITOR_EXEC_ARGS} is set, the contents are used as
arguments to ${MONITOR_EXEC}.
|
|
|
Note that soxmix attempts to determine
the file type based on the file extension. Formats such as
|
|
|
|
If you wanted a single mixed sound file,
|
b
Returns 0 on success, or -1 on failure (such as a failure to open the audio files for writing, or the channel is already being monitored, etc.)
; record the conversation and mix the audio afterwards: exten => 123,1,Answer() exten => 123,n,Monitor(gsm,,mb) exten => 123,n,SayDigits(123456789) exten => 123,n,Hangup() ; as above, only with our own wrapper script that calls soxmix: exten => 123,1,Answer() exten => 123,n,Set(MONITOR_EXEC=/path/to/my-soxmix-wrapper.sh) exten => 123,n,Monitor(gsm,,mb) exten => 123,n,SayDigits(123456789) exten => 123,n,Hangup()
|
|
|
Before recording conversations, make sure you are complying with the relevant legislation in your jurisdiction. In most cases, both parties must be aware they are being recorded.[54] |
|
|
|
Some Asterisk users who routinely need to record many conversations (50-500) report much better performance if call recordings are written to a RAM disk (fewer and shorter seek operations) before being copied to a hard disk when the conversation is over. |
|
|
|
Internal help for this application in Asterisk 1.4: -= Info about application 'Monitor' =-
[Synopsis]
Monitor a channel
[Description]
Monitor([file_format[:urlbase]|[fname_base]|[options]]):
Used to start 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.
file_format optional, if not set, defaults to "wav"
fname_base if set, changes the filename used to the one specified.
options:
m - when the recording ends mix the two leg files into one and
delete the two 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 3 arguments, the two leg file
s
and a target mixed file name which is the same as the leg file
names
only without the in/out designator.
If MONITOR_EXEC_ARGS is set, the contents will be passed on as
additional arguements to MONITOR_EXEC
Both MONITOR_EXEC and the Mix flag can be set from the
administrator interface
b - Don't begin recording unless a call is bridged to another chan
nel
Returns -1 if monitor files can't be opened or if the channel is already
monitored, otherwise 0.
diff output to internal help in Asterisk 1.2: - none - |
See also. the section called “ChangeMonitor()”, the section called “StopMonitor()”, the section called “PauseMonitor()”, the section called “UnpauseMonitor()”, the section called “MixMonitor()”, the section called “Record()”
[52] http://sox.sourceforge.net/, see also an explanation in ???, version 12.17.7 or newer. You may check your installed version with soxmix -help
[53] depends on Asterisk version; older versions do not delete automatically. It's best to check with a proper test.