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

Содержание

Журнал

Среда (11/26/14)

/dev/pts/7
10:41:06
#{EXTEN})
[general]
context=default
qualify=yes
;include "/etc/asterisk/sip.conf.kiev"
register => minsk:1234@192.168.60.1/brest
register => minsk:1234@192.168.10.1/kiev
[phone](!)
type=friend
host=dynamic
qualify=yes
...
username=minsk
context=gr4
;minsk-kiev
[kiev]
type=friend
secret=1234
host=dynamic
directmedia=no
username=minsk
context=gr4
10:41:16
#less /var/log/asterisk/messages
10:41:32
#vim /etc/asterisk/voicemail.conf
--- /tmp/l3-saved-6019.16681.7876	2014-11-26 11:41:37.178766052 +0200
+++ /etc/asterisk/voicemail.conf	2014-11-26 11:41:56.214766454 +0200
@@ -382,8 +382,7 @@
 [default]
 ; была пропущена запятая
 1301 =>1234,User 1 (1301),user@localhost 
-
-
+1302 =>1234,User 1 (1302),user@localhost 
 
 
 1234 => 4242,Example Mailbox,root@localhost
10:42:42
#su - user
4 kept, 0 deleted.
user@debian3:~$ exit
logout
/dev/pts/2
10:43:34
#apt-cache search asterisk-
asterisk - Open Source Private Branch Exchange (PBX)
asterisk-config - Configuration files for Asterisk
asterisk-dahdi - DAHDI devices support for the Asterisk PBX
asterisk-dbg - Debugging symbols for Asterisk
asterisk-dev - Development files for Asterisk
asterisk-doc - Source code documentation for Asterisk
asterisk-mobile - Bluetooth phone support for the Asterisk PBX
asterisk-modules - loadable modules for the Asterisk PBX
asterisk-mp3 - MP3 playback support for the Asterisk PBX
asterisk-mysql - MySQL database protocol support for the Asterisk PBX
...
asterisk-prompt-es-co - Colombian Spanish voice prompts for Asterisk
asterisk-prompt-fr-armelle - French voice prompts for Asterisk by Armelle Desjardins
asterisk-prompt-fr-proformatique - French voice prompts for Asterisk
asterisk-prompt-it - dummy transitional package
asterisk-prompt-it-menardi - asterisk PBX Italian sound files
asterisk-prompt-it-menardi-alaw - asterisk PBX Italian sound files - a-law prompts
asterisk-prompt-it-menardi-gsm - asterisk PBX Italian sound files - gsm prompts
asterisk-prompt-it-menardi-wav - asterisk PBX Italian sound files - wav prompts
asterisk-prompt-se - Swedish voice prompts for Asterisk
libasterisk-agi-perl - Collections of Perl modules to be used with Asterisk PBX AGI
10:52:42
#vim /etc/asterisk/sip.conf
11:01:36
#tar xfz asterisk-core-sounds-ru-gsm-current.tar.gz -C /usr/share/asterisk/sounds/ru/

11:10:48
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3542.28746.25513	2014-11-26 12:11:07.142803268 +0200
+++ /etc/asterisk/extensions.conf	2014-11-26 12:13:41.914806523 +0200
@@ -2,6 +2,8 @@
 
 [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 => _83XX,1,VoiceMailMain(13${EXTEN:2}@default)
 ; сюда добавляйте голосовую почту
11:14:27
#vim /etc/asterisk/extensions.conf
прошло 56 минут
/dev/pts/0
12:11:13
#vim /etc/asterisk/extensions.conf
12:13:01
#[local]
Display all 101 possibilities? (y or n)
12:13:01
#vim /etc/asterisk/ext
--- /tmp/l3-saved-3517.23115.12169	2014-11-26 13:13:22.502349303 +0200
+++ /etc/asterisk/extensions.conf	2014-11-26 13:17:23.370352154 +0200
@@ -9,11 +9,14 @@
 ; сюда добавляйте голосовую почту
 
 [local]
-exten =>_13XX,1,Dial(SIP/${EXTEN},5)
+
+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)
 ; скобки не было
 ; и 13 забыли
 ; здесь нужно использовать VoiceMail а не VoiceMailMain
-exten =>_13XX,n,VoiceMail(13${EXTEN:2}@default)
+exten => _13XX,n,VoiceMail(13${EXTEN:2}@default)
  
 [national]
 exten =>_23XX,1,Dial(SIP/brest/${EXTEN})
12:13:01
#vim /etc/asterisk/extension
12:13:01
#vim /etc/asterisk/extensions
12:13:01
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3517.13089.30922	2014-11-26 13:53:00.038377441 +0200
+++ /etc/asterisk/musiconhold.conf	2014-11-26 13:53:14.378377614 +0200
@@ -44,7 +44,7 @@
 
 [default]
 mode=files
-directory=moh
+directory=/var/lib/asterisk/moh/
 ;
 ;[native-random]
 ;mode=files
12:17:52
#ls /var/spool/asterisk/monitor/
1301-1302-2014-11-26-13:17:44.wav
12:24:12
#ls /var/spool/asterisk/monitor/
1301-1302-2014-11-26-13:17:44.wav  1302-1301-2014-11-26-13:23:27.wav
1301-1302-2014-11-26-13:24:29.wav
12:24:40
#ls /var/spool/asterisk/monitor/
1301-1302-2014-11-26-13:17:44.wav  1302-1301-2014-11-26-13:23:27.wav
1301-1302-2014-11-26-13:24:29.wav  1302-1301-2014-11-26-13:25:17.wav
12:25:30
#ls /var/spool/asterisk/monitor/
1301-1302-2014-11-26-13:17:44.wav  1302-1301-2014-11-26-13:25:17.wav
1301-1302-2014-11-26-13:24:29.wav  1302-1301-2014-11-26-13:27:04.wav
1302-1301-2014-11-26-13:23:27.wav
прошло 14 минут
12:40:05
#mpg123 -w /tmp/adele.wav /home/user/Downloads/maks_korzh_-_zhit_v_kayf_(zaycev.net).mp3
bash: syntax error near unexpected token `('
12:43:44
#pl
pl2pm       play        plipconfig  plog
12:43:44
#play /tmp/music.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable
/tmp/music.gsm:
 File Size: 283k
  Encoding: GSM
  Channels: 1 @ 16-bit
Samplerate: 8000Hz
Replaygain: off
  Duration: unknown
In:0.00% 00:00:44.03 [00:00:00.00] Out:352k  [!=====|=====!] Hd:0.0 Clip:0
Aborted.
12:48:57
#cp /tmp/ maks_korzh_-_zhit_v_kayf_(zaycev.net).mp3
bash: syntax error near unexpected token `('
12:50:52
#cp /tmp/music.gsm /var/lib/asterisk/moh/

12:51:55
#vim /etc/asterisk/musiconhold.conf
12:52:52
#[ ]
; without transcoding (same as Playback would do in the dialplan).
; Files can be present in as many formats as you wish, and the
; 'best' format will be chosen at playback time.
;
; The path specified can be either an absolute path (starts with '/'),
; or a relative path; relative paths are interpreted as being relative
; to the 'astdatalibdir' in asterisk.conf, which defaults to
; /var/lib/asterisk.
;
; NOTE:
...
; this, res_musiconhold will skip the files it is not able to
; understand when it loads.
;
[default]
[       ]
[ode=fil]s
;
;[native-random]
         =/var/lib/asterisk/moh/
"/etc/asterisk/musiconhold.conf" 84L, 2741C written
12:54:07
#vim /etc/asterisk/musiconhold.conf
--- /tmp/l3-saved-3517.26294.22960	2014-11-26 14:15:19.182393290 +0200
+++ /etc/asterisk/extensions.conf	2014-11-26 14:18:34.570395601 +0200
@@ -6,6 +6,9 @@
 
 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})
+
+
 ; сюда добавляйте голосовую почту
 
 [local]
@@ -13,6 +16,9 @@
 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)
+
+
+
 ; скобки не было
 ; и 13 забыли
 ; здесь нужно использовать VoiceMail а не VoiceMailMain
прошло 13 минут
13:07:54
#m-a = module-assistant
Starting the Dialog UI...
13:12:15
#modprobe dahdi

13:13:24
#lsmod | grep dahdi
dahdi                 191056  0
crc_ccitt              12347  1 dahdi
13:13:36
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
13:18:34
#/etc/asterisk/meetme.conf
bash: /etc/asterisk/meetme.conf: Permission denied
13:20:53
#vim /etc/asterisk/meetme.conf
13:25:14
#apt-get install asterisk-dahdi
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 extra packages will be installed:
  libopenr2-3 libpri1.4 libss7-1
The following NEW packages will be installed:
  asterisk-dahdi libopenr2-3 libpri1.4 libss7-1
...
Selecting previously unselected package libpri1.4.
Unpacking libpri1.4 (from .../libpri1.4_1.4.12-2_amd64.deb) ...
Selecting previously unselected package libss7-1.
Unpacking libss7-1 (from .../libss7-1_1.0.2-3_amd64.deb) ...
Selecting previously unselected package asterisk-dahdi.
Unpacking asterisk-dahdi (from .../asterisk-dahdi_1%3a1.8.13.1~dfsg1-3+deb7u3_amd64.deb) ...
Setting up libopenr2-3 (1.3.2-1.1) ...
Setting up libpri1.4 (1.4.12-2) ...
Setting up libss7-1 (1.0.2-3) ...
Setting up asterisk-dahdi (1:1.8.13.1~dfsg1-3+deb7u3) ...
прошла 81 минута
14:46:26
#vi /etc/asterisk/features.conf
14:48:14
#vi /etc/asterisk/features.conf
--- /tmp/l3-saved-3517.22959.4850	2014-11-26 15:50:26.230460836 +0200
+++ /etc/asterisk/features.conf	2014-11-26 15:52:05.098462011 +0200
@@ -80,7 +80,7 @@
                                 ; (default is 3 seconds)
 ;xfersound = beep               ; to indicate an attended transfer is complete
 ;xferfailsound = beeperr        ; to indicate a failed transfer
-pickupexten = *1               ; Configure the pickup extension. (default is *8)
+pickupexten = *8               ; Configure the pickup extension. (default is *8)
 ;pickupsound = beep             ; to indicate a successful pickup (default: no sound)
 ;pickupfailsound = beeperr      ; to indicate that the pickup failed (default: no sound)
 ;featuredigittimeout = 1000     ; Max time (ms) between digits for
14:53:06
#vi /etc/asterisk/features.conf
14:56:17
#vim /etc/asterisk/features.conf
--- /tmp/l3-saved-3517.15206.2715	2014-11-26 16:06:04.930471947 +0200
+++ /etc/asterisk/features.conf	2014-11-26 16:08:04.182473359 +0200
@@ -119,10 +119,10 @@
 
 
 [featuremap]
-;blindxfer => #1                ; Blind transfer  (default is #) -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
+blindxfer => #1                ; Blind transfer  (default is #) -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
 ;disconnect => *0               ; Disconnect  (default is *) -- Make sure to set the H and/or h option in the Dial() or Queue() app call!
 ;automon => *1                  ; One Touch Record a.k.a. Touch Monitor -- Make sure to set the W and/or w option in the Dial() or Queue() app call!
-;atxfer => *2                   ; Attended transfer  -- Make sure to set the T and/or t option in the Dial() or Queue()  app call!
+atxfer => *2                   ; Attended transfer  -- Make sure to set the T and/or t option in the Dial() or Queue()  app call!
 ;parkcall => #72                ; Park call (one step parking)  -- Make sure to set the K and/or k option in the Dial() app call!
 ;automixmon => *3               ; One Touch Record a.k.a. Touch MixMonitor -- Make sure to set the X and/or x option in the Dial() or Queue() app call!
 
прошло 15 минут
15:12:16
#vi /etc/asterisk/features.conf
прошло 20 минут
15:32:25
#asterisk -rvvvv
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 = 10884)
...
    -- 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.001553 sec
    -- Time to restore hints and swap in new dialplan: 0.000006 sec
    -- Time to delete the old dialplan: 0.000142 sec
    -- Total time merge_contexts_delete: 0.001701 sec
debian3*CLI> features reload
debian3*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
15:40:51
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3517.21124.10680	2014-11-26 16:42:36.606497890 +0200
+++ /etc/asterisk/extensions.conf	2014-11-26 16:43:10.578498290 +0200
@@ -12,6 +12,8 @@
 ; сюда добавляйте голосовую почту
 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")})
@@ -39,7 +41,6 @@
 include => local
 include => national
 include => international
-nclude => parkedcalls
 
 [gr2]
 
15:45:29
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3517.5932.4610	2014-11-26 16:54:35.134506392 +0200
+++ /etc/asterisk/extensions.conf	2014-11-26 16:57:38.074508557 +0200
@@ -8,8 +8,15 @@
 exten => _83XX,1,VoiceMailMain(13${EXTEN:2}@default)
 exten => _801X,1,MeetMe(10${EXTEN:3})
 
+exten => 8300,1,System(touch /tmp/someone-called-8300)
+exten => 8301,1,System(echo ${CALLERID(num)} > /tmp/someone-called-8301)
+exten => 8302,1,System(sudo /etc/init.d/sendmail restart) 
+
+
+
+
+
 
-; сюда добавляйте голосовую почту
 exten => _801X,1,MeetMe(10${EXTEN:3})
 
 include => parkedcalls
прошло 12 минут
15:58:05
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3517.31459.8282	2014-11-26 16:58:09.774508935 +0200
+++ /etc/asterisk/extensions.conf	2014-11-26 17:07:46.510515762 +0200
@@ -8,15 +8,13 @@
 exten => _83XX,1,VoiceMailMain(13${EXTEN:2}@default)
 exten => _801X,1,MeetMe(10${EXTEN:3})
 
+
 exten => 8300,1,System(touch /tmp/someone-called-8300)
-exten => 8301,1,System(echo ${CALLERID(num)} > /tmp/someone-called-8301)
+exten => 8301,1,System(sh -c "echo ${CALLERID(num)} > /tmp/someone-called-8301")
 exten => 8302,1,System(sudo /etc/init.d/sendmail restart) 
 
 
 
-
-
-
 exten => _801X,1,MeetMe(10${EXTEN:3})
 
 include => parkedcalls
16:07:51
#ls -ls /tmp/
total 29820
    4 -rw------- 1 user       user            607 Nov 26 13:28 gnash-cookies.nBS3z0
  280 -rw-r--r-- 1 root       root         282711 Nov 26 13:48 music.gsm
29516 -rw-r--r-- 1 root       root       30223916 Nov 26 13:42 music.wav
    4 drwx------ 2 user       user           4096 Jan  1  1970 orbit-user
    4 drwx------ 2 Debian-gdm Debian-gdm     4096 Nov 26 13:10 pulse-E1Vw2I6NFImC
    4 drwx------ 2 user       user           4096 Nov 26 13:10 pulse-RUj8Pe6Tloc5
    4 drwx------ 2 user       user           4096 Nov 26 13:10 ssh-KbdZ3NqRSkMK
    0 -rw------- 1 root       root              0 Nov 26 14:09 tmp.pcntRb9jgV
    4 drwxr-xr-x 2 user       user           4096 Nov 26 13:10 tracker-user
16:07:57
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3517.13430.29350	2014-11-26 17:08:21.330516174 +0200
+++ /etc/asterisk/extensions.conf	2014-11-26 17:09:36.834517067 +0200
@@ -9,9 +9,9 @@
 exten => _801X,1,MeetMe(10${EXTEN:3})
 
 
-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) 
+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) 
 
 
 
16:09:54
#ls -ls /tmp/
total 29820
    4 -rw------- 1 user       user            607 Nov 26 13:28 gnash-cookies.nBS3z0
  280 -rw-r--r-- 1 root       root         282711 Nov 26 13:48 music.gsm
29516 -rw-r--r-- 1 root       root       30223916 Nov 26 13:42 music.wav
    4 drwx------ 2 user       user           4096 Jan  1  1970 orbit-user
    4 drwx------ 2 Debian-gdm Debian-gdm     4096 Nov 26 13:10 pulse-E1Vw2I6NFImC
    4 drwx------ 2 user       user           4096 Nov 26 13:10 pulse-RUj8Pe6Tloc5
    4 drwx------ 2 user       user           4096 Nov 26 13:10 ssh-KbdZ3NqRSkMK
    0 -rw------- 1 root       root              0 Nov 26 14:09 tmp.pcntRb9jgV
    4 drwxr-xr-x 2 user       user           4096 Nov 26 13:10 tracker-user
16:10:04