Examples
One-touch recording
exten => 123,1,Set(DYNAMIC_FEATURES=automon) ; enable One-touch
exten => 123,2,Dial(SIP/phone100,,wW) ; wW allow one-touch recording
Note: I don't know since when it was done but in 1.2 is for sure. If you have sox installed, the automon feature will mix both legs of a call at the end. By default, the recorded filename is auto-${EPOCH}-caller-calee. You can change the caller-callee part of it by setting TOUCH_MONITOR variable.
Actually, you don't have to do a Set to enable it, which would require it to be enabled before every single Dial statement.
Instead, to enable automon globally, you can in extensions.conf put:
[globals]
DYNAMIC_FEATURES=>automon
Which will enable it for any Dial() or Queue() call with the options w or W set.
Examples
One Touch Recording (applicationmap) with WAV to MP3 Conversion Macro.
extensions.conf :features.conf :Код: Выделить всё
[macro-apprecord] exten => s,1,GotoIf($["${XAD}" = "0" | "${XAD}" = ""]?startrec:stoprec) exten => s,n(startrec),Playback(startmonitor) exten => s,n,Set(XAD=1) exten => s,n,Set(FILENAME=${TIMESTAMP}-OUT${CALLERID(number)}-^-${UNIQUEID}) exten => s,n,Set(MONITOR_EXEC_ARGS=&& nice -n 19 /usr/local/bin/lame -b 96 -t -F -m m --bitwidth 16 --quiet "/var/spool/asterisk/monitor/${FILENAME}.wav" "/var/spool/asterisk/monitor/${FILENAME}.mp3" && rm -f "/var/spool/asterisk/monitor/${FILENAME}.wav") exten => s,n,Monitor(wav,${FILENAME},m) exten => s,n,MacroExit exten => s,n(stoprec),StopMonitor exten => s,n,Set(XAD=0) exten => s,n,Playback(stopmonitor) exten => s,n,MacroExit
Код: Выделить всё
apps => *9,caller,Macro,apprecord
а ведь всего то нужно было прочитать инструкциюtestsia писал(а):TOUCH_MONITOR работает на ура!