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

Содержание

Журнал

Понедельник (11/24/14)

/dev/pts/8
16:18:53
#cat /etc/asterisk/sip.conf
[general]
context=default
[2101]
type=friend
secret=1234
host=dynamic
[2102]
type=friend
secret=1234
host=dynamic
/dev/pts/8
16:19:29
#ps aux | grep [a]ster
asterisk 11635  0.2  0.1 761896 30472 ?        Ssl  16:37   0:07 /usr/sbin/asterisk -p -U asterisk
asterisk 11636  0.0  0.0  13916   772 ?        S    16:37   0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 11635
root     12118  0.0  0.0  31412  2628 pts/3    S+   17:18   0:00 /usr/bin/vim /etc/asterisk/sip.conf
16:19:36
#date
Mon Nov 24 17:19:40 EET 2014
16:19:40
## 16:37

16:19:48
## 17:19

/dev/pts/2
16:20:27
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
/dev/pts/1
16:20:27
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
прошло 11 минут
/dev/pts/2
16:31:28
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:31:28
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:32:07
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:32:07
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:33:17
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:33:17
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:33:23
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:33:23
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:33:30
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:33:30
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:34:22
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:34:22
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
16:35:43
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:35:43
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
16:35:45
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:35:45
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:35:46
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:35:46
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:35:48
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:35:48
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:35:49
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:35:49
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:35:50
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/1
16:35:50
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101                       (Unspecified)                            D   N             0        Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
/dev/pts/2
16:35:51
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
/dev/pts/1
16:35:51
#asterisk -rx 'sip show peers'
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
прошло 15 минут
/dev/pts/2
16:51:02
#restart
bash: restart: command not found
/dev/pts/1
16:51:02
#restart
bash: restart: command not found
/dev/pts/2
16:51:24
#reboot

/dev/pts/1
16:51:24
#reboot

прошло 15 минут
/dev/pts/3
17:07:03
#screen -x
/dev/pts/2
17:07:03
#screen -x
/dev/pts/3
17:07:05
#cat /etc/asterisk/extension.conf
cat: /etc/asterisk/extension.conf: No such file or directory
/dev/pts/2
17:07:05
#cat /etc/asterisk/extension.conf
cat: /etc/asterisk/extension.conf: No such file or directory
/dev/pts/3
17:08:39
#cat /etc/asterisk/extension.conf
cat: /etc/asterisk/extension.conf: No such file or directory
/dev/pts/2
17:08:39
#cat /etc/asterisk/extension.conf
cat: /etc/asterisk/extension.conf: No such file or directory
/dev/pts/3
17:08:47
#cat /etc/asterisk/extensions.conf
cat: /etc/asterisk/extensions.conf: No such file or directory
/dev/pts/2
17:08:47
#cat /etc/asterisk/extensions.conf
cat: /etc/asterisk/extensions.conf: No such file or directory
прошло 12 минут
/dev/pts/3
17:21:26
#cat /etc/asterisk/extensions.conf
[default]
exten => _21XX,1.Dial(SIP/${EXTEN})
/dev/pts/2
17:21:26
#cat /etc/asterisk/extensions.conf
[default]
exten => _21XX,1.Dial(SIP/${EXTEN})
/dev/pts/3
17:22:15
#asterisk -r
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2701)
debian4*CLI> dialplan reload
Dialplan reloaded.
debian4*CLI>
Disconnected from Asterisk server
/dev/pts/2
17:22:15
#asterisk -r
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2701)
debian4*CLI> dialplan reload
Dialplan reloaded.
debian4*CLI>
Disconnected from Asterisk server

Вторник (11/25/14)

/dev/pts/0
08:31:48
#screen
/dev/pts/3
08:37:29
#фыÐasterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity was 0 and is now 1
debian4*CLI> sip show pee
peers  peer
debian4*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102/2102                  192.168.40.101                           D   N             1646     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
debian4*CLI> quit
Executing last minute cleanups
/dev/pts/5
08:46:05
#screen -x
/dev/pts/3
08:51:32
#grep INTER /etc/default/isc-dhcp-server
CES="eth0"' >> /etc/default/isc-dhcp-server                  echo 'INTERFAC
08:51:32
#cat /etc/network/interfaces

08:51:32
#cat /etc/network/interfaces

08:51:32
#d/192.168.12.1/192.168.1

08:51:32
#ping 192.168.12.253
quality=yes
[2101]
[2101]
type=friend
secret=1234
[2102]
[2102]ynamic
[2102]
~
~
~
~
~
~
~
~
~
"/etc/asterisk/sip.conf" 13L, 128C written
08:54:28
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-3924.24169.24140	2014-11-25 09:55:30.613784448 +0200
+++ /etc/asterisk/sip.conf	2014-11-25 09:55:47.501784617 +0200
@@ -1,6 +1,7 @@
 [general]
 context=default
 quality=yes
+
 [2101]
 type=friend
 secret=1234
08:55:47
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> sip reload
 Reloading SIP
debian4*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102/2102                  192.168.40.101                           D   N             1646     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
debian4*CLI> quit
Executing last minute cleanups
09:00:50
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> sip show peers
...
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102/2102                  192.168.40.101                           D   N             35730    Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
debian4*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102/2102                  192.168.40.101                           D   N             35730    Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
debian4*CLI> quit
Executing last minute cleanups
прошло 16 минут
09:17:03
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-3924.27005.9916	2014-11-25 10:17:08.101799786 +0200
+++ /etc/asterisk/sip.conf	2014-11-25 10:17:23.997799964 +0200
@@ -1,6 +1,6 @@
 [general]
 context=default
-quality=yes
+qualify=yes
 
 [2101]
 type=friend
прошло 96 минут
10:53:25
#~

10:53:45
#chown asterisk /var/tmp/asterisk

10:54:13
#chown asterisk:asterisk /var/tmp/asterisk

10:54:44
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> /etc /var/tmp/asterisk
...
phoneprov    pri          queue        realtime     reload
rtcp         rtp          say          sip          skinny
sqlite       stun         timing       udptl        ulimit
unistim      voicemail
debian4*CLI> /etc /var/tmp/asterisk
No such command '/etc /var/tmp/asterisk' (type 'core show help /etc /var/tmp/asterisk' for other possible commands)
debian4*CLI> /etc /var/tmp/asterisk/
No such command '/etc /var/tmp/asterisk/' (type 'core show help /etc /var/tmp/asterisk/' for other possible commands)
debian4*CLI> quit
Executing last minute cleanups
10:56:08
#grep INTER /etc/default/isc-dhcp-server
CES="eth0"' >> /etc/default/isc-dhcp-server                  echo 'INTERFAC
10:56:08
#cat /etc/network/interfaces

10:56:08
#cat /etc/network/interfaces
                     cat /etc/var/tmp/asterisk
cat: /etc/var/tmp/asterisk: No such file or directory
прошло 12 минут
11:08:30
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> dialplan reload
Dialplan reloaded.
[Nov 25 12:09:24] NOTICE[2801]: chan_sip.c:22753 handle_request_invite: Call from '2101' (192.168.40.100:5060) to extension '8101' rejected because extension not found in context 'default'.
[Nov 25 12:09:52] WARNING[4646]: app_record.c:197 record_exec: No extension specified to filename!
[Nov 25 12:10:03] NOTICE[2801]: chan_sip.c:22753 handle_request_invite: Call from '2101' (192.168.40.100:5060) to extension '8102' rejected because extension not found in context 'default'.
debian4*CLI> quit
Executing last minute cleanups
11:12:23
#vim /etc/asterisk/extensions.conf
11:19:37
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> dialplan re
reload  remove
debian4*CLI> dialplan reload
Dialplan reloaded.
[Nov 25 12:20:20] WARNING[4735]: file.c:663 ast_openstream_full: File /var/tmp/asterisk/record00 does not exist in any format
[Nov 25 12:20:20] WARNING[4735]: file.c:958 ast_streamfile: Unable to open /var/tmp/asterisk/record00 (format 0x4 (ulaw)): No such file or directory
[Nov 25 12:20:20] WARNING[4735]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/2101-0000000f for /var/tmp/asterisk/record00
[Nov 25 12:20:20] WARNING[4735]: file.c:663 ast_openstream_full: File /var/tmp/asterisk/record00 does not exist in any format
[Nov 25 12:20:20] WARNING[4735]: file.c:958 ast_streamfile: Unable to open /var/tmp/asterisk/record00 (format 0x4 (ulaw)): No such file or directory
[Nov 25 12:20:20] WARNING[4735]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/2101-0000000f for /var/tmp/asterisk/record00
debian4*CLI> quit
Executing last minute cleanups
11:20:43
#grep INTER /etc/default/isc-dhcp-server
CES="eth0"' >> /etc/default/isc-dhcp-server                  echo 'INTERFAC
11:20:43
#cat /etc/network/interfaces

11:20:43
#cat /etc/network/interfaces

11:20:43
#d/192.168.12.1/192.168.1

11:20:43
#ping 192.168.12.253

11:20:43
#layout "us,ru"

11:20:43
## hello

11:20:43
#s/192.168.12.4/192.168.4

11:20:43
#cat /etc/network/interfaces

11:20:43
#cat /etc/network/interfaces

11:20:43
#cat /etc/network/interfaces
CES="eth0"' >> /etc/default/isc-dhcp-servert/isc-dhcp-server echo 'INTERFAC
11:20:43
#vim
--- /tmp/l3-saved-3924.25929.10850	2014-11-25 12:21:38.301888200 +0200
+++ /etc/asterisk/extensions.conf	2014-11-25 12:23:51.009889772 +0200
@@ -2,7 +2,7 @@
 
 exten => _21XX,1,Dial(SIP/${EXTEN})
 
-exten => _8100,1,Record(/var/tmp/asterisk/record00:gsm)
-exten => _81XX,n,Record(/var/tmp/asterisk/record${EXTEN:2})
-exten => _8200,1,Playback(/var/tmp/asterisk/record00)
-exten => _82XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2})
+
+exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm)
+
+exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2})
11:23:51
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> dialplan reload
Dialplan reloaded.
[Nov 25 12:24:18] WARNING[4815]: file.c:663 ast_openstream_full: File /var/tmp/asterisk/record00 does not exist in any format
[Nov 25 12:24:18] WARNING[4815]: file.c:958 ast_streamfile: Unable to open /var/tmp/asterisk/record00 (format 0x4 (ulaw)): No such file or directory
[Nov 25 12:24:18] WARNING[4815]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/2101-00000012 for /var/tmp/asterisk/record00
[Nov 25 12:29:35] NOTICE[2801]: chan_sip.c:26267 sip_poke_noanswer: Peer '2102' is now UNREACHABLE!  Last qualify: 27
[Nov 25 12:53:51] NOTICE[2801]: chan_sip.c:20886 handle_response_peerpoke: Peer '2102' is now Reachable. (34ms / 2000ms)
[Nov 25 12:53:51] NOTICE[2801]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 2102
debian4*CLI> quit
Executing last minute cleanups
прошло 53 минуты
12:17:35
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-3924.11650.24814	2014-11-25 13:21:54.701930999 +0200
+++ /etc/asterisk/sip.conf	2014-11-25 13:29:56.765936709 +0200
@@ -2,6 +2,13 @@
 context=default
 qualify=yes
 
+[phone](!)
+type=friend
+host=dinamic
+quality=yes
+
+register => ny:1234@192.168.50.1/atlanta
+
 [2101]
 type=friend
 secret=1234
@@ -12,3 +19,13 @@
 secret=1234
 host=dynamic
 
+[2103](phone)
+secret=1234
+
+
+[Atlanta]
+type=friend
+host=dynamic
+secret=1234
+directmedia=no
+
прошло 12 минут
12:29:56
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> sip reload
 Reloading SIP
[Nov 25 13:30:23] ERROR[2801]: netsock2.c:263 ast_sockaddr_resolve: getaddrinfo("dinamic", "(null)", ...): No address associated with hostname
[Nov 25 13:30:23] WARNING[2801]: acl.c:582 resolve_first: Unable to lookup 'dinamic'
debian4*CLI> quit
Executing last minute cleanups
12:30:44
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-3924.18607.1549	2014-11-25 13:30:48.401937325 +0200
+++ /etc/asterisk/sip.conf	2014-11-25 13:32:01.357938184 +0200
@@ -1,4 +1,4 @@
-[general]
+[default]
 context=default
 qualify=yes
 
12:32:01
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> sip reload
...
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102/2102                  192.168.40.101                           D   N             35356    Unmonitored
2103                       (Unspecified)                                N             0        Unmonitored
Atlanta                    (Unspecified)                            D   N             0        Unmonitored
4 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 2 offline]
debian4*CLI> sip reload
 Reloading SIP
debian4*CLI> quit
Executing last minute cleanups
12:34:00
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-3924.18381.7759	2014-11-25 13:34:02.145939613 +0200
+++ /etc/asterisk/sip.conf	2014-11-25 13:36:10.997941138 +0200
@@ -23,7 +23,7 @@
 secret=1234
 
 
-[Atlanta]
+[Atlanta](phone)
 type=friend
 host=dynamic
 secret=1234
12:36:11
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> sip reload
...
 Reloading SIP
debian4*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102/2102                  192.168.40.101                           D   N             35356    Unmonitored
2103                       (Unspecified)                                N             0        Unmonitored
Atlanta                    (Unspecified)                            D   N             0        Unmonitored
4 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 2 offline]
debian4*CLI> quit
Executing last minute cleanups
12:36:44
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-3924.2852.4908	2014-11-25 13:36:46.637941560 +0200
+++ /etc/asterisk/sip.conf	2014-11-25 13:37:29.465942067 +0200
@@ -23,7 +23,7 @@
 secret=1234
 
 
-[Atlanta](phone)
+[atlanta]
 type=friend
 host=dynamic
 secret=1234
12:37:29
#ast
astcanary  asterisk   astgenkey
12:37:29
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> sip reload
...
[Nov 25 13:37:43] WARNING[2801]: acl.c:582 resolve_first: Unable to lookup 'dinamic'
debian4*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     Unmonitored
2102/2102                  192.168.40.101                           D   N             35356    Unmonitored
2103                       (Unspecified)                                N             0        Unmonitored
atlanta                    (Unspecified)                            D   N             0        Unmonitored
4 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 2 offline]
debian4*CLI> quit
Executing last minute cleanups
12:38:11
#vim /etc/asterisk/sip.conf
12:42:49
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-3924.17318.20974	2014-11-25 13:42:53.301945897 +0200
+++ /etc/asterisk/sip.conf	2014-11-25 13:46:38.389948561 +0200
@@ -1,13 +1,14 @@
-[default]
+[general]
 context=default
 qualify=yes
 
+register => ny:1234@192.168.50.1/atlanta
+
 [phone](!)
 type=friend
 host=dinamic
 quality=yes
 
-register => ny:1234@192.168.50.1/atlanta
 
 [2101]
 type=friend
/dev/pts/7
12:46:12
#asterisk -rx 'sip reload'

12:46:18
#asterisk -rx 'sip reload'

12:46:36
#less /etc/asterisk/sip.conf
/dev/pts/3
12:46:38
#asterisk -rv
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.
=========================================================================
Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 2508)
Verbosity is at least 1
debian4*CLI> sip reload
...
[Nov 25 13:46:52] NOTICE[2801]: chan_sip.c:26267 sip_poke_noanswer: Peer '2102' is now UNREACHABLE!  Last qualify: 0
debian4*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2101/2101                  192.168.40.100                           D   N             5060     OK (21 ms)
2102/2102                  192.168.40.101                           D   N             35356    UNREACHABLE
2103                       (Unspecified)                                N             0        UNKNOWN
atlanta/ny                 192.168.50.1                             D   N             5060     OK (1 ms)
4 sip peers [Monitored: 2 online, 2 offline Unmonitored: 0 online, 0 offline]
debian4*CLI> quit
Executing last minute cleanups
/dev/pts/7
12:47:14
## все нормально зарегистрировались (ny, atlanta)

/dev/pts/3
12:49:33
#vim /etc/asterisk/sip.conf

Файлы

  • /etc/asterisk/extensions.conf
  • /etc/asterisk/sip.conf
  • /etc/network/interfaces
  • /etc/asterisk/extensions.conf
    >
    [default]
    exten => _21XX,1.Dial(SIP/${EXTEN})
    
    /etc/asterisk/sip.conf
    >
    [general]
    context=default
    [2101]
    type=friend
    secret=1234
    host=dynamic
    [2102]
    type=friend
    secret=1234
    host=dynamic
    
    /etc/network/interfaces
    >
    CES="eth0"' >> /etc/default/isc-dhcp-servert/isc-dhcp-server echo 'INTERFAC
    

    Статистика

    Время первой команды журнала16:18:53 2014-11-24
    Время последней команды журнала12:49:33 2014-11-25
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, % 8.91
    Процент синтаксически неверно набранных команд, % 1.98
    Суммарное время работы с терминалом *, час 2.85
    Количество командных строк в единицу времени, команда/мин 0.59
    Частота использования команд
    asterisk41|========================================| 40.20%
    cat18|=================| 17.65%
    vim11|==========| 10.78%
    screen4|===| 3.92%
    #4|===| 3.92%
    grep4|===| 3.92%
    ping2|=| 1.96%
    chown2|=| 1.96%
    192.168.12|=| 1.96%
    /etc/init.d/asterisk2|=| 1.96%
    reboot2|=| 1.96%
    restart2|=| 1.96%
    ps1|| 0.98%
    192.168.41|| 0.98%
    фыÐasterisk1|| 0.98%
    less1|| 0.98%
    layout1|| 0.98%
    ~1|| 0.98%
    ast1|| 0.98%
    date1|| 0.98%
    ____
    *) Интервалы неактивности длительностью 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$