Журнал лабораторных работ

Содержание

Журнал

Четверг (11/27/14)

/dev/pts/3
11:10:12
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.15955.30703	2014-11-27 12:10:16.370853213 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 12:17:21.210858256 +0200
@@ -12,9 +12,11 @@
 exten => _s,n,Playback(/var/tmp/asterisk/record/record04)
 
 
-exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt) 
-exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt) 
-exten => 3,1,Playback(/var/tmp/asterisk/record05)
+
+
+exte => 3,1,Playback(/var/tmp/asterisk/record05)GI(/usr/local/bin/asterisk-festival.pl,/var/tmp/asterisk/belki.txt)                                |
+exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/asterisk/burunduki.txt) 
+
 exten => 3,n,Read(ORDER)
 exten => 3,n,Playback(/var/tmp/asterisk/record07)
 exten => 3,n,SayDigits(${ORDER})
11:17:27
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.28270.14573	2014-11-27 12:17:29.818858343 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 13:03:55.814891312 +0200
@@ -5,23 +5,31 @@
 exten => _81XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2})
 
 [menu]
-exsten => s,1,Answer
-exten => _s,n,Playback(/var/tmp/asterisk/record/record01)
-exten => _s,n,Playback(/var/tmp/asterisk/record/record02)
-exten => _s,n,Playback(/var/tmp/asterisk/record/record03)
-exten => _s,n,Playback(/var/tmp/asterisk/record/record04)
+exten => s,1,Answer
+exten => s,n,Background(/var/tmp/asterisk/record01)
+exten => s,n,WaitExten(1)
+; метки (labels) ставятся с помощью скобочек после n
+exten => s,n(start),Background(/var/tmp/asterisk/record02)
+exten => s,n,WaitExten(3)
+exten => s,n,Background(/var/tmp/asterisk/record03)
+exten => s,n,WaitExten(3)
+exten => s,n,Background(/var/tmp/asterisk/record04)
+exten => s,n,Hangup
 
 
+exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
+exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
 
 
-exte => 3,1,Playback(/var/tmp/asterisk/record05)GI(/usr/local/bin/asterisk-festival.pl,/var/tmp/asterisk/belki.txt)                                |
-exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/asterisk/burunduki.txt) 
 
+exten => 3,1,Playback(/var/tmp/asterisk/record05)
 exten => 3,n,Read(ORDER)
 exten => 3,n,Playback(/var/tmp/asterisk/record07)
 exten => 3,n,SayDigits(${ORDER})
 exten => 3,n,Playback(/var/tmp/asterisk/record10)
 
+exten => 4,1,Queue(queue1)
+
 exten => 0,1,Goto(s,start)
 
 ; i = invalid (extension)
прошло 46 минут
12:04:01
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2576)
Verbosity is at least 3
  == Using SIP RTP CoS mark 5
[Nov 27 13:04:12] NOTICE[2704]: chan_sip.c:22753 handle_request_invite: Call from '1301' (192.168.30.100:5060) to extension '8405' rejected because extension not found in context 'gr1'.
debian3*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
12:04:32
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.26324.2301	2014-11-27 13:04:35.106891780 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 13:06:30.094893141 +0200
@@ -4,6 +4,8 @@
 exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm)
 exten => _81XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2})
 
+
+
 [menu]
 exten => s,1,Answer
 exten => s,n,Background(/var/tmp/asterisk/record01)
@@ -39,7 +41,6 @@
 ; привязать к номеру
 
 ; при 8405 переход на меню
-exten => 8405,1,Goto(menu,s,1)
 
 
 
@@ -83,6 +84,8 @@
 exten => 8404,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
 
 
+exten => 8405,1,Goto(menu,s,1)
+
 [national]
 exten =>_23XX,1,Dial(SIP/brest/${EXTEN})
 
прошло 16 минут
12:21:26
#vim /etc/asterisk/extensions.conf
прошло 25 минут
12:47:01
#asterisk -rx "database order 1 9"
No such command 'database order 1 9' (type 'core show help database order 1' for other possible commands)
12:48:32
#asterisk -rx "database put order 1 9"
Updated database successfully
12:57:31
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.25491.27625	2014-11-27 13:58:20.938929964 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 14:28:50.150951619 +0200
@@ -29,10 +29,18 @@
 exten => 3,n,Playback(/var/tmp/asterisk/record07)
 exten => 3,n,SayDigits(${ORDER})
 
+
+exten => 3,n,GotoIf("$[${DB(order/${ORDER})}" = ""]?unknown_order)
 exten => 3,n,Playback(/var/tmp/asterisk/record${DB(order/${ORDER})})
+exten => 3,n,Hangup
+exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record08)
+
+
 
-exten => 4,1,Queue(queue1)
 
+                                                                          
+exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record10):
+exten => 4,1,Queue(queue1
 exten => 0,1,Goto(s,start)
 
 ; i = invalid (extension)
прошла 31 минута
13:28:50
#mv /var/tmp/asterisk/record0
record00.gsm  record02.gsm  record04.gsm  record06.gsm
record01.gsm  record03.gsm  record05.gsm
13:31:34
#mv /var/tmp/asterisk
mv: missing destination file operand after `/var/tmp/asterisk'
Try `mv --help' for more information.
13:32:15
#ls /var/tmp/asterisk
record00.gsm  record02.gsm  record04.gsm  record06.gsm
record01.gsm  record03.gsm  record05.gsm  record07.gsm
13:32:23
#ls /var/tmp/asterisk
record00.gsm  record02.gsm  record04.gsm  record06.gsm
record01.gsm  record03.gsm  record05.gsm  record10.gsm
13:33:45
#vim /etc/asterisk/extensions.conf
13:39:01
#vim /etc/asterisk/extensions.conf
13:44:59
#ls -ls /var/tmp/asterisk/
total 88
 8 -rw-rw---- 1 asterisk asterisk  4620 Nov 25 12:31 record00.gsm
 8 -rw-rw---- 1 asterisk asterisk  7491 Nov 27 11:41 record01.gsm
36 -rw-rw---- 1 asterisk asterisk 33561 Nov 27 11:44 record02.gsm
 8 -rw-rw---- 1 asterisk asterisk  4323 Nov 27 11:46 record03.gsm
 8 -rw-rw---- 1 asterisk asterisk  6435 Nov 27 11:46 record04.gsm
12 -rw-rw---- 1 asterisk asterisk  8844 Nov 27 11:48 record05.gsm
 4 -rw-rw---- 1 asterisk asterisk  3630 Nov 27 11:48 record06.gsm
 4 -rw-rw---- 1 asterisk asterisk  2739 Nov 27 14:33 record10.gsm
13:45:04
#ls -ls /var/tmp/asterisk/
total 92
 8 -rw-rw---- 1 asterisk asterisk  4620 Nov 25 12:31 record00.gsm
 8 -rw-rw---- 1 asterisk asterisk  7491 Nov 27 11:41 record01.gsm
36 -rw-rw---- 1 asterisk asterisk 33561 Nov 27 11:44 record02.gsm
 8 -rw-rw---- 1 asterisk asterisk  4323 Nov 27 11:46 record03.gsm
 8 -rw-rw---- 1 asterisk asterisk  6435 Nov 27 11:46 record04.gsm
12 -rw-rw---- 1 asterisk asterisk  8844 Nov 27 11:48 record05.gsm
 4 -rw-rw---- 1 asterisk asterisk  3630 Nov 27 11:48 record06.gsm
 4 -rw-rw---- 1 asterisk asterisk  2112 Nov 27 14:45 record07.gsm
 4 -rw-rw---- 1 asterisk asterisk  2739 Nov 27 14:33 record10.gsm
13:45:27
#ls -ls /var/tmp/asterisk/
total 96
 8 -rw-rw---- 1 asterisk asterisk  4620 Nov 25 12:31 record00.gsm
 8 -rw-rw---- 1 asterisk asterisk  7491 Nov 27 11:41 record01.gsm
36 -rw-rw---- 1 asterisk asterisk 33561 Nov 27 11:44 record02.gsm
 8 -rw-rw---- 1 asterisk asterisk  4323 Nov 27 11:46 record03.gsm
 8 -rw-rw---- 1 asterisk asterisk  6435 Nov 27 11:46 record04.gsm
12 -rw-rw---- 1 asterisk asterisk  8844 Nov 27 11:48 record05.gsm
 4 -rw-rw---- 1 asterisk asterisk  3630 Nov 27 11:48 record06.gsm
 4 -rw-rw---- 1 asterisk asterisk  2112 Nov 27 14:45 record07.gsm
 4 -rw-rw---- 1 asterisk asterisk  2211 Nov 27 14:45 record08.gsm
 4 -rw-rw---- 1 asterisk asterisk  2739 Nov 27 14:33 record10.gsm
13:45:40
#ls -ls /var/tmp/asterisk/
total 100
 8 -rw-rw---- 1 asterisk asterisk  4620 Nov 25 12:31 record00.gsm
 8 -rw-rw---- 1 asterisk asterisk  7491 Nov 27 11:41 record01.gsm
36 -rw-rw---- 1 asterisk asterisk 33561 Nov 27 11:44 record02.gsm
 8 -rw-rw---- 1 asterisk asterisk  4323 Nov 27 11:46 record03.gsm
 8 -rw-rw---- 1 asterisk asterisk  6435 Nov 27 11:46 record04.gsm
12 -rw-rw---- 1 asterisk asterisk  8844 Nov 27 11:48 record05.gsm
 4 -rw-rw---- 1 asterisk asterisk  3630 Nov 27 11:48 record06.gsm
 4 -rw-rw---- 1 asterisk asterisk  2112 Nov 27 14:45 record07.gsm
 4 -rw-rw---- 1 asterisk asterisk  2211 Nov 27 14:45 record08.gsm
 4 -rw-rw---- 1 asterisk asterisk  2376 Nov 27 14:46 record09.gsm
 4 -rw-rw---- 1 asterisk asterisk  2739 Nov 27 14:33 record10.gsm
13:46:28
#ls -ls /var/tmp/asterisk/
                     asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
...
    -- Registered extension context 'demo'; registrar: pbx_lua
    -- merging incls/swits/igpats from old(demo) to new(demo) context, registrar = pbx_config
    -- Including switch 'Lua/' in context 'demo'
    -- Time to scan old dialplan and merge leftovers back into the new: 0.001700 sec
    -- Time to restore hints and swap in new dialplan: 0.000006 sec
    -- Time to delete the old dialplan: 0.000125 sec
    -- Total time merge_contexts_delete: 0.001831 sec
debian3*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
13:46:38
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2576)
...
    -- Executing [3@menu:5] GotoIf("SIP/1301-0000002c", """ = "?unknown_order") in new stack
    -- Goto (menu,3,8)
    -- Executing [3@menu:8] Playback("SIP/1301-0000002c", "/var/tmp/asterisk/record08") in new stack
    -- <SIP/1301-0000002c> Playing '/var/tmp/asterisk/record08.gsm' (language 'ru')
    -- Executing [3@menu:9] Playback("SIP/1301-0000002c", "/var/tmp/asterisk/record10") in new stack
    -- <SIP/1301-0000002c> Playing '/var/tmp/asterisk/record10.gsm' (language 'ru')
  == Spawn extension (menu, 3, 9) exited non-zero on 'SIP/1301-0000002c'
debian3*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
13:47:11
#ls -ls /var/tmp/asterisk/
[internal]
Found a swap file by the name "/etc/asterisk/.extensions.conf.swp"
exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm)
          owned by: root   dated: Wed Nov 26 12:40:38 2014
[menu]=> _81XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2})
         file name: /etc/asterisk/extensions.conf
[menu]=> s,1,Answer
[menu]    modified: YES
exten => s,n,Background(/var/tmp/asterisk/record01)
         user name: root   host name: debian3
...
           n(             )
                                                                           s
.conf.swp"
exten => 4,1,Queue(queue1r),Playback(/var/tmp/asterisk/record10):
    to avoid this message.
exte
; i = invalid (extension)
exten => i,1,Playback(/var/tmp/asterisk/record06)ready exists!
exten => i,n,WaitExten(2).conf" 130L, 3147C
"/etc/asterisk/extensions.conf" 130L, 3147C written
13:48:04
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.11752.1601	2014-11-27 14:48:55.386965879 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 14:50:13.158966796 +0200
@@ -4,96 +4,24 @@
 exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm)
 exten => _81XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2})
 
-
-
-[menu]
-exten => s,1,Answer
-exten => s,n,Background(/var/tmp/asterisk/record01)
-exten => s,n,WaitExten(1)
-; метки (labels) ставятся с помощью скобочек после n
-exten => s,n(start),Background(/var/tmp/asterisk/record02)
-exten => s,n,WaitExten(3)
-exten => s,n,Background(/var/tmp/asterisk/record03)
-exten => s,n,WaitExten(3)
-exten => s,n,Background(/var/tmp/asterisk/record04)
-exten => s,n,Hangup
-
-
-exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
-exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
-
-
-
-exten => 3,1,Playback(/var/tmp/asterisk/record05)
-exten => 3,n,Read(ORDER)
-exten => 3,n,Playback(/var/tmp/asterisk/record07)
-exten => 3,n,SayDigits(${ORDER})
-
-
-exten => 3,n,GotoIf("$[${DB(order/${ORDER})}" = ""]?unknown_order)
-exten => 3,n,Playback(/var/tmp/asterisk/record${DB(order/${ORDER})})
-exten => 3,n,Hangup
-exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record08)
-
-
-
-
-                                                                          
-exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record10):
-exten => 4,1,Queue(queue1
-exten => 0,1,Goto(s,start)
-
-; i = invalid (extension)
-exten => i,1,Playback(/var/tmp/asterisk/record06)
-exten => i,n,WaitExten(2)
-exten => i,n,Goto(s,start)
-; привязать к номеру
-
-; при 8405 переход на меню
-
-
-
-exten => _81XX,1,Record(/var/tmp/asterisk/record00:gsm,3)
-
-
-
-
-
-
 exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2})
 exten => _83XX,1,VoiceMailMain(13${EXTEN:2}@default)
-exten => _801X,1,MeetMe(10${EXTEN:3})
-
-
-exten => 8400,1,System(touch /tmp/someone-called-8400)
-exten => 8401,1,System(sh -c "echo ${CALLERID(num)} > /tmp/someone-called-8401")
-exten => 8402,1,System(sudo /etc/init.d/sendmail restart) 
-
-
-
-exten => _801X,1,MeetMe(10${EXTEN:3})
-
-include => parkedcalls
+; сюда добавляйте голосовую почту
 
 [local]
-
-exten => _13XX,1,Set(CALLFILENAME=${EXTEN}-${CALLERID(num)}-${STRFTIME(${EPOCH},Europe/Kiev,"%Y-%m-%d-%H:%M:%S")})
-exten => _13XX,n,Monitor(wav,${CALLFILENAME},m)
-exten => _13XX,n,Dial(SIP/${EXTEN},5,tTkK)
-
-exten => _1391,1,NoOp(Conferences for external users)
-exten => _1391,n,MeetMe(10${EXTEN:3})
-exten =>_1392,1,Dial(SIP/1301&SIP/1302)
-
+exten =>_13XX,1,Dial(SIP/${EXTEN},5)
+; скобки не было
 ; и 13 забыли
 ; здесь нужно использовать VoiceMail а не VoiceMailMain
-exten => _13XX,n,VoiceMail(13${EXTEN:2}@default)
- 
-exten => 8403,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
-exten => 8404,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
+exten =>_13XX,n,VoiceMail(13${EXTEN:2}@default)
+exten =>_13XX,n,Set(CALLF=${EXTEN:1}
+exten => _33XX,n,Set(CALLFILENAME=${EXTEN:1}-${CALLERID(num))})
+; Monitor выполняет запись звонка            
+; её нужно вызывать до Dial                  
+; m = микшировать оба потока
+exten => _33XX,n,Monitor(wav,${CALLFILENAME},m)
 
 
-exten => 8405,1,Goto(menu,s,1)
 
 [national]
 exten =>_23XX,1,Dial(SIP/brest/${EXTEN})
13:50:13
#vim /etc/asterisk//etc/asterisk/queues.conf
13:58:21
#vim /etc/asterisk/extensions.conf
13:58:52
#vim /etc/asterisk/extensions.conf
13:58:52
#vim /etc/asterisk/extension
13:58:52
#vim /etc/asterisk/extension.conf
13:59:11
#~
        [default]
E325: ATTENTION
[internal]
Found a swap file by the name "/etc/asterisk/.extensions.conf.swp"
exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm)
          owned by: root   dated: Wed Nov 26 12:40:38 2014
exten => _81XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2})
         file name: /etc/asterisk/extensions.conf
          modified: YES
exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2})
...
    to recover the chang
incl
[gr2]
include => internal
include => local,Monitor(wav,${CALLFILENAME},m)
    to avoid this m
incl
[gr3]
include => internalerisk/.extensions.conf.swp" already exists!
"/etc/asterisk/extensions.conf" 58L, 1331C
13:59:28
#include => local
E325: ATTENTION
Found a swap file by the name "/etc/asterisk/.extensions.conf.swp"
          owned by: root   dated: Wed Nov 26 12:40:38 2014
exten => _83XX,1,VoiceMailMain(13${EXTEN:2}@default)
; сюда добавляйте голосовую почту
             dated: Thu Nov 27 14:50:13 2014
[local]EWER than swap file!
exten =>_13XX,1,Dial(SIP/${EXTEN},5)
; скобки не былоditing the same file.  If this is the case,
[national]
...
include => national
                                                          55,9          66%
                                                                           s
"/etc/asterisk/extensions.conf" 58L, 1331C
Using swap file "/etc/asterisk/.extensions.conf.swp"
Original file "/etc/asterisk/extensions.conf"file "/etc/asterisk/.extension
E308: Warning: Original file may have been changedeady exists!
Recovery completed. Buffer contents equals file contents.(Q)uit, (A)bort:
You may want to delete the .swp file now.
Press ENTER or type command to continue
14:00:53
#ls -l /root/.lilalo/ -t | head
total 10976
-rw-r--r-- 1 root root 1012091 Nov 27 15:00 112082408265205951-1417072972.script
-rw-r--r-- 1 root root  854502 Nov 27 15:00 1677218677311616715-1417079986.script
-rw-r--r-- 1 root root  709576 Nov 27 15:00 22683124092307525856-1417074134.script
-rw-r--r-- 1 root root       0 Nov 27 15:00 report.xml
-rw-r--r-- 1 root root   50646 Nov 27 15:00 22683124092307525856-1417074134.info
-rw-r--r-- 1 root root       0 Nov 27 15:00 22683124092307525856-1417074134_1417093202_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root       0 Nov 27 14:59 22683124092307525856-1417074134_1417093181_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root       0 Nov 27 14:59 22683124092307525856-1417074134_1417093155_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root       0 Nov 27 14:59 22683124092307525856-1417074134_1417093149_etc_asterisk_extension.conf.diff
14:00:59
#ls -l /root/.lilalo/*diff -t | head
-rw-r--r-- 1 root root    0 Nov 27 15:00 /root/.lilalo/22683124092307525856-1417074134_1417093202_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root    0 Nov 27 14:59 /root/.lilalo/22683124092307525856-1417074134_1417093181_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root    0 Nov 27 14:59 /root/.lilalo/22683124092307525856-1417074134_1417093155_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root    0 Nov 27 14:59 /root/.lilalo/22683124092307525856-1417074134_1417093149_etc_asterisk_extension.conf.diff
-rw-r--r-- 1 root root    0 Nov 27 14:58 /root/.lilalo/22683124092307525856-1417074134_1417093105_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root  359 Nov 27 14:58 /root/.lilalo/22683124092307525856-1417074134_1417092857_etc_asterisk_queues.conf.diff
-rw-r--r-- 1 root root    0 Nov 27 14:53 /root/.lilalo/22683124092307525856-1417074134_1417092644_etc_asterisk__etc_asterisk_queues.conf.diff
-rw-r--r-- 1 root root 3496 Nov 27 14:50 /root/.lilalo/22683124092307525856-1417074134_1417092535_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root    0 Nov 27 14:48 /root/.lilalo/22683124092307525856-1417074134_1417092438_etc_asterisk_extensions.conf.diff
-rw-r--r-- 1 root root    0 Nov 27 14:44 /root/.lilalo/22683124092307525856-1417074134_1417091950_etc_asterisk_extensions.conf.diff
14:05:11
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.11111.31571	2014-11-27 15:05:13.706977458 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 15:16:35.670985528 +0200
@@ -19,8 +19,26 @@
 ; Monitor выполняет запись звонка            
 ; её нужно вызывать до Dial                  
 ; m = микшировать оба потока
-exten => _33XX,n,Monitor(wav,${CALLFILENAME},m)
-
+exten => _13XX,n,Monitor(wav,${CALLFILENAME},m)
+exten => s,1,Answer
+exten => s,n,Background(/var/tmp/asterisk/record01)
+exten => s,n,WaitExten(1)
+; метки (labels) ставятся с помощью скобочек после n
+exten => s,n(start),Background(/var/tmp/asterisk/record02)
+exten => s,n,WaitExten(3)
+exten => s,n,Background(/var/tmp/asterisk/record03)
+exten => s,n,WaitExten(3)
+exten => s,n,Background(/var/tmp/asterisk/record04)
+exten => s,n,Hangup
+
+exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
+exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
+
+; введите номер заказа
+exten => 3,1,Playback(/var/tmp/asterisk/record05)
+exten => 3,n,Read(ORDER)
+exten => 3,n,Playback(/var/tmp/asterisk/record07)
+exten => 3,n,SayDigits(${ORDER})
 
 
 exten => 3,n,GotoIf("$[${DB(order/${ORDER})}" = ""]?unknown_order)
@@ -30,7 +48,6 @@
 
 
 
-
 [national]
 exten =>_23XX,1,Dial(SIP/brest/${EXTEN})
 
прошло 11 минут
14:16:42
#exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record10)
        [default]
E325: ATTENTION
Found a swap file by the name "/etc/asterisk/.extensions.conf.swp"
          owned by: root   dated: Wed Nov 26 12:40:38 2014
         file name: /etc/asterisk/extensions.conf
          modified: YES
         user name: root   host name: debian3
        process ID: 6743
While opening file "/etc/asterisk/extensions.conf"
             dated: Thu Nov 27 15:16:35 2014
...
exten => 3,1,Playback(/var/tmp/asterisk/record05)¾Ñ‰ÑŒÑŽ скобочек пос
exten => 3,n,Read(ORDER)
exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
exten => 3,n,Playback(/var/tmp/asterisk/record07)
exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
exten => 3,n,SayDigits(${ORDER})
exten =>
"/etc/asterisk/extensions.conf" 103L, 2688C written
exten => s,n(start),Background(/var/tmp/asterisk/record02)
exten => s,n,WaitExten(3)
14:23:08
#vim /etc/asterisk/extensions.conf
14:28:46
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.31353.22156	2014-11-27 15:29:02.866994371 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 15:29:38.654994794 +0200
@@ -21,6 +21,7 @@
 ; m = микшировать оба потока
 exten => _13XX,n,Monitor(wav,${CALLFILENAME},m)
 
+[menu]
 exten => s,1,Answer
 exten => s,n,Background(/var/tmp/asterisk/record01)
 exten => s,n,WaitExten(1)
@@ -42,15 +43,6 @@
 exten => 3,n,SayDigits(${ORDER})
 
 
-
-
-
-
-
-
-
-
-
 exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
 exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
 
14:29:38
#vim /etc/asterisk/extensions.conf
14:30:25
#exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)

14:30:28
#rm /etc/asterisk/.extensions.conf.swp

14:34:30
#cat /etc/asterisk/natasha_exten
[default]
;default context
[submenu]
exten => s,1,Background(/var/tmp/asterisk/record11)
exten => s,n,WaitExten(3)
exten => s,n,Background(/var/tmp/asterisk/record12)
exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
exten => 0,1,Goto(menu,1,start)
[menu]
...
include => local
include => national
[gr3]
include => internal
include => local
[gr4]
include => internal
include => local
include => national
include => international
14:36:28
#ls -ls /var/tmp/asterisk/
total 100
 8 -rw-rw---- 1 asterisk asterisk  4620 Nov 25 12:31 record00.gsm
 8 -rw-rw---- 1 asterisk asterisk  7491 Nov 27 11:41 record01.gsm
36 -rw-rw---- 1 asterisk asterisk 33561 Nov 27 11:44 record02.gsm
 8 -rw-rw---- 1 asterisk asterisk  4323 Nov 27 11:46 record03.gsm
 8 -rw-rw---- 1 asterisk asterisk  6435 Nov 27 11:46 record04.gsm
12 -rw-rw---- 1 asterisk asterisk  8844 Nov 27 11:48 record05.gsm
 4 -rw-rw---- 1 asterisk asterisk  3630 Nov 27 11:48 record06.gsm
 4 -rw-rw---- 1 asterisk asterisk  2112 Nov 27 14:45 record07.gsm
 4 -rw-rw---- 1 asterisk asterisk  2211 Nov 27 14:45 record08.gsm
 4 -rw-rw---- 1 asterisk asterisk  2739 Nov 27 14:33 record10.gsm
 4 -rw-rw---- 1 asterisk asterisk  2376 Nov 27 14:46 record9.gsm
14:39:33
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.23425.10950	2014-11-27 15:39:41.999001938 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 15:40:35.663002571 +0200
@@ -51,7 +51,7 @@
 exten => 3,n,GotoIf("$[${DB(order/${ORDER})}" = ""]?unknown_order)
 exten => 3,n,Playback(/var/tmp/asterisk/record0${DB(order/${ORDER})})
 exten => 3,n,Hangup
-exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record10)
+exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record08)
 
 
 
14:41:39
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.19124.14775	2014-11-27 15:41:45.867003403 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 15:42:15.567003753 +0200
@@ -1,4 +1,4 @@
-	[default]
+[default]
 
 [internal]
 exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm)
@@ -48,7 +48,7 @@
 exten => 3,n,SayDigits(${ORDER})
 
 
-exten => 3,n,GotoIf("$[${DB(order/${ORDER})}" = ""]?unknown_order)
+exten => 3,n,GotoIf($["${DB(order/${ORDER})}" = ""]?unknown_order)
 exten => 3,n,Playback(/var/tmp/asterisk/record0${DB(order/${ORDER})})
 exten => 3,n,Hangup
 exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record08)
14:43:09
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.16421.1110	2014-11-27 15:43:10.811004407 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 15:43:22.991004552 +0200
@@ -49,7 +49,7 @@
 
 
 exten => 3,n,GotoIf($["${DB(order/${ORDER})}" = ""]?unknown_order)
-exten => 3,n,Playback(/var/tmp/asterisk/record0${DB(order/${ORDER})})
+exten => 3,n,Playback(/var/tmp/asterisk/record${DB(order/${ORDER})})
 exten => 3,n,Hangup
 exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record08)
 
14:46:25
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2576)
...
    -- Executing [3@menu:4] SayDigits("SIP/1301-00000037", "4") in new stack
    -- <SIP/1301-00000037> Playing 'digits/4.gsm' (language 'ru')
    -- Executing [3@menu:5] GotoIf("SIP/1301-00000037", "0?unknown_order") in new stack
    -- Executing [3@menu:6] Playback("SIP/1301-00000037", "/var/tmp/asterisk/record10") in new stack
    -- <SIP/1301-00000037> Playing '/var/tmp/asterisk/record10.gsm' (language 'ru')
    -- Executing [3@menu:7] Hangup("SIP/1301-00000037", "") in new stack
  == Spawn extension (menu, 3, 7) exited non-zero on 'SIP/1301-00000037'
debian3*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
14:47:25
#asterisk -rvvv
; и 13 забыли
; здесь нужно использовать VoiceMail а не VoiceMailMain
exten =>_13XX,n,VoiceMail(13${EXTEN:2}@default)
exten =>_13XX,n,Set(CALLF=${EXTEN:1}
exten => _33XX,n,Set(CALLFILENAME=${EXTEN:1}-${CALLERID(num))})
; Monitor выполняет запись звонка
; её нужно вызывать до Dial
; m = микшировать оба потока
"/etc/asterisk/extensions.conf" 90L, 2367C
exten => _13XX,n,Monitor(wav,${CALLFILENAME},m)
...
exten => 3,n,GotoIf($["${DB(order/${ORDER})}" = ""]?unknown_order)
exten => 3,n,Playback(/var/tmp/asterisk/record${DB(order/${ORDER})})
exten => 3,n,Hangup
exten => 3,n(unknown_order),Playback(/var/tmp/asterisk/record08)
                    k(                        ${                  })
[national]
[        ]
[        ]
[international]
"/etc/asterisk/extensions.conf" 90L, 2367C written
14:48:02
#play /var/tmp/asterisk/record10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable
/var/tmp/asterisk/record10.gsm:
 File Size: 2.74k
  Encoding: GSM
  Channels: 1 @ 16-bit
Samplerate: 8000Hz
Replaygain: off
  Duration: unknown
In:0.00% 00:00:01.66 [00:00:00.00] Out:13.3k [ -====|====- ]        Clip:0
Done.
14:48:30
#play /var/tmp/asterisk/record10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable
/var/tmp/asterisk/record10.gsm:
 File Size: 2.74k
  Encoding: GSM
  Channels: 1 @ 16-bit
Samplerate: 8000Hz
Replaygain: off
  Duration: unknown
In:0.00% 00:00:01.66 [00:00:00.00] Out:13.3k [ -====|====- ]        Clip:0
Done.
14:48:37
#vim /etc/asterisk/extensions.conf
14:48:37
#asterisk -rvvv

14:48:37
#ls -ls /var/tmp/asterisk/
[local]
exten =>_13XX,1,Dial(SIP/${EXTEN},5)
; скобки не было
; и 13 забыли
; здесь нужно использовать VoiceMail а не VoiceMailMain
exten =>_13XX,n,VoiceMail(13${EXTEN:2}@default)
exten =>_13XX,n,Set(CALLF=${EXTEN:1}
exten => _33XX,n,Set(CALLFILENAME=${EXTEN:1}-${CALLERID(num))})
; Monitor выполняет запись звонка
; её нужно вызывать до Dial
...
[national]
exten =>_23XX,1,Dial(SIP/brest/${EXTEN})
[international]
        _1[12]XX,1,Dial(SIP/kiev/${EXTEN})
exten =>_3[123]XX,1,Dial(SIP/kiev/${EXTEN})
[gr1]
           internal
include => local
"/etc/asterisk/extensions.conf" 91L, 2413C written
exten => 3,n,SayDigits(${ORDER})
14:56:02
#vim /etc/asterisk/queues.conf
--- /tmp/l3-saved-3787.166.26457	2014-11-27 15:56:21.675013767 +0200
+++ /etc/asterisk/queues.conf	2014-11-27 15:56:59.871014221 +0200
@@ -534,4 +534,4 @@
 ;member => Agent/@1		; Any agent in group 1
 ;member => Agent/:1,1		; Any agent in group 1, wait for first
                                 ; available, but consider with penalty
-member => SIP/1302
+member => Agent/007 
14:56:59
#vim /etc/asterisk/agents.conf
--- /tmp/l3-saved-3787.9398.23880	2014-11-27 15:57:07.859014316 +0200
+++ /etc/asterisk/agents.conf	2014-11-27 15:57:35.563014641 +0200
@@ -103,3 +103,6 @@
 ;
 ;agent => 1001,4321,Mark Spencer
 ;agent => 1002,4321,Will Meadows
+
+
+agent => 007,1234,James Bond
14:57:35
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3787.32516.15578	2014-11-27 15:57:55.291014876 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 15:58:47.127015489 +0200
@@ -10,7 +10,7 @@
 
 
 exten => 8405,1,Goto(menu,s,1)
-
+exten => 8407,1,AgentLogin(007)
 
 [local]
 exten =>_13XX,1,Dial(SIP/${EXTEN},5)
14:58:56
#/etc/init.d/asterisk reload
Reloading Asterisk PBX configuration files.
14:59:07
#vim /etc/asterisk/extensions.conf
15:01:25
#less /etc/asterisk/queues.conf
15:05:22
## готово

15:08:31
## гоless /etc/asterisk/queues.conf
[general]
;
; Global settings for call queues
;
; Persistent Members
;    Store each dynamic member in each queue in the astdb so that
;    when asterisk is restarted, each member will be automatically
;    read into their recorded queues. Default is 'yes'.
;
persistentmembers = yes
...
;    it will default to the old 'Monitor' behavior to keep backward
;    compatibility.
;
monitor-type = MixMonitor
;
; UpdateCDR behavior.
;    This option is implemented to mimic chan_agents behavior of populating
;    CDR dstchannel field of a call with an agent name, which you can set
;    at the login time with AddQueueMember membername parameter.
;
15:10:31
#cat > /tmp/call.call
^C
15:12:40
#cat /tmp/call.call

15:13:08
#vim /tmp/call.call
--- /tmp/l3-saved-3787.29641.14378	2014-11-27 16:13:26.575025899 +0200
+++ /tmp/call.call	2014-11-27 16:16:23.051027989 +0200
@@ -1 +1,6 @@
+Context: internal
+Channel: SIP/1301
+Extension: 8405
+       
+      
 
15:16:23
#vim /tmp/call.call
--- /tmp/l3-saved-3787.3936.13538	2014-11-27 16:16:36.067028142 +0200
+++ /tmp/call.call	2014-11-27 16:28:31.871036606 +0200
@@ -1,6 +1,34 @@
+
+
+for CANNEL in minsk /{1{1,3},2{1,2,3},3{1,2}}
+do
+echo $CANNEL
+done
+
+
+exit 0
+
+
+FILE=/tmp/${RANDOM}${RANDOM}.call
+cat<<EOF >$FILE
 Context: internal
 Channel: SIP/1301
 Extension: 8405
-       
+Channel: SIP/${CHANNEL} 
+
+EOF
+
+
+
+chown asterisk:asterisk $FILE
+mv $FILE /var/spool/asterisk/outgoing/
+
+
+done                         
+                             
+exit 0
+
+
+ 
       
 
прошло 12 минут
15:28:31
#vim /tmp/call.call

Пятница (11/28/14)

/dev/pts/0
08:24:44
#screen
/dev/pts/2
08:25:25
#lspci
00:00.0 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Root Complex
00:00.2 IOMMU: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) I/O Memory Management Unit
00:01.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Trinity [Radeon HD 7660D]
00:01.1 Audio device: Advanced Micro Devices [AMD] nee ATI Trinity HDMI Audio Controller
00:10.0 USB controller: Advanced Micro Devices [AMD] FCH USB XHCI Controller (rev 03)
00:10.1 USB controller: Advanced Micro Devices [AMD] FCH USB XHCI Controller (rev 03)
00:11.0 SATA controller: Advanced Micro Devices [AMD] FCH SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 11)
00:12.2 USB controller: Advanced Micro Devices [AMD] FCH USB EHCI Controller (rev 11)
00:13.0 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 11)
...
00:14.5 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 11)
00:15.0 PCI bridge: Advanced Micro Devices [AMD] Hudson PCI to PCI bridge (PCIE port 0)
00:15.2 PCI bridge: Advanced Micro Devices [AMD] Hudson PCI to PCI bridge (PCIE port 2)
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 5
03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5761 Gigabit Ethernet PCIe (rev 10)
прошло 60 минут
09:26:05
#all lspci | grep -i digium
bash: all: command not found
09:26:45
#all lspci | grep -i digium
bash: all: command not found
09:27:48
#lspci | grep -i digium

09:29:47
#all lspci | grep -i dahdi
bash: all: command not found
прошло 66 минут
10:36:07
#all lspci | grep -i digium
bash: all: command not found
10:36:44
#lspci
00:00.0 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Root Complex
00:00.2 IOMMU: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) I/O Memory Management Unit
00:01.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Trinity [Radeon HD 7660D]
00:01.1 Audio device: Advanced Micro Devices [AMD] nee ATI Trinity HDMI Audio Controller
00:10.0 USB controller: Advanced Micro Devices [AMD] FCH USB XHCI Controller (rev 03)
00:10.1 USB controller: Advanced Micro Devices [AMD] FCH USB XHCI Controller (rev 03)
00:11.0 SATA controller: Advanced Micro Devices [AMD] FCH SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 11)
00:12.2 USB controller: Advanced Micro Devices [AMD] FCH USB EHCI Controller (rev 11)
00:13.0 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 11)
...
00:14.5 USB controller: Advanced Micro Devices [AMD] FCH USB OHCI Controller (rev 11)
00:15.0 PCI bridge: Advanced Micro Devices [AMD] Hudson PCI to PCI bridge (PCIE port 0)
00:15.2 PCI bridge: Advanced Micro Devices [AMD] Hudson PCI to PCI bridge (PCIE port 2)
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices [AMD] Family 15h (Models 10h-1fh) Processor Function 5
03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5761 Gigabit Ethernet PCIe (rev 10)
прошло >2 часов
13:21:06
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3868.3796.8932	2014-11-28 14:21:08.666236222 +0200
+++ /etc/asterisk/extensions.conf	2014-11-28 14:21:23.518236531 +0200
@@ -21,7 +21,7 @@
 ; и 13 забыли
 ; здесь нужно использовать VoiceMail а не VoiceMailMain
 exten =>_13XX,n,VoiceMail(13${EXTEN:2}@default)
-exten =>_13XX,n,Set(CALLF=${EXTEN:1}
+exten =>_13XX,n,Set(CALLF=${EXTEN:1})
 exten => _33XX,n,Set(CALLFILENAME=${EXTEN:1}-${CALLERID(num))})
 ; Monitor выполняет запись звонка            
 ; её нужно вызывать до Dial                  
13:21:56
#vim /etc/asterisk/extensions.conf
прошло 23 минуты
13:45:20
#apt-get install mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysql
13:46:07
#apt-get install mysql-server
Selecting previously unselected package libaio1:amd64.
(Reading database ... 144323 files and directories currently installed.)
Unpacking libaio1:amd64 (from .../libaio1_0.3.109-3_amd64.deb) ...
Selecting previously unselected package mysql-common.
Unpacking mysql-common (from .../mysql-common_5.5.40-0+wheezy1_all.deb) ...
Selecting previously unselected package libmysqlclient18:amd64.
Unpacking libmysqlclient18:amd64 (from .../libmysqlclient18_5.5.40-0+wheezy1_amd64.deb) ...
Selecting previously unselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.622-1+deb7u1_amd64.deb) ...
Selecting previously unselected package libdbd-mysql-perl.
...
141128 14:47:40 InnoDB: highest supported file format is Barracuda.
141128 14:47:40  InnoDB: Waiting for the background threads to start
141128 14:47:41 InnoDB: 5.5.40 started; log sequence number 1595675
141128 14:47:41  InnoDB: Starting shutdown...
141128 14:47:42  InnoDB: Shutdown completed; log sequence number 1595675
Starting MySQL database server: mysqld ..
Checking for tables which need an upgrade, are corrupt or were
not closed cleanly..
Setting up libhtml-template-perl (2.91-1) ...
Setting up mysql-server (5.5.40-0+wheezy1) ...
13:47:53
#apt-get install mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libgadu3
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
  mysql-client
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 73.8 kB of archives.
After this operation, 121 kB of additional disk space will be used.
Get:1 http://security.debian.org/ wheezy/updates/main mysql-client all 5.5.40-0+wheezy1 [73.8 kB]
Fetched 73.8 kB in 0s (441 kB/s)
Selecting previously unselected package mysql-client.
(Reading database ... 144772 files and directories currently installed.)
Unpacking mysql-client (from .../mysql-client_5.5.40-0+wheezy1_all.deb) ...
Setting up mysql-client (5.5.40-0+wheezy1) ...
13:54:51
#cat > /tmp/1.sql
^C
13:55:39
#vim /tmp/1.sql
14:02:32
#vim /tmp/1.sql
14:03:04
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:03:43
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:05:08
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
прошло 10 минут
14:15:16
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:20:57
#apt-get install mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-client is already the newest version.
The following package was automatically installed and is no longer required:
  libgadu3
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
прошло 18 минут
14:39:35
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:41:03
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:41:30
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:41:46
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:41:53
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:44:30
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:44:37
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:44:47
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:45:04
#mysql -u asterisk -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.5.40-0+wheezy1 (Debian)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use asterisk
...
Database changed
mysql> select * from cdr;
+---------------------+------+------+------+----------+-------------------+--------------------+---------+----------------+----------+---------+-------------+----------+-------------+-----------+--------------+
| calldate            | clid | src  | dst  | dcontext | channel           | dstchannel         | lastapp | lastdata       | duration | billsec | disposition | amaflags | accountcode | userfield | uniqueid     |
+---------------------+------+------+------+----------+-------------------+--------------------+---------+----------------+----------+---------+-------------+----------+-------------+-----------+--------------+
| 2014-11-28 16:23:30 | 1301 | 1301 | 2301 | gr1      | SIP/1301-00000000 | SIP/brest-00000001 | Dial    | SIP/brest/2301 |        2 |       0 | NO ANSWER   |        3 |             |           | 1417184610.0 |
+---------------------+------+------+------+----------+-------------------+--------------------+---------+----------------+----------+---------+-------------+----------+-------------+-----------+--------------+
1 row in set (0.00 sec)
mysql> ^CCtrl-C -- exit!
Aborted
/dev/pts/5
14:47:03
#dpkg-reconfigure mysqld-server
dpkg-query: package 'mysqld-server' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
/usr/sbin/dpkg-reconfigure: mysqld-server is not installed
14:47:09
#dpkg-reconfigure mysql-server

14:47:17
#mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14:47:25
#which mysqld
/usr/sbin/mysqld
14:47:43
#dpkg -S `which mysqld`
mysql-server-core-5.5: /usr/sbin/mysqld
14:47:47
#dpkg-reconfigure mysql-server-core-5.5

14:47:56
#dpkg -P mysql-server
(Reading database ... 144777 files and directories currently installed.)
Removing mysql-server ...
14:48:40
#apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libgadu3
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
  mysql-server
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/73.9 kB of archives.
After this operation, 121 kB of additional disk space will be used.
Selecting previously unselected package mysql-server.
(Reading database ... 144772 files and directories currently installed.)
Unpacking mysql-server (from .../mysql-server_5.5.40-0+wheezy1_all.deb) ...
Setting up mysql-server (5.5.40-0+wheezy1) ...

Файлы

  • /etc/asterisk/natasha_exten
  • /tmp/call.call
  • /etc/asterisk/natasha_exten
    >
    [default]
    ;default context
    [submenu]
    exten => s,1,Background(/var/tmp/asterisk/record11)
    exten => s,n,WaitExten(3)
    exten => s,n,Background(/var/tmp/asterisk/record12)
    exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
    exten => 2,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
    exten => 0,1,Goto(menu,1,start)
    [menu]
    exten => s,1,Answer
    exten => s,n,Background(/var/tmp/asterisk/record01)
    exten => s,n,WaitExten(1)
    exten => s,n(start),Background(/var/tmp/asterisk/record02)
    exten => s,n,WaitExten(3)
    exten => s,n,Background(/var/tmp/asterisk/record03)
    exten => s,n,WaitExten(3)
    exten => s,n,Background(/var/tmp/asterisk/record04)
    exten => s,n,Hangup
    exten => 1,1,Goto(submenu,s,1)
    exten => 2,1,Playback(/var/tmp/asterisk/record05)
    exten => 2,n,Read(ORDER)
    exten => 2,n,Playback(/var/tmp/asterisk/record07)
    exten => 2,n,SayDigits(${ORDER})
    exten => 2,n,GotoIf($["${DB(order/${ORDER})}" = ""]?unknown_order)
    exten => 2,n,Playback(/var/tmp/asterisk/record${DB(order/${ORDER})})
    exten => 2,n(unknown_order),Playback(/var/tmp/asterisk/record08)
    exten => 2,n,Background(/var/tmp/asterisk/record12)
    exten => 2,n,WaitExten(3)
    exten => 3,1,Answer
    exten => 3,n,Queue(queue1)
    exten => 0,1,Goto(s,start)
    ; неверный выбор
    ; i = invalid (extension)
    exten => i,1,Playback(/var/tmp/asterisk/record06)
    exten => i,n,WaitExten(2)
    exten => i,n,Goto(s,start)
    [internal]
    exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm)
    exten => _81XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2})
    exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2})
    exten => 8001,1,VoiceMailMain()
    exten => _8309,1,VoiceMailMain(32${EXTEN:2}@default)
    ; предположим здесь будет голосове меню
    exten => 8002,1,Answer
    exten => 8002,n,...
    exten => 8002,n,Set(CHANNEL(language)=ru)
    exten => 8300,1,System(touch /tmp/someone-called-8300)
    exten => 8301,1,System(sh -c "echo ${CALLERID(num)} > /tmp/someone-called-8301")
    exten => 8302,1,System(sudo /etc/init.d/sendmail restart)
    ; 8010 => комната 100
    ; 8015 => комната 115
    ; так 10 разных комнат
    exten => _801X,1,MeetMe(10${EXTEN:3})
    include => parkedcalls
    exten => 8403,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt)
    exten => 8404,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/burunduki.txt)
    exten => 8405,1,Goto(menu,s,1)
    exten => 8407,1,AgentLogin(007)
    [local]
    exten => _3291,1,NoOp(Conferences for external users)
    exten => _3291,n,MeetMe(10${EXTEN:3})
    exten => 3292,1,Dial(SIP/3201&SIP/3202)
     сначала создаём имя файла:
    ; кому звонили и время
    exten => _32XX,1,Set(CALLFILENAME=${EXTEN}-${CALLERID(num)}-${STRFTIME(${EPOCH},Europe/Kiev,"%Y-%m-%d-%H:%M:%S")})
    exten => _32XX,n,Monitor(wav,${CALLFILENAME},m)
    exten => _32XX,n,Dial(SIP/${EXTEN},20,tTkK)
    exten => _32XX,n,VoiceMail(32${EXTEN:2}@default)
    [national]
    exten => _31XX,1,Dial(SIP/liverpool/${EXTEN})
    exten => _32XX,1,Dial(SIP/edinburgh/${EXTEN})
    [international]
    exten => _[12][123]XX,1,Dial(SIP/ny/${EXTEN})
    [gr1]
    include => internal
    include => local
    include => national
    include => international
    [gr2]
    include => internal
    include => local
    include => national
    [gr3]
    include => internal
    include => local
    [gr4]
    include => internal
    include => local
    include => national
    include => international
    
    /tmp/call.call
    >

    Статистика

    Время первой команды журнала11:10:12 2014-11-27
    Время последней команды журнала14:48:40 2014-11-28
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %20.79
    Процент синтаксически неверно набранных команд, % 0.00
    Суммарное время работы с терминалом *, час 4.55
    Количество командных строк в единицу времени, команда/мин 0.37
    Частота использования команд
    vim32|============================| 28.32%
    mysql14|============| 12.39%
    ls12|==========| 10.62%
    asterisk7|======| 6.19%
    apt-get5|====| 4.42%
    grep5|====| 4.42%
    cat4|===| 3.54%
    all4|===| 3.54%
    lspci3|==| 2.65%
    dpkg-reconfigure3|==| 2.65%
    dpkg2|=| 1.77%
    play2|=| 1.77%
    #2|=| 1.77%
    head2|=| 1.77%
    mv2|=| 1.77%
    exten2|=| 1.77%
    burunduki.txt)1|| 0.88%
    screen1|| 0.88%
    call.call1|| 0.88%
    1.sql1|| 0.88%
    /etc/init.d/asterisk1|| 0.88%
    rm1|| 0.88%
    less1|| 0.88%
    ~1|| 0.88%
    local1|| 0.88%
    include1|| 0.88%
    which1|| 0.88%
    record10)1|| 0.88%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$