Monitor(file_format:[urlbase],[fname_base,[options]]])
Arguments
file_format
file_format
- optional, if not set, defaults towav
urlbase
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 variableMONITOR_EXEC
is set, the application referenced in it will be executed instead of soxmix/sox and the raw leg files will NOT be deleted automatically. soxmix/sox orMONITOR_EXEC
is handed 3 arguments, the two leg files and a target mixed file name which is the same as the leg file names only without the in/out designator.
IfMONITOR_EXEC_ARGS
is set, the contents will be passed on as additional arguments toMONITOR_EXEC
. BothMONITOR_EXEC
and the Mix flag can be set from the administrator interface.b
- Don't begin recording unless a call is bridged to another channel.B
( interval )
- Play a periodic beep while this call is being recorded.interval
- Interval, in seconds. Default is 15.
i
- Skip recording of input stream (disablesm
option).o
- Skip recording of output stream (disablesm
option)
上面是在wiki上看到的 主要参数是b参数控制,加b接通后才录音,不加b振铃就开始录音了 可以听到回铃音或者彩铃
1、接通开始录音
exten => s,n(record),MixMonitor(${WAVPATH}${CALLFILENAME:0:-4}.wav,b,/usr/local/bin/lame -b 32 --resample 8 -a ${WAVPATH}${CALLFILENAME:0:-4}.wav ${WAVPATH}${CALLFILENAME} && rm -rf ${WAVPATH}${CALLFILENAME:0:-4}.wav)
2、拨打开始录音,包括振铃音
exten => s,n(record),MixMonitor(${WAVPATH}${CALLFILENAME:0:-4}.wav,,/usr/local/bin/lame -b 32 --resample 8 -a ${WAVPATH}${CALLFILENAME:0:-4}.wav ${WAVPATH}${CALLFILENAME} && rm -rf ${WAVPATH}${CALLFILENAME:0:-4}.wav)