У людей отвалился сервер куда писались звонки, сейчас подняли новый, но никак не можем понять как сделать запись звонков.
на данный момент звонки пишутся в (/var/spool/asterisk), но нужно как то сделать так, что бы звонки писались в сервер с файловым хранилищем.
Причем если раньше звонки писались имя файла "номер телефона входящий-номер телефона исходящий-дата-время), то теперь только номер телефона.
Можете помочь с решением проблемы ?
вот кусок кода с макро, если покажу весь файл екстен, то с сума сойти можно от безумия того, кто это делал ))
Код: Выделить всё
[macro-monitor]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/var/spool/asterisk/monitor/${ARG1}.wav" "/home/calls/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/`date +%H.%M_%d.%m`_${ARG3}-${ARG2}.mp3" && rm -f "/var/spool/asterisk/monitor/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-sndfx]
exten => s,1,SendFAX(/var/spool/asterisk/tmp/faxfile.tif,d)
exten => s,n,Hangup()
[macro-monitorkp]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/root/telefon/${ARG1}.wav" "/media/telefon/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG3}-${ARG2}_`date +%H.%M`.mp3" && rm -f "/root/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitorzdor]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/root/telefon/${ARG1}.wav" "/media/telefon/zdor/`date +%d`/${ARG3}_`date +%H.%M`.mp3" && rm -f "/root/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitorin]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/root/telefon/${ARG1}.wav" "/media/telefon/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}_`date +%H.%M`.mp3" && rm -f "/root/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitoryasno]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /root/telefon/reklama/yasno/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/root/telefon/${ARG1}.wav" "/media/telefon/reklama/yasno/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/root/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitorklasifait]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/klasifait/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/klasifait/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG3}-${ARG2}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitoryasno407]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/yasno/407/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/yasno/407/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitoryasno404]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/yasno/404/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/yasno/404/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitoryasno408]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/yasno/408/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/yasno/408/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitoryasno410]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/yasno/410/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/yasno/410/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitorredcentr]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/formax/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/formax/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitor9may]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/9may/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/9may/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitornashe]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/nashe/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/nashe/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG3}-${ARG2}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitoradam]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/reklama/adam/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/reklama/adam/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitorreckp]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/reklama/kp/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/reklama/kp/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitorreccentr]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/reklama/centr/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/reklama/centr/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitorrecnashe]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/reklama/nashe/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/reklama/nashe/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitor072]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /home/denis/telefon/072/line/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/telefon/072/line/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG1}-${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})
[macro-monitoreda]
;ARG1 - id
;ARG2 - in or out
;ARG3 - callerid
exten => s,1,Set(monopt= /root/eda_rec/`date +%Y`/`date +%m`/${ARG2}/`date +%d`" && nice -n 19 /usr/bin/lame -b 16 --silent "/home/denis/telefon/${ARG1}.wav" "/media/eda_rec/`date +%Y`/`date +%m`/${ARG2}/`date +%d`/${ARG2}-${ARG3}_`date +%H.%M`.mp3" && rm -f "/home/denis/telefon/${ARG1}.wav")
exten => s,n,MixMonitor(${ARG1}.wav,,${monopt})