{"id":193586,"date":"2013-09-13T08:47:02","date_gmt":"2013-09-13T04:47:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=193586"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=193586","title":{"rendered":"<span class=\"post_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u043d\u0430 perl \u0447\u0435\u0440\u0435\u0437 usb \u043c\u043e\u0434\u0435\u043c Huawei e1550<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"http:\/\/habrahabr.ru\/post\/192930\/\">\u043f\u043e\u0441\u0442<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0430\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438, \u0438 \u043e\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u043e\u0431\u0437\u0432\u043e\u043d (\u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435) \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 usb \u043c\u043e\u0434\u0435\u043c Hyawei e1550. \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0431\u044b\u043b \u0437\u0430\u0434\u0430\u043d <a href=\"http:\/\/habrahabr.ru\/post\/192930\/#comment_6701910\">\u0432\u043e\u043f\u0440\u043e\u0441<\/a> \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043e\u043a \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430. \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e, \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:<br \/>   \u2014 \u0437\u0430\u043f\u0438\u0441\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<br \/>   \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434<br \/>  \u0412\u0441\u0435 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 DTMF \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0413\u0451\u0440\u0446\u0435\u043b\u044f. <br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u043e\u043d\u0443\u0441\u0430 \u2014 \u0430\u0440\u0445\u0438\u0432 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 perl-\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h5>\u0421\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/h5>\n<p>  \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430: Linux<br \/>  \u0414\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432: openSUSE 12.3<br \/>  \u042f\u0434\u0440\u043e: 3.7.10-1.16-desktop #1 SMP PREEMPT Fri May 31 20:21:23 UTC 2013 (97c14ba) i686 i686 i386 GNU\/Linux<br \/>  \u042f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: Perl<br \/>  usb \u043c\u043e\u0434\u0435\u043c: Huawei e1550<\/p>\n<h5>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c<\/h5>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u0430\u043f\u043a\u0438:<br \/>  1. voice_menu.pl \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e<br \/>  2. dtmf_decoder.pm \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f dtmf \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 (\u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0442\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430)<br \/>  3. menu.01.pl \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e<br \/>  4. menu.01 \u2014 \u043f\u0430\u043f\u043a\u0430 \u0441 \u0430\u0443\u0434\u0438\u043e \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0434\u043b\u044f menu.01.pl<br \/>  5. messages \u2014 \u043f\u0430\u043f\u043a\u0430 \u0441 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/p>\n<p>  voice_menu.pl  <\/p>\n<pre><code>#!\/usr\/bin\/perl  use v5.16;              # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e Perl \u043d\u0435 \u043d\u0438\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 use strict;             # \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 use warnings;           # \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 use diagnostics;        # \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a use utf8; use locale; no warnings 'utf8';  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c Time::HiRes \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c # \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u044e sleep # \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 - \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c # \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0435\u043a\u0443\u043d\u0434\u044b use Time::HiRes qw(sleep usleep gettimeofday);  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c dtmf_decoder use dtmf_decoder;   # \u0414\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438: # \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 CEND \u0432\u044b\u0434\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043c\u043e\u043c \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 # \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u044b\u0437\u043e\u0432\u0435, \u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 # \u0438 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. # \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 ^CEND:call_index, duration, end_status, cc_cause # \u0433\u0434\u0435: # call_index - \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 # duration - \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 # end_status - \u043a\u043e\u0434 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 # cc_cause - \u043a\u043e\u0434 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430  # \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0435\u043c\u0430 \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443 \u0441 OS Linux # \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f 3 usb \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043c\u043e\u0434\u0435\u043c\u043e\u043c # \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e: # \/dev\/ttyUSB0 - \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u043e\u0434\u0435\u043c\u0430 # \/dev\/ttyUSB1 - \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439(\u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u043e\u0434\u0435\u043c\u0430 # \/dev\/ttyUSB2 - \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u043e\u0434\u0435\u043c\u0430. \u041e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \/dev\/ttyUSB0 \u0442\u0435\u043c # \u0447\u0442\u043e \u0441 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0432\u0435\u0442\u044b \u043c\u043e\u0434\u0435\u043c\u0430 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 # \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u0432\u044b\u0432\u043e\u0434 ^CEND \u0438 \u043f\u0440\u043e\u0447\u0435\u0435  # \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043e\u0442\u0441\u044b\u043b\u043a\u0438 \u043c\u043e\u0434\u0435\u043c\u0443 \u0437\u0432\u0443\u043a\u0430 my $VOICE_PORT = &quot;\/dev\/ttyUSB4&quot;;  # \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u0447\u0438 \u043c\u043e\u0434\u0435\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434 my $COMMAND_PORT = &quot;\/dev\/ttyUSB5&quot;;  # \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432: # 0 - \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 # 1 - \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 my $VERBOSE = 0;  # \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0435\u043c\u0430 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c open my $SENDPORT, '+&lt;', $COMMAND_PORT or die &quot;Can't open '$COMMAND_PORT': $!\\n&quot;;  # \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439  \u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0435\u043c\u0430 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c # \u0447\u0442\u0435\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0438\u0437 \u043f\u043e\u0440\u0442\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f # \u043d\u043e \u0432\u0430\u043c \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0430\u0432\u0442\u043e\u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 open my $SENDPORT_WAV, '+&lt;', $VOICE_PORT or die &quot;Can't open '$VOICE_PORT': $!\\n&quot;;   # \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f 1 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440: #  - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u043c \u043c\u0435\u043d\u044e expect_calls('menu.01.pl');  # \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u043e\u0431\u0437\u0432\u043e\u043d\u0430 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0444\u0430\u0439\u043b\u044b\/\u043f\u043e\u0440\u0442\u044b exit_call();    # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0431\u0437\u0432\u043e\u043d \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 sub expect_calls{     # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u043c \u043c\u0435\u043d\u044e     my $l_file = shift;      # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e (\u0444\u0430\u0439\u043b menu.01.pl)     my $menu = load_menu('menu.01.pl');       # \u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u043c\u043e\u0434\u0435\u043c\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0440\u0435\u0436\u0438\u043c     # \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432\u043a\u043b\u044e\u0447\u0438\u0432 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c\/\u0437\u0430\u0440\u0435\u043c\u0430\u0440\u0438\u0442\u044c     # \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u041c\u043e\u0434\u0435\u043c \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.     #at_send('AT^CVOICE=0');       # \u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u043c\u043e\u0434\u0435\u043c\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u0433\u043e     my $l_rec = at_send(&quot;AT+CLIP=1&quot;,qr\/^(OK|ERROR)\/);       # \u0446\u0438\u043a\u043b \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0437\u0432\u043e\u043d\u043a\u0430     while ( ) {         # \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u0437\u0432\u043e\u043d\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 RING         $l_rec = at_rec(qr\/^(RING)\/);         accept_call($menu);     } }   # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u0443\u043a\u0430\u0437\u043d\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 # \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 - \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 sub accept_call{     my $menu = shift;      # \u0432 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u0442t\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u043f\u043e \u043c\u0435\u043d\u044e     my $position = [$menu];      # \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043c\u0435\u043d\u044e     my $cmenu = $position-&gt;[0];      my %call_info = ();     # \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430     $call_info{start_time} = time;     # \u0436\u0434\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u0433\u043e \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430 #+CLIP: &quot;+79117654321&quot;,145,,,,0     $call_info{phone} = at_rec(qr\/^\\+CLIP\\: \\&quot;(\\+\\d+)\/);     $call_info{phone} =~s\/^\\+\\d\/\/;     # \u0433\u0435\u043d\u0435\u0440\u0438\u043c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438     $call_info{record_fname} = &quot;phone_$call_info{phone}.time_$call_info{start_time}&quot;;      # \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432     my $l_rec = at_send(&quot;ATA&quot;,qr\/^(OK|ERROR)\/);     return 0 if $l_rec eq &quot;ERROR&quot;;      # \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f     $l_rec = at_rec(qr\/^\\^??(CONN\\:1|CEND\\:|ERROR)\/);     return 0 if $l_rec ne &quot;CONN:1&quot;;      # \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043c \u0432 \u0440\u0435\u0436\u0438\u043c \u043f\u0440\u0438\u0435\u043c\u0430\/\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0433\u043e\u043b\u043e\u0441\u0430     # OK - \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e     # ERROR - \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043e     # CEND:.... - \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0437\u0430\u043d\u044f\u0442 \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0441\u0438\u043b \u0432\u044b\u0437\u043e\u0432     $l_rec = at_send('AT^DDSETEX=2',qr\/(OK|ERROR|CEND\\:)\/);     return 0 if $l_rec ne &quot;OK&quot;;      # \u0415\u0441\u043b\u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u0441\u044e\u0434\u0430 - \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d     # \u0417\u0432\u0443\u043a \u043c\u043e\u0434\u0435\u043c\u0443 \u0438 \u043e\u0442 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438 \u043f\u043e 320 \u0431\u0430\u0439\u0442 \u043a\u0430\u0436\u0434\u044b\u0435 0.02 \u0441\u0435\u043a\u0443\u043d\u0434\u044b     print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phone}] \\t&quot;.&quot;\u0412\u044b\u0437\u043e\u0432 \u043f\u0440\u0438\u043d\u044f\u0442.\\n&quot;;      my $checker = 0;      my $dtmf = 0;      # \u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445     my $snd_in;          # \u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445     my $snd_out = $cmenu-&gt;{info_voice};     my $snd_count = 0;     my $snd_max = scalar @{$snd_out};      # \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a\u0430     my $l_fh = new IO::File &quot;&gt; .\/messages\/$call_info{record_fname}.raw&quot; or die &quot;Cannot open $call_info{record_fname}.raw : $!&quot;;     binmode($l_fh);      # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e $| \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u044d\u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e.     # \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u043f\u043e\u0440\u0442 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e.     $|=1;      # \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438     #play_voice($snd_out);      # \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u0442\u0441\u0447\u0435\u0442\u0430 0.02 \u0441\u0435\u043a\u0443\u043d\u0434     my $before = gettimeofday;      # \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0438\u043a\u043b \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e     while (){         if ($snd_count == $snd_max) {             if ($cmenu-&gt;{record}==1){                     $snd_out = $menu-&gt;{standart_messages}{null}{title_voice};                     $snd_max = scalar @{$snd_out};                     $cmenu-&gt;{record}=2;                     print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phone}] \\t\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 [.\/messages\/$call_info{record_fname}.raw].\\n&quot;;             }              $snd_count = 0;         }          syswrite  $SENDPORT_WAV, $snd_out-&gt;[$snd_count] , 320;          sysread $SENDPORT_WAV, $snd_in, 320;         syswrite  $l_fh, $snd_in, 320 if $cmenu-&gt;{record} && $cmenu-&gt;{record} == 2;          $dtmf = dtmf_sample($snd_in);          if ($dtmf) {             #print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phoe}] \\t\u041d\u0430\u0436\u0430\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 [$dtmf].\\n&quot;;             if ($dtmf eq '#') {                 print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phone}] \\t\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e.\\n&quot;;                 $position = [$menu];                 $cmenu = $position-&gt;[0];                 $snd_out = $menu-&gt;{info_voice};                 $snd_count = 0;                 $snd_max = scalar @{$snd_out};             } elsif ($dtmf eq '*') {                 if ((scalar @{$position}) &gt; 1) {                     print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phone}] \\t\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043c\u0435\u043d\u044e.\\n&quot;;                     shift @{$position};                     $cmenu = $position-&gt;[0];                     $snd_out = $cmenu-&gt;{info_voice};                     $snd_count = 0;                     $snd_max = scalar @{$snd_out};                 }             } elsif ($cmenu-&gt;{menu}) {                 if ($cmenu-&gt;{menu}{$dtmf}) {                     $cmenu = $cmenu-&gt;{menu}{$dtmf};                     print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phone}] \\t\u0412\u044b\u0431\u0440\u0430\u043d \u043f\u0443\u043d\u043a\u0442 \u043c\u0435\u043d\u044e [$cmenu-&gt;{title}].\\n&quot;;                     unshift @{$position}, $cmenu;                     $snd_out = $cmenu-&gt;{info_voice};                     $snd_count = 0;                     $snd_max = scalar @{$snd_out};                     if ($cmenu-&gt;{command}) {                         print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phone}] \\t\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 [$cmenu-&gt;{command}].\\n&quot;;                         system &quot;$cmenu-&gt;{command} &&quot;;                     }                 }              }         }          # \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u0432\u043e\u043d\u043a\u0430         if ($checker==10) {             $l_rec = at_send(&quot;AT+CLCC&quot;,qr\/^\\^??(OK|ERROR|CEND)\/);             # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0435\u0441\u043b\u0438 \u0441\u0431\u0440\u043e\u0448\u0435\u043d             if ($l_rec eq &quot;CEND&quot;) {                 print &quot;time: [$call_info{start_time}] \\tphone: [$call_info{phone}] \\t\u0412\u044b\u0437\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d.\\n&quot;;                 return 0             }             $checker=0;         }          # \u0440\u044f\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0446\u0438\u043a\u043b\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445         $dtmf=0;         $checker++;         $snd_count++;          # \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438         while( gettimeofday-$before &lt; 0.02 ) { }         $before = gettimeofday;     }      # \u0412\u0435\u0448\u0430\u0435\u043c \u0442\u0440\u0443\u0431\u043a\u0443.     at_send('AT+CHUP');      # \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c     close $l_fh; }  sub play_voice{     my $voice = shift;     my $count = shift || 1;     while ($count) {         for my $sampe (@{$voice}){             syswrite  $SENDPORT_WAV, $sampe, 320;             #sleep(0.02);             my $before = gettimeofday;             while( gettimeofday-$before &lt; 0.02 ) { }         }         $count--;     } }  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e sub load_menu{     my $l_file_name = shift;     my %voice_menu = do $l_file_name;     $voice_menu{standart_messages}{null}{title_voice} = load_voice($voice_menu{standart_messages}{null}{title_voice_fname});     $voice_menu{standart_messages}{back}{title_voice} = load_voice($voice_menu{standart_messages}{back}{title_voice_fname});     $voice_menu{standart_messages}{back_to_main}{title_voice} = load_voice($voice_menu{title_voice_fname});     load_menu_voices(\\%voice_menu,$voice_menu{standart_messages});     return \\%voice_menu; }  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0430\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b\u044b \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e sub load_menu_voices{     my $menu = shift;     my $standart_messages = shift;     $menu-&gt;{info_voice} = load_voice($menu-&gt;{info_voice_fname});     for my $key (sort {$a &lt;=&gt; $b} keys %{$menu-&gt;{menu}}){         my $cur = $menu-&gt;{menu}{$key};         my $sub_voice = load_menu_voices($cur,$standart_messages);         $menu-&gt;{info_voice} = [@{$menu-&gt;{info_voice}},@{$sub_voice}];     }     $menu-&gt;{info_voice} = [ @{$menu-&gt;{info_voice}},                             @{$standart_messages-&gt;{back}{title_voice}},                             @{$standart_messages-&gt;{back_to_main}{title_voice}},                             @{$standart_messages-&gt;{null}{title_voice}},                             @{$standart_messages-&gt;{null}{title_voice}}                           ];     return load_voice($menu-&gt;{title_voice_fname}); }  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u0443\u0441\u043a\u0430\u043c\u0438 \u043f\u043e 320 \u0431\u0430\u0439\u0442 # \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 1 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 # \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 - pcm, \u043c\u043e\u043d\u043e, 8000 \u043a\u0413\u0446, 16 \u0431\u0438\u0442, signed sub load_voice{     my $l_file_name = shift;     print &quot;FILENAME: [$l_file_name]\\n&quot;;     my $l_fh = new IO::File &quot;&lt; $l_file_name&quot; or die &quot;Cannot open $l_file_name : $!&quot;;     binmode($l_fh);     my @l_bufer = ();     my $i=0;     while (read($l_fh,$l_bufer[$i],320)) { $i++; }     close $l_fh;     return \\@l_bufer; }   # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0435\u043c\u0430 # \u0438 \u0436\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 # \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 2 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: # 1-\u0439 - \u043a\u043e\u043c\u0430\u043d\u0434\u0430 # 2-\u0439 - \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e OK) sub at_send{     my $l_cmd = shift;     my $l_rx = shift || qr\/(OK)\/;     print $SENDPORT &quot;$l_cmd\\r&quot;;     print &quot;SEND: [$l_cmd]\\n&quot; if $VERBOSE;     return at_rec($l_rx); }   # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0436\u0434\u0435\u0442 \u043e\u0442 \u043c\u043e\u0434\u0435\u043c\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438  # \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 1 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 - \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e OK) sub at_rec{     my $l_rx = shift || qr\/OK\/;     my $recive='';     #print &quot;white: [$l_rx]\\n&quot;;     until ( $recive=~$l_rx ) { \t   $recive=&lt;$SENDPORT&gt;; \t   $recive=~s\/[\\n\\r]+\/\/msg; \t   print &quot;RECIVE: [$recive]\\n&quot; if $VERBOSE && $recive;     }     $recive=~$l_rx;     print &quot;END RECIVE: [$recive] [$1] [$l_rx]\\n&quot; if $VERBOSE;     return $1; }   # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u043d\u0435\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u043c\u043e\u0434\u0435\u043c\u0430 sub exit_call{     print &quot;\u041e\u041f\u041e\u0412\u0415\u0429\u0415\u041d\u0418\u0415 \u041e\u041a\u041e\u041d\u0427\u0415\u041d\u041e\\n&quot;;     close $SENDPORT_WAV;     at_send('AT+CHUP');     close $SENDPORT; } <\/code><\/pre>\n<p>  dtmf_decoder.pm  <\/p>\n<pre><code># \u043c\u043e\u0434\u0443\u043b\u044c: dtmf_detect # \u0430\u0432\u0442\u043e\u0440:  lastuniverse # \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u0442 \u0421\u0438 \u043a\u043e\u0434 Mr. Blue: #   http:\/\/www.phrack.org\/issues.html?issue=50&id=13 # \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0413\u0451\u0440\u0446\u0435\u043b\u044f  #   http:\/\/ru.wikipedia.org\/wiki\/%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC_%D0%93%D1%91%D1%80%D1%86%D0%B5%D0%BB%D1%8F #   http:\/\/www.dsplib.ru\/content\/goertzel\/goertzel.html  use v5.16;              # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e Perl \u043d\u0435 \u043d\u0438\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 use strict;             # \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 use warnings;           # \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 use diagnostics;        # \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a use utf8; use locale;  package dtmf_decoder;   # \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d  require Exporter;               # \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Exporter our @ISA = qw(Exporter);        # \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u043d\u0435\u043c   our @EXPORT = qw(dtmf_sample dtmf_clear);   # \u0438\u043c\u0435\u043d\u0430, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e our @EXPORT_OK = qw(_recalc );              # \u0438\u043c\u0435\u043d\u0430, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443  # \u0432 \u044d\u0442\u043e\u043c \u0445\u044d\u0448 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 my %o = (   # \u0445\u044d\u0448 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b   # \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0413\u0451\u0440\u0446\u0435\u043b\u044f   f =&gt; {     '697' =&gt; { K =&gt; 0, C =&gt; 0 },     '770' =&gt; { K =&gt; 0, C =&gt; 0 },     '852' =&gt; { K =&gt; 0, C =&gt; 0 },     '941' =&gt; { K =&gt; 0, C =&gt; 0 },     '1209' =&gt; { K =&gt; 0, C =&gt; 0 },     '1336' =&gt; { K =&gt; 0, C =&gt; 0 },     '1477' =&gt; { K =&gt; 0, C =&gt; 0 },     '1633' =&gt; { K =&gt; 0, C =&gt; 0 },   },   # \u0441\u043f\u0438\u0441\u043e\u043a \u0447\u0430\u0441\u0442\u043e\u0442 \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b dtmf \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432   #          1209 \u0413\u0446   1336 \u0413\u0446   1477 \u0413\u0446   1633 \u0413\u0446   # 697 \u0413\u0446   1         2         3         A    # 770 \u0413\u0446   4         5         6         B   # 852 \u0413\u0446   7         8         9         C   # 941 \u0413\u0446   *         0         #         D      rf =&gt; [ '697', '770', '852', '941' ],   cf =&gt; [ '1209', '1336', '1477', '1633' ],   # \u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0445\u044d\u0448 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 dtmf \u0441\u0438\u0433\u043d\u0430\u043b\u0430   dtmf =&gt; {     '697' =&gt; { '1209' =&gt; 1, '1336' =&gt; 2, '1477' =&gt; 3, '1633' =&gt; 4 },     '770' =&gt; { '1209' =&gt; 5, '1336' =&gt; 6, '1477' =&gt; 7, '1633' =&gt; 8  },     '852' =&gt; { '1209' =&gt; 9, '1336' =&gt; 10, '1477' =&gt; 11, '1633' =&gt; 12  },     '941' =&gt; { '1209' =&gt; 13, '1336' =&gt; 14, '1477' =&gt; 15, '1633' =&gt; 16  },   },   # \u0421\u043f\u0438\u0441\u043e\u043a \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0439 dtmf \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 (\u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f    # \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 dtmf)   # \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c - \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u0433\u043d\u043e\u043f\u043a\u0438   info =&gt; ['NONE', '1', '2', '3', 'A', '4', '5', '6', 'B', '7', '8', '9', 'C', '*', '0', '#', 'D'],   # \u0434\u0430\u043b\u0435\u0435 \u0438\u0434\u0443\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430   tones =&gt; 0,   # \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442   rate =&gt; 8000, # \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043e\u0446\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430   len =&gt; 100,   # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0437\u0430 \u0440\u0430\u0437                 # \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u0438\u0437 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 \u0440\u0430\u0437 \u043f\u0430\u043a\u0435\u0442 \u0438\u0437 320 \u0431\u0430\u0439\u0442                 # \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0430\u0443\u0434\u0438\u043e \u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0434\u0435\u043c\u0430 (2 \u0431\u0430\u0439\u0442\u0430 \u043d\u0430 1 \u043e\u0446\u0438\u0444\u0440\u043e\u0432\u043a\u0443)                  # (\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b \u0434\u043e 100 \u0434\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438)   range =&gt; 0.15,      # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438   thresh =&gt; 99999999, # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u0441\u0435\u043a\u0430\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0441 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u0435\u043d\u044c\u0448\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439   mincount =&gt; 4,      # \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438                       # \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0447\u0438\u0442\u0430\u043b \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0430\u0436\u0430\u0442\u043e\u0439                       # range, thresh \u0438 mincount \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c                       # \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 dtmf \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0438 \u043f\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435                       # \u0448\u0443\u043c\u043e\u0432\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b.    debug =&gt; 0,     # \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438     # \u0445\u044d\u0448 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430   t =&gt; {     mincount =&gt; 0,     sample =&gt; [],     power =&gt;  {},     maxpower =&gt; 0,     thresh =&gt; 0,     on    =&gt;  {},     last_dtmf =&gt; ''   } );  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0441\u0447\u0435\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 sub _recalc {   $o{tones} = scalar keys %{$o{f}};   for my $f (sort { $a &lt;=&gt; $b } keys %{$o{f}}) {     $o{f}{$f}{K} = $o{len} * $f \/ $o{rate};     $o{f}{$f}{C} = 2.0 * cos( 2.0 * 3.14159265 * $o{f}{$f}{K} \/ $o{len} );     print &quot;COEFF: [$f] \\t[$o{f}{$f}{K}] \\t[$o{f}{$f}{C}]\\n&quot; if $o{debug};   } }  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0441\u0447\u0435\u0442 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u043a (\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442) sub _calc_power {   my $freq_list = shift;   my @fk = @{$freq_list};   my %ff = %{$o{f}};   my %fp = %{$o{t}{power}};    my %u0 = ();   my %u1 = ();   my $t  = 0.0;   my $in = 0.0;   my $i  = 0;    for my $f (@fk) {     $u0{$f} = 0.0;     $u1{$f} = 0.0;   }    while ($i&lt;$o{len}) {   # feedback     $in = $o{t}{sample}[$i] || 0; # &gt;&gt; 7;     for my $f (@fk) {       $t = $u0{$f};       $u0{$f} = $in + $ff{$f}{C} * $u0{$f} - $u1{$f};       $u1{$f} = $t;     }     $i++;   }    print &quot;MAXPOWER: [&quot; if $o{debug} &gt; 1;   for my $f (@fk) {     $o{t}{power}{$f} = $u0{$f} * $u0{$f} + $u1{$f} * $u1{$f} - $ff{$f}{C} * $u0{$f} * $u1{$f};      $o{t}{maxpower} = $o{t}{power}{$f} if $o{t}{power}{$f} &gt; $o{t}{maxpower};     print &quot;$o{t}{maxpower}, &quot; if $o{debug} &gt; 1;   }   print &quot;]\\n&quot; if $o{debug} &gt; 1; }  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u0441\u0435\u043a\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u043c\u043e\u0449\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043d\u0438\u0436\u0435 $o{t}{maxpower} # \u0440\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u043d\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0447\u0430\u0441\u0442\u043e\u0442 # \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 $o{t}{on}{$f} sub _midle_calc {   my $freq_list = shift;   my @fl = @{$freq_list};   _calc_power($freq_list);    return 0 if $o{t}{maxpower} &lt; $o{thresh};   $o{t}{thresh} = $o{range}  * $o{t}{maxpower};      my $on_count = 0;   for my $f (@fl) {     if ($o{t}{power}{$f} &gt; $o{t}{thresh}) {       $o{t}{on}{$f} = 1;       $on_count++;     } else {       $o{t}{on}{$f} = 0;     }        }   return $on_count; }  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430\u043b\u0438\u0447\u0438\u044f 2-\u0445 \u0447\u0430\u0441\u0442\u043e\u0442 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 # 1-\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u0447\u0430\u0441\u0442\u043e\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0445 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b dtmf # \u0438 1-\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u0447\u0430\u0441\u0442\u043e\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0445 \u043d\u043e\u043c\u0435\u0440 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b dtmf # \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430 - \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 dtmf (\u043d\u043e\u043c\u0435\u0440) sub _decode {   my $row_count = _midle_calc($o{rf});   return 0 unless $row_count;    my $col_count += _midle_calc($o{cf});   return 0 unless $col_count;   return 0 unless $row_count == 1 && $col_count == 1;   for my $dtmf (@{$o{rf}}) {     if ($o{t}{on}{$dtmf}) {       for my $f (@{$o{cf}}) {         return $o{dtmf}{$dtmf}{$f} if $o{t}{on}{$f};       }     }   }   #return 0 if $on_count == 0;   return 0;  }  # \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430\u043b\u0438\u0447\u0438\u044f dtmf \u0441\u0438\u0433\u043d\u0430\u043b\u0430 # \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0435\u0433\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (mincount) \u043e\u0442\u0441\u0435\u043a\u0430\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f # \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 info sub _analise {   my $x = _decode();   _sample_clear();   #return $x;    if ($x && $x == $o{t}{last_dtmf}){     $o{t}{mincount}++;   } else {     if ( $o{t}{last_dtmf} && $x != $o{t}{last_dtmf} ) {       if ($o{t}{mincount} &gt;= $o{mincount}){         my $r = $o{t}{last_dtmf};         $o{t}{last_dtmf} = $x;         return $r;       }     }     $o{t}{mincount} = 0;   }      $o{t}{last_dtmf} = $x;   return 0; }  # \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u0447\u0438\u0441\u0442\u043a\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 # \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u043c\u043e\u0449\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 sub _sample_clear {   $o{t}{sample} = [];   $o{t}{power} = {};   $o{t}{maxpower} = 0;   $o{t}{on} = {};   $o{t}{thresh} = 0; }  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u0447\u0438\u0441\u0442\u043a\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 # \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 sub dtmf_clear {   _sample_clear();   $o{t}{mincount} = 0;   $o{t}{last_dtmf} = {}; }  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0430\u043a\u0435\u0442 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445 # \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 # \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f dtmf \u0441\u0438\u0433\u043d\u0430\u043b\u0430 sub dtmf_sample {   my $_ = shift;   my @a = unpack(&quot;s$o{len}&quot;);   $o{t}{sample} = \\@a;   my $x = _analise();    print &quot;DTMF: [&quot;.$o{info}[$x].&quot;]\\n&quot; if $x; #&& $o{debug};   return $o{info}[$x] if $x;  }  # \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0440\u0430\u0441\u0447\u0435\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f _recalc();  1; <\/code><\/pre>\n<p>  menu.01.pl  <\/p>\n<pre><code>use utf8; use locale; ( \tstandart_messages =&gt; { \t\tback =&gt; { \t\t\ttitle =&gt; &quot;\u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043c\u0435\u043d\u044e&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/back.raw&quot; # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043c\u0435\u043d\u044e \u043d\u0430\u0436\u043c\u0438\u0442\u0435 *) \t\t}, \t\tnull =&gt; { \t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/null.raw&quot; # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043c\u0435\u043d\u044e \u043d\u0430\u0436\u043c\u0438\u0442\u0435 *) \t\t} \t}, \ttitle =&gt; &quot;\u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/main.menu.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u0432\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043c\u0435\u043d\u044e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0431\u043b\u0430-\u0431\u043b\u0430-\u0431\u043b\u0430) \ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/main.menu.title.raw&quot;,       # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u043d\u0430\u0436\u043c\u0438\u0442\u0435 #) \tmenu =&gt; { \t\t'1' =&gt; { \t\t\ttitle =&gt; &quot;\u043e \u043d\u0430\u0441&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.1.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u043d\u0430\u0448\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0443\u0441\u043b\u0443\u0433 \u0432 \u0441\u0444\u0435\u0440\u0435 \u0431\u043b\u0430-\u0431\u043b\u0430-\u0431\u043b\u0430) \t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.1.title.raw&quot;       # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 1) \t\t}, \t\t'2' =&gt; { \t\t\ttitle =&gt; &quot;\u043d\u0430\u0448\u0438 \u0443\u0441\u043b\u0443\u0433\u0438&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.2.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u0432\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043c\u0435\u043d\u044e - \u043d\u0430\u0448\u0438 \u0443\u0441\u043b\u0443\u0433\u0438) \t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.2.title.raw&quot;,      # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u043d\u0430\u043c\u0438 \u0443\u0441\u043b\u0443\u0433\u0430\u043c\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 2) \t\t\tmenu =&gt; { \t\t\t\t'1'\t=&gt; { \t\t\t\t\ttitle =&gt; &quot;\u043d\u0430\u0431\u0438\u0442\u044c \u043c\u043e\u0440\u0434\u0443 \u0441\u043e\u0441\u0435\u0434\u0443&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\t\t\tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.2.1.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u0441\u043b\u0443\u0433\u0438 &quot;\u043d\u0430\u0431\u0438\u0442\u044c \u043c\u043e\u0440\u0434\u0443 \u0441\u043e\u0441\u0435\u0434\u0443&quot; \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043b\u0430-\u0431\u043b\u0430-\u0431\u043b\u0430) \t\t\t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.2.1.title.raw&quot;    # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u043b\u0443\u0433\u0438 &quot;\u043d\u0430\u0431\u0438\u0442\u044c \u043c\u043e\u0440\u0434\u0443 \u0441\u043e\u0441\u0435\u0434\u0443&quot; \u043d\u0430\u0436\u043c\u0438\u0442\u0435 1) \t\t\t\t}, \t\t\t\t'2'\t=&gt; { \t\t\t\t\ttitle =&gt; &quot;\u0441\u043f\u0440\u043e\u0432\u0430\u0434\u0438\u0442\u044c \u0442\u0435\u0449\u0443&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\t\t\tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.2.2.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u0441\u043b\u0443\u0433\u0438 &quot;\u0441\u043f\u0440\u043e\u0432\u0430\u0434\u0438\u0442\u044c \u0442\u0435\u0449\u0443&quot; \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043b\u0430-\u0431\u043b\u0430-\u0431\u043b\u0430) \t\t\t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.2.2.title.raw&quot;    # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u043b\u0443\u0433\u0438 &quot;\u0441\u043f\u0440\u043e\u0432\u0430\u0434\u0438\u0442\u044c \u0442\u0435\u0449\u0443&quot; \u043d\u0430\u0436\u043c\u0438\u0442\u0435 2) \t\t\t\t},  \t\t\t}\t\t\t \t\t}, \t\t'9' =&gt; { \t\t\ttitle =&gt; &quot;\u043f\u043e\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0430\u043d\u0435\u043a\u0434\u043e\u0442&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.9.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u0430\u043d\u0435\u043a\u0434\u043e\u0442) \t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.9.title.raw&quot;       # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0430\u043d\u0435\u043a\u0434\u043e\u0442 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 9) \t\t}, \t\t'8' =&gt; { \t\t\ttitle =&gt; &quot;\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.8.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e \u0443\u0434\u0430\u043b\u0435\u043d\u043e) \t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.8.title.raw&quot;,      # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 &quot;\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e&quot; \u043d\u0430\u0436\u043c\u0438\u0442\u0435 8) \t\t\tcommand\t=&gt; 'echo &quot;\u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c -&gt; rm -R *&quot;' \t\t}, \t\t'7' =&gt; { \t\t\ttitle =&gt; &quot;\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435&quot;, # \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433 \t\t\tinfo_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.7.info.raw&quot;,\t# \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043c\u0435\u043d\u044e\t(\u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0433\u0443\u0434\u043a\u0430) \t\t\ttitle_voice_fname\t=&gt; &quot;.\/menu.01\/sub.menu.7.title.raw&quot;,      # \u043e\u0437\u0432\u0443\u0447\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u043d\u044e (\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 7) \t\t\trecord\t=&gt; 1 \t\t} \t} ); <\/code><\/pre>\n<h5>\u041e\u0431\u0435\u0449\u0430\u043d\u043d\u044b\u0439 \u0431\u043e\u043d\u0443\u0441<\/h5>\n<p>  <a href=\"http:\/\/80.237.22.134\/habr\/huawei.voice.menu.rar\">\u0430\u0440\u0445\u0438\u0432 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438<\/a> \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0445\u0430\u0431\u0440\u0430\u043f\u0430\u0440\u0441\u0435\u0440\u0430<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043b\u0438\u0447\u043a\u0443, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044e.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/193586\/\"> http:\/\/habrahabr.ru\/post\/193586\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"http:\/\/habrahabr.ru\/post\/192930\/\">\u043f\u043e\u0441\u0442<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0430\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438, \u0438 \u043e\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u043e\u0431\u0437\u0432\u043e\u043d (\u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435) \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 usb \u043c\u043e\u0434\u0435\u043c Hyawei e1550. \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0431\u044b\u043b \u0437\u0430\u0434\u0430\u043d <a href=\"http:\/\/habrahabr.ru\/post\/192930\/#comment_6701910\">\u0432\u043e\u043f\u0440\u043e\u0441<\/a> \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043e\u043a \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430. \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e, \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:<br \/>   \u2014 \u0437\u0430\u043f\u0438\u0441\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<br \/>   \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434<br \/>  \u0412\u0441\u0435 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 DTMF \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0413\u0451\u0440\u0446\u0435\u043b\u044f. <br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u043e\u043d\u0443\u0441\u0430 \u2014 \u0430\u0440\u0445\u0438\u0432 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 perl-\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u044e.  <\/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-193586","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/193586","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=193586"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/193586\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}