Код: Выделить всё
exten => 1209,1,Set(dialto=FirstLine)
exten => 1209,2,Answer()
exten => 1209,n,Set(fname=${STRFTIME(${EPOCH},,%Y.%m.%d_%H-%M)}-${CALLERID(number)}-${EXTEN})
exten => 1209,n,MixMonitor(/var/lib/asterisk/records/${fname}.wav)
exten => 1209,n,Playback(/var/lib/asterisk/sounds/gr)
exten => 1209,n,Dial(OOH323/PBX/603)
exten => h,1,Set(msubj=Call from ${CALLERID(number)} to ${dialto}, (${ANSWEREDTIME}) ${STRFTIME(${EPOCH},,%H:%M %d.%m.%Y)})
exten => h,n,Wait(5)
exten => h,n,System(echo 'Listen it:'| mailx -s '${msubj}' -a /var/lib/asterisk/records/${fname}.wav lll@ququ.ru)
Код: Выделить всё
exten => 1209,1,Set(dialto=FirstLine)
exten => 1209,2,Answer()
exten => 1209,n,Set(fname=${STRFTIME(${EPOCH},,%Y.%m.%d_%H-%M)}-${CALLERID(number)}-${EXTEN})
exten => 1209,n,Set(uniqid=${UNIQUEID})
exten => 1209,n,MixMonitor(/var/lib/asterisk/records/${fname}.wav,,/usr/lib64/asterisk/srec '${dialto}' '${fname}' '${uniqid}')
exten => 1209,n,Playback(/var/lib/asterisk/sounds/gr)
exten => 1209,n,Dial(OOH323/PBX/603)
Код: Выделить всё
#!/bin/bash
#
x=`cut -d, -f 14,17,2,10,8 < /var/log/asterisk/cdr-csv/Master.csv | egrep \"Dial\".+\"$3\"`
if [ "$x" != "" ]
then
who=$(cut -d, -f1 <<< $x)
whn=$(cut -d, -f3 <<< $x)
dur=$(cut -d, -f4 <<< $x)
echo 'Dialog' | mailx -s "Dial $who to $1 dur $dur sec at $whn" -a /var/lib/asterisk/records/$2.wav lll@ququ.ru
fi
Думаю, все получится.exten => h,1,StopMixmonitor
exten => h,n,Set(msubj=Call from ${CALLERID(number)} to ${dialto}, (${ANSWEREDTIME}) ${STRFTIME(${EPOCH},,%H:%M %d.%m.%Y)})
exten => h,n,System(/bin/sleep 5)
exten => h,n,System(echo 'Listen it:'| mailx -s '${msubj}' -a /var/lib/asterisk/records/${fname}.wav lll@ququ.ru)