{"id":257657,"date":"2015-05-21T12:09:02","date_gmt":"2015-05-21T08:09:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=257657"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=257657","title":{"rendered":"\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u0432 mp3 \u0432\u043e FreePBX\/Asterisk"},"content":{"rendered":"<p>             \u041d\u044b\u043d\u0435 FreePBX \u2014 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043a Asterisk, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u043a\u0430\u043a \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u044e\u0441 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 \u043d\u0435\u0434\u043e\u0440\u043e\u0433\u0438\u0445 vds-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 (\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e \u043d\u0430 vds \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e 299\u0440\/\u043c\u0435\u0441\u044f\u0446, 2\u0413\u0431 \u041e\u0417\u0423, 2,8 GHZ \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, 20\u0413\u0431 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435). \u0422\u0430\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 10-20 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0432\u043e\u043d\u043a\u043e\u0432, \u043f\u0438\u0448\u0435\u0442 \u0430\u0443\u0434\u0438\u043e, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 (\u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 crm, \u0437\u0432\u043e\u043d\u043a\u0438 \u0441 \u0441\u0430\u0439\u0442\u0430\/\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0430\u0432\u0442\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0443\u0431\u0434, \u0432\u044b\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 \u043e \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u043c \u0437\u0430 \u0434\u043e\u043b\u0438 \u0441\u0435\u043a\u0443\u043d\u0434, \u0434\u0430\u0436\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0447\u0438!).<\/p>\n<p>  \u0412\u0441\u0435 \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043f\u0440\u0438 \u00ab\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445\u00bb \u043e\u0431\u0437\u0432\u043e\u043d\u0430\u0445 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u043c\u0435\u0441\u044f\u0446\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. \u0422\u0435 \u0441\u0430\u043c\u044b\u0435 20\u0413\u0431 \u0443\u043b\u0435\u0442\u0430\u044e\u0442 \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e! \u0410 \u0445\u043e\u0441\u0442\u0435\u0440, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 fuse \u043d\u0430 \u0442\u0430\u0440\u0438\u0444\u0430\u0445 OpenVZ, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u00ab\u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u2014 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u00bb, \u0432\u0440\u043e\u0434\u0435 ftpfs.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u0438\u0437\u043b\u043e\u0436\u0443 \u043c\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043c\u0435\u0440 \u043f\u043e \u0431\u043e\u0440\u044c\u0431\u0435 \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0441 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u043c \/var\/spool\/asterisk\/monitor, \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 .wav \u0444\u0430\u0439\u043b\u044b, \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 asterisk \u043f\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c: \u0433\u043e\u0434, \u043c\u0435\u0441\u044f\u0446 \u0438 \u0434\u0435\u043d\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u043f\u043e\u0448\u0435\u043b \u043d\u0435 \u0441 \u0442\u043e\u0433\u043e \u043a\u0440\u0430\u044f \u2014 \u0441\u0442\u0430\u043b \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 webdav (ya.disk) \u0438 ftp. \u0414\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u043c \u0440\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446 \u043f\u043e \u043a\u0440\u043e\u043d\u0443. \u0421\u043a\u0440\u0438\u043f\u0442 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441.<\/p>\n<p>  \u0414\u043b\u044f yandex.disk \u043e\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0430\u043a\u043e\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u043f\u043e\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u00bb, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0432\u0430. \u041d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043a\u043e\u0435-\u0433\u0434\u0435 \u043e\u043d \u043f\u0440\u0438\u0436\u0438\u043b\u0441\u044f:<\/p>\n<pre><code class=\"bash\">#settings #for disk.yandex.ru YAUSER=login@yandex.ru YAPASSWORD=verystrongpassword  MONPATH=\/var\/spool\/asterisk\/monitor LASTMONTH=1 #\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 DIR=astsounds #\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0432\u044b  #start MONTH=$(date +&quot;%m&quot;) for YEAR in $( ls $MONPATH ); do          for MONTH in $( ls $MONPATH\/$YEAR\/ ); do \tif [ $MONTH -le $(($(date +&quot;%m&quot;)-$LASTMONTH)) ] || [ $YEAR -ne $(date +&quot;%Y&quot;) ]; then \t    tar -zcvf $MONPATH\/$YEAR\/$MONTH\/$YEAR-$MONTH.tar.gz $MONPATH\/$YEAR\/$MONTH\/ &gt;\/dev\/null \t    curl -T $MONPATH\/$YEAR\/$MONTH\/$YEAR-$MONTH.tar.gz --user $YAUSER:$YAPASSWORD https:\/\/webdav.yandex.ru\/$DIR\/$YEAR-$MONTH.tar.gz && rm -f -r $MONPATH\/$YEAR\/$MONTH &gt;\/dev\/null \tfi     done     #remove old YEAR dir     if [ $YEAR -ne $(date +&quot;%Y&quot;) ]; then \trm -f -r $MONPATH\/$YEAR     fi      done <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043f\u0438\u0441\u0430\u043b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f ftp, \u0440\u0435\u0448\u0438\u043b \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u043e. \u0418 \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0449\u0435, \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u043c\u043e\u0436\u043d\u043e, \u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0437 CDR-\u043e\u0442\u0447\u0435\u0442\u0430. \u0422\u0440\u0435\u0431\u0443\u0435\u0442 lftp-\u0443\u0442\u0438\u043b\u0438\u0442\u0443.<\/p>\n<pre><code class=\"bash\">#move audio records to XXX.ru free FTP server #settings FTPSRV=node0.XXXX.ru FTPUSER=username_ftpserver FTPPWD=passwd_ftpserver MONPATH=\/var\/spool\/asterisk\/monitor LASTMONTH=1 DIR=recordings  #log and cd ftpcommand() { lftp -u $FTPUSER,$FTPPWD -e &quot;$1&quot; $FTPSRV }  ftpcommand &quot;mkdir public_http; mkdir public_http\/$DIR; quit;&quot;  MONTH=$(date +&quot;%m&quot;) for YEAR in $( ls $MONPATH ); do     for MONTH in $( ls $MONPATH\/$YEAR\/ ); do     if [ $MONTH -le $(($(date +&quot;%m&quot;)-$LASTMONTH)) ] || [ $YEAR -ne $(date +&quot;%Y&quot;) ]; then \t    echo &quot;saving $YEAR\/$MONTH&quot; \t    ftpcommand &quot;mkdir public_http\/$DIR\/$YEAR; mkdir public_http\/$DIR\/$YEAR\/$MONTH; quit;&quot; \t    for DAY in $( ls $MONPATH\/$YEAR\/$MONTH\/ ); do           ftpcommand &quot;mkdir public_http\/$DIR\/$YEAR\/$MONTH\/$DAY; quit;&quot;           for FILE in $( ls $MONPATH\/$YEAR\/$MONTH\/$DAY ); do             ftpcommand &quot;cd  \/public_http\/$DIR\/$YEAR\/$MONTH\/$DAY\/; put $MONPATH\/$YEAR\/$MONTH\/$DAY\/$FILE; quit;&quot;           done \t    done       rm -f -r $MONPATH\/$YEAR\/$MONTH     fi     done     #remove old YEAR dir     if [ $YEAR -ne $(date +&quot;%Y&quot;) ]; then     rm -f -r $MONPATH\/$YEAR     fi done <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043b\u0441\u044f \u0432 \u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u043a\u0440\u043e\u043d.<\/p>\n<p>  \u041d\u043e \u043a\u043e\u0435-\u043a\u043e\u043c\u0443, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b, \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0445\u0432\u0430\u0442\u0430\u043b\u043e. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u043b\u0438 \u0434\u0438\u0441\u043a \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0432 mp3. \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u2014 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u043e\u0442 4-\u0445 \u0440\u0430\u0437. \u041f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f <b>lame<\/b>.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \/etc\/asterisk \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 mixmon_mp3.sh \u0438 \u0434\u0430\u0434\u0438\u043c \u0435\u043c\u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0441 asterisk \u0445\u043e\u0437\u044f\u0438\u043d\u0430: <u>chown asterisk. mixmon_mp3.sh<\/u>. \u0422\u0430\u043a\u0436\u0435 \u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435: <u>chmod +x mixmon_mp3.sh<\/u>.<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh #convert wav to mp3 asterisk recordings cdrdb=&quot;asteriskcdrdb&quot; cdrtable=&quot;cdr&quot; astdbuser=&quot;asteriskuser&quot; #\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0443\u0431\u0434 \u0434\u043b\u044f \u043e\u0442\u0447\u0435\u0442\u043e\u0432 astdbuserpass=&quot;asteriskuserpassword&quot; #\u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u0443\u0431\u0434  for i in `find \/var\/spool\/asterisk\/monitor -type f -name &quot;$1&quot;` do  if [ -e &quot;$i&quot; ]; then     file=`basename &quot;$i&quot; .wav`;     dir=`dirname &quot;$i&quot;`;     lame -h -b 192 &quot;$i&quot; &quot;$dir\/$file.mp3&quot;;     rm -f &quot;$dir\/$file.wav&quot;;     sleep 3     mysql --user=&quot;$astdbuser&quot; --password=&quot;$astdbuserpass&quot; --database=&quot;$cdrdb&quot; --execute='UPDATE '$cdrtable' SET recordingfile=&quot;'$file'.mp3&quot; WHERE recordingfile=&quot;'$file'.wav&quot;;';  fi done  <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 \u0432\u0435\u0431\u043c\u043e\u0440\u0434\u0435 FreePBX, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Settings \u2014 Advanced Settings \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c <b>Display Readonly Settings<\/b> \u0438 <b>Override Readonly Settings<\/b>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <b>Post Call Recording Script<\/b> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Developer and Customization. \u0422\u0443\u0434\u0430 \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c: <\/p>\n<pre><code class=\"bash\">\/etc\/asterisk\/mixmon_mp3.sh ^{CALLFILENAME}.^{MIXMON_FORMAT} <\/code><\/pre>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f MIXMON_DIR \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043f\u0443\u0441\u0442\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u0435\u043c \u0444\u0430\u0439\u043b\u0430 \u0438 \u043e\u0442\u044b\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 monitor. \u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0444\u0430\u0439\u043b, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 mp3, \u0443\u0434\u0430\u043b\u044f\u0435\u0442 wav \u0438 \u043f\u0440\u0430\u0432\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 cdr, \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043e\u0442\u0447\u0435\u0442\u044b. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0432\u0435\u0431\u043c\u043e\u0440\u0434\u0435 \u0441 \u043e\u0442\u0447\u0435\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043e\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0435\u0431\u043c\u043e\u0440\u0434\u044b cdr:<br \/>  \/var\/www\/html\/admin\/modules\/cdr\/<br \/>  cdr_audio.php  <\/p>\n<pre><code class=\"php\">&lt;?php if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } \/**  * @file  * plays recording file  *\/ if (isset($_REQUEST['cdr_file'])) { \tinclude_once(&quot;crypt.php&quot;);  \t$REC_CRYPT_PASSWORD = (isset($amp_conf['AMPPLAYKEY']) && trim($amp_conf['AMPPLAYKEY']) != &quot;&quot;)?trim($amp_conf['AMPPLAYKEY']):'TheWindCriesMary'; \t$crypt = new Crypt(); \t$opath = $_REQUEST['cdr_file']; \t$path = $crypt-&gt;decrypt($opath,$REC_CRYPT_PASSWORD);  \t\/\/ Gather relevent info about file \t$size = filesize($path); \t$name = basename($path); \t$extension = strtolower(substr(strrchr($name,&quot;.&quot;),1)); \t\/\/ This will set the Content-Type to the appropriate setting for the file \t$ctype =''; \tswitch( $extension ) { \t\tcase &quot;WAV&quot;: \t\t\t$ctype=&quot;audio\/x-wav&quot;; \t\t\tbreak; \t\tcase &quot;wav&quot;: \t\t\t$ctype=&quot;audio\/x-wav&quot;; \t\t\tbreak; #--------------------- \t\tcase &quot;mp3&quot;: \t\t\t$ctype=&quot;audio\/mpeg&quot;; \t\t\tbreak; #--------------------- \t\tcase &quot;ulaw&quot;: \t\t\t$ctype=&quot;audio\/basic&quot;; \t\t\tbreak; \t\tcase &quot;alaw&quot;: \t\t\t$ctype=&quot;audio\/x-alaw-basic&quot;; \t\t\tbreak; \t\tcase &quot;sln&quot;: \t\t\t$ctype=&quot;audio\/x-wav&quot;; \t\t\tbreak; \t\tcase &quot;gsm&quot;: \t\t\t$ctype=&quot;audio\/x-gsm&quot;; \t\t\tbreak; \t\tcase &quot;g729&quot;: \t\t\t$ctype=&quot;audio\/x-g729&quot;; \t\t\tbreak; \t\tdefault: \/\/not downloadable \t\t\t\/\/ echo (&quot;&lt;b&gt;404 File not found! foo&lt;\/b&gt;&quot;); \t\t\t\/\/ TODO: what to do if none of the above work? \t\tbreak ; \t}    $fp=fopen($path, &quot;rb&quot;);   if ($size && $ctype && $fp) {     header(&quot;Pragma: public&quot;);     header(&quot;Expires: 0&quot;);     header(&quot;Cache-Control: must-revalidate, post-check=0, pre-check=0&quot;);     header(&quot;Cache-Control: public&quot;);     header(&quot;Content-Description: audio file&quot;);     header(&quot;Content-Type: &quot; . $ctype);     header(&quot;Content-Disposition: attachment; filename=&quot; . $name);     header(&quot;Content-Transfer-Encoding: binary&quot;); #---------------------     header(&quot;Accept-Ranges: bytes&quot;);     header(&quot;Connection: close&quot;);     header(&quot;Content-Length: $size&quot;);     header(&quot;Content-Range:bytes 0-$size\/$size&quot;);     header(&quot;Content-length: &quot; . $size); #---------------------         $chunksize = 1*(1024*1024);     while (!feof($fp)) {         $buffer = fread($fp, $chunksize);         echo $buffer;         ob_flush();         flush();     }     fclose($fp);   } }  ?&gt; <\/code><\/pre>\n<p>  cdr_play.php<\/p>\n<pre><code class=\"php\">&lt;?php if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }  \/**  * @file  * popup window for playing recording  *\/ include_once(&quot;crypt.php&quot;); ?&gt; &lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&quot;&gt; &lt;html xmlns=&quot;http:\/\/www.w3.org\/1999\/xhtml&quot;&gt;   &lt;head&gt;     &lt;TITLE&gt;CDR Viewer&lt;\/TITLE&gt; \t\t\t&lt;style type=&quot;text\/css&quot;&gt; \t\t\t\t.popup_download { \t\t\t\t\tcolor: #105D90;  \t\t\t\t\tmargin: 5px;  \t\t\t\t\tfont-size: 12px;  \t\t\t\t\ttext-align: left; \t\t\t\t} \t\t\t&lt;\/style&gt;     &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text\/html; charset=UTF-8&quot;&gt;   &lt;\/head&gt;   &lt;body&gt; &lt;?php  \t$crypt = new Crypt();  \t$REC_CRYPT_PASSWORD = (isset($amp_conf['AMPPLAYKEY']) && trim($amp_conf['AMPPLAYKEY']) != &quot;&quot;)?trim($amp_conf['AMPPLAYKEY']):'TheWindCriesMary'; \t$path = $crypt-&gt;decrypt($_REQUEST['recordingpath'],$REC_CRYPT_PASSWORD); \t$file = urlencode($crypt-&gt;encrypt($path,$REC_CRYPT_PASSWORD)); \tif (isset($file)) { #--------------------- \t\techo(&quot;&lt;audio controls&gt;\\n&lt;source src=\\&quot;config.php?skip_astman=1&quietmode=1&handler=file&module=cdr&file=cdr_audio.php&cdr_file=$file\\&quot; type=\\&quot;audio\/mpeg\\&quot;&gt;\\n&lt;\/audio&gt;&quot;); #--------------------- \t} ?&gt;   &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u043d\u0443\u0442\u044c \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0432 mp3 \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u043a\u0440\u043e\u043d:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh #convert wav to mp3 asterisk recordings cdrdb=&quot;asteriskcdrdb&quot; cdrtable=&quot;cdr&quot; astdbuser=&quot;asteriskuser&quot; astdbuserpass=&quot;asteriskuserpassword&quot; for i in `find \/var\/spool\/asterisk\/monitor -type f -name &quot;*.wav&quot;` do  if [ -e &quot;$i&quot; ]; then     file=`basename &quot;$i&quot; .wav`;     dir=`dirname &quot;$i&quot;`;     lame -h -b 192 &quot;$i&quot; &quot;$dir\/$file.mp3&quot;;     rm -f &quot;$dir\/$file.wav&quot;;     mysql --user=&quot;$astdbuser&quot; --password=&quot;$astdbuserpass&quot; --database=&quot;$cdrdb&quot; --execute='UPDATE '$cdrtable' SET recordingfile=&quot;'$file'.mp3&quot; WHERE recordingfile=&quot;'$file'.wav&quot;;';  fi done <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435\u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u043d\u043e\u0447\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u043d\u0435\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e, \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 QuickTime \u0438 \u0444\u0430\u0439\u043b \u043d\u0430\u043c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 HTML5-\u0442\u0435\u0433 .             <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/258445\/\"> http:\/\/habrahabr.ru\/post\/258445\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             \u041d\u044b\u043d\u0435 FreePBX \u2014 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043a Asterisk, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u043a\u0430\u043a \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u044e\u0441 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 \u043d\u0435\u0434\u043e\u0440\u043e\u0433\u0438\u0445 vds-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 (\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e \u043d\u0430 vds \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e 299\u0440\/\u043c\u0435\u0441\u044f\u0446, 2\u0413\u0431 \u041e\u0417\u0423, 2,8 GHZ \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, 20\u0413\u0431 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435). \u0422\u0430\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 10-20 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0432\u043e\u043d\u043a\u043e\u0432, \u043f\u0438\u0448\u0435\u0442 \u0430\u0443\u0434\u0438\u043e, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 (\u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 crm, \u0437\u0432\u043e\u043d\u043a\u0438 \u0441 \u0441\u0430\u0439\u0442\u0430\/\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0430\u0432\u0442\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0443\u0431\u0434, \u0432\u044b\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 \u043e \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u043c \u0437\u0430 \u0434\u043e\u043b\u0438 \u0441\u0435\u043a\u0443\u043d\u0434, \u0434\u0430\u0436\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0447\u0438!).<\/p>\n<p>  \u0412\u0441\u0435 \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043f\u0440\u0438 \u00ab\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445\u00bb \u043e\u0431\u0437\u0432\u043e\u043d\u0430\u0445 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u043c\u0435\u0441\u044f\u0446\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. \u0422\u0435 \u0441\u0430\u043c\u044b\u0435 20\u0413\u0431 \u0443\u043b\u0435\u0442\u0430\u044e\u0442 \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e! \u0410 \u0445\u043e\u0441\u0442\u0435\u0440, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 fuse \u043d\u0430 \u0442\u0430\u0440\u0438\u0444\u0430\u0445 OpenVZ, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u00ab\u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u2014 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u00bb, \u0432\u0440\u043e\u0434\u0435 ftpfs.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u0438\u0437\u043b\u043e\u0436\u0443 \u043c\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043c\u0435\u0440 \u043f\u043e \u0431\u043e\u0440\u044c\u0431\u0435 \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0441 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u043c \/var\/spool\/asterisk\/monitor, \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 .wav \u0444\u0430\u0439\u043b\u044b, \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 asterisk \u043f\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c: \u0433\u043e\u0434, \u043c\u0435\u0441\u044f\u0446 \u0438 \u0434\u0435\u043d\u044c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-257657","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257657"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257657\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}