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

Содержание

Журнал

Понедельник (10/25/10)

16:00:36
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 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.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
spans  span
linux8*CLI> pri show span
Usage: pri show span <span>
       Displays PRI Information on a given PRI span
linux8*CLI> pri show spans
linux8*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline]
linux8*CLI> quit
Executing last minute cleanups
16:02:24
#which rasterisk
/usr/sbin/rasterisk
16:02:27
#file `!!`
file `which rasterisk `
/usr/sbin/rasterisk: symbolic link to `asterisk'
16:03:14
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
16:03:54
#ls /var/log/asterisk/
cdr-csv  cdr-custom  event_log  messages  queue_log
16:03:58
#less /var/log/asterisk/messages
прошло 16 минут
16:20:21
#vi /tmp/sip.conf
16:21:12
#grep -v "^\s*;" /tmp/sip.conf | less
/dev/pts/10
16:21:22
#screen -x
16:21:38
#mv /etc/asterisk/sip.conf{,.orig}

16:23:37
#echo xyz{1,2}
xyz1 xyz2
16:23:54
#echo xyz{,2}
xyz xyz2
16:24:03
#echo xyz{,.orig}
xyz xyz.orig
16:24:08
#ls /tmp
install  sip.conf  ssh-qyWKxq8696
16:25:07
#less /etc/asterisk/sip.conf
/dev/pts/12
16:28:53
#ls -lah /etc/asterisk/sip.conf
-rw-r--r-- 1 root root 350 Окт 25 17:25 /etc/asterisk/sip.conf
16:29:22
#cat /etc/asterisk/sip.conf
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
[authentication]
16:33:09
#cat /etc/asterisk/sip.conf
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
[authentication]
[1801]
type=friend
secret=1234
host=dynamic
16:34:07
#cat /etc/asterisk/sip.conf
sip.conf       sip.conf.orig
16:34:07
#cat /etc/asterisk/sip.conf.orig
;
; SIP Configuration example for Asterisk
;
; Syntax for specifying a SIP device in extensions.conf is
; SIP/devicename where devicename is defined in a section below.
;
; You may also use
; SIP/username@domain to call any SIP user on the Internet
; (Don't forget to enable DNS SRV records if you want to use this)
;
...
;[pre14-asterisk]
;type=friend
;secret=digium
;host=dynamic
;rfc2833compensate=yes          ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
                                ; You must have this turned on or DTMF reception will work improperly.
;t38pt_usertpsource=yes         ; Use the source IP address of RTP as the destination IP address for UDPTL packets
                                ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the
                                ; external IP address of the remote device. If port forwarding is done at the client side
                                ; then UDPTL will flow to the remote device.
16:39:01
#man scp
прошло 12 минут
16:51:35
#~ [ ]
  2 exten => 1899,1,Answer
  3 exten => 1899,n,Wait(1)
  4                 Playback(demo-thanks)
  5 exten => 1899,n,Hangup
  6
  7
~
~
~
~
...
~
~
~
~
~
~
~
~
~
"/etc/asterisk/extensions.conf" [Новый] 7L, 120C записано
16:52:52
#cat /etc/asterisk/extensions.conf
[default]
exten => 1899,1,Answer
exten => 1899,n,Wait(1)
exten => 1899,n,Playback(demo-thanks)
exten => 1899,n,Hangup
прошло 10 минут
/dev/pts/0
17:03:25
#cat /etc/asterisk/s
say.conf         sip.conf.orig    skinny.conf      smdi.conf
sip.conf         sip_notify.conf  sla.conf
17:03:25
#cat /etc/asterisk/sip.conf
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
[authentication]
[1801]
type=friend
secret=1234
host=dynamic
17:03:59
#cat /etc/asterisk/sip.conf.orig
;
; SIP Configuration example for Asterisk
;
; Syntax for specifying a SIP device in extensions.conf is
; SIP/devicename where devicename is defined in a section below.
;
; You may also use
; SIP/username@domain to call any SIP user on the Internet
; (Don't forget to enable DNS SRV records if you want to use this)
;
...
;[pre14-asterisk]
;type=friend
;secret=digium
;host=dynamic
;rfc2833compensate=yes          ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
                                ; You must have this turned on or DTMF reception will work improperly.
;t38pt_usertpsource=yes         ; Use the source IP address of RTP as the destination IP address for UDPTL packets
                                ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the
                                ; external IP address of the remote device. If port forwarding is done at the client side
                                ; then UDPTL will flow to the remote device.
17:10:25
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 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.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
    -- Registered extension context 'default'
    -- Added extension '1899' priority 1 to default
    -- Added extension '1899' priority 2 to default
    -- Added extension '1899' priority 3 to default
    -- Added extension '1899' priority 4 to default
  == Parsing '/etc/asterisk/users.conf': Found
    -- Executing [1899@default:1] Answer("SIP/1801-090fad80", "") in new stack
    -- Executing [1899@default:2] Wait("SIP/1801-090fad80", "1") in new stack
    -- Executing [1899@default:3] Playback("SIP/1801-090fad80", "demo-thanks") in new stack
    -- <SIP/1801-090fad80> Playing 'demo-thanks' (language 'en')

Вторник (10/26/10)

08:14:16
#ssh root@194.150.95.201
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.6.2.9-2 currently running on deb01 (pid = 13214)
Verbosity was 0 and is now 2
deb01*CLI> sip show peers
No such command 'sip show peers' (type 'core show help sip show' for other possible commands)
deb01*CLI> sip reload
No such command 'sip reload' (type 'core show help sip reload' for other possible commands)
deb01*CLI> exit
Executing last minute cleanups
root@deb01:~# exit
logout
Connection to 194.150.95.201 closed.
08:23:23
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 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.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
1801/1801                  192.168.108.200  D          5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
[Oct 26 09:31:24] WARNING[15249]: chan_sip.c:8505 check_auth: username mismatch, have <1801>, digest has <UNPROVISIONED>
[Oct 26 09:31:24] NOTICE[15249]: chan_sip.c:15642 handle_request_register: Registration from 'sip:1801@192.168.108.1' failed for '192.168.108.201' - Username/auth name mismatch
linux8*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
1801/1801                  192.168.108.200  D          5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
linux8*CLI> exit
Executing last minute cleanups
08:32:05
#reboot

/dev/tty1
08:36:22
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 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.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
Name/username              Host            Dyn Nat ACL Port     Status
1801/1801                  192.168.108.201  D          5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
    -- Executing [1899@default:1] Answer("SIP/1801-08588a60", "") in new stack
    -- Executing [1899@default:2] Wait("SIP/1801-08588a60", "1") in new stack
    -- Executing [1899@default:3] Playback("SIP/1801-08588a60", "demo-thanks") in new stack
    -- <SIP/1801-08588a60> Playing 'demo-thanks' (language 'en')
  == Spawn extension (default, 1899, 3) exited non-zero on 'SIP/1801-08588a60'
linux8*CLI> exit
Executing last minute cleanups
08:43:23
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-2338.30704.3256	2010-10-26 09:43:46.000000000 +0300
+++ /etc/asterisk/sip.conf	2010-10-26 09:44:29.000000000 +0300
@@ -13,3 +13,7 @@
 secret=1234
 host=dynamic
 
+[1802]
+type=friend
+secret=1234
+host=dynamic
08:44:29
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 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.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
  == Parsing '/etc/asterisk/sip_notify.conf': Found
    -- Registered SIP '1802' at 192.168.108.200 port 5060 expires 3600
linux8*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
1802/1802                  192.168.108.200  D          5060     Unmonitored
1801/1801                  192.168.108.201  D          5060     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
    -- Unregistered SIP '1802'
linux8*CLI> exit
Executing last minute cleanups
/dev/pts/1
08:46:31
#screen -x
08:46:34
#screen
/dev/pts/3
08:46:38
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2575.8628.5253	2010-10-26 09:47:35.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 10:19:36.000000000 +0300
@@ -5,3 +5,10 @@
 exten => 1899,n,Playback(demo-thanks)
 exten => 1899,n,Hangup
 
+exten => _18XX,1,Dial(SIP/${EXTEN})
+
+exten => _68XX,1,Wait(2)
+exten => _68XX,n,Playback(/tmp/warning1)
+exten => _68XX,n,Dial(SIP/18${EXTEN:2})
+
+exten => 1898,1,Record(/tmp/warning1:gsm,,3)
/dev/pts/5
08:46:59
#screen -x
/dev/pts/7
08:47:12
#screen -x
/dev/pts/9
08:47:35
#screen -x
/dev/pts/11
08:47:54
#screen -x
/dev/pts/13
08:48:01
#screen -x
/dev/tty2
08:48:08
#screen -x
/dev/tty1
08:48:27
#vim /etc/asterisk/sip.conf
/dev/pts/16
08:48:34
#scren -x
bash: scren: команда не найдена
08:48:39
#screen -x
/dev/pts/20
08:48:47
#screen -X
08:48:57
#screen x
/dev/pts/22
08:48:58
#screen -x
/dev/pts/24
08:49:12
#screen -x
/dev/pts/20
08:49:17
#screen -x
/dev/pts/26
08:50:14
#screen -x
/dev/pts/28
08:56:41
#screen -x
прошло 16 минут
/dev/tty1
09:13:09
#ls /etc/
acpi                    fstab             mailcap          rc4.d
adduser.conf            gai.conf          mailcap.order    rc5.d
adjtime                 groff             mailname         rc6.d
aliases                 group             mail.rc          rc.local
alternatives            group-            manpath.config   rcS.d
apm                     gshadow           mime.types       reportbug.conf
apt                     gshadow-          mke2fs.conf      resolv.conf
asterisk                gssapi_mech.conf  modprobe.d       rmt
at.deny                 host.conf         modules          rpc
bash.bashrc             hostname          motd             rsyslog.conf
...
debian_version          locale.alias      ppp              timezone
default                 locale.gen        profile          ucf.conf
deluser.conf            localtime         protocols        udev
dhcp3                   logcheck          python           updatedb.conf
dictionaries-common     login.defs        python2.5        vim
dpkg                    logrotate.conf    radiusclient-ng  w3m
emacs                   logrotate.d       rc0.d            wgetrc
email-addresses         lsb-base          rc1.d            X11
environment             magic             rc2.d
exim4                   magic.mime        rc3.d
09:13:12
#ls /tmp/
l3-saved-2575.8628.5253  ssh-kzeezx2437  warning1.gsm
09:13:16
#rm /tmp/warning1.gsm

/dev/pts/3
09:20:34
# 13
/.
/etc
/etc/asterisk
/etc/logrotate.d
/etc/logrotate.d/asterisk
/etc/default
/etc/default/asterisk
/etc/init.d
/etc/init.d/asterisk
/usr
...
/usr/lib/asterisk/modules/app_segfault.so
/usr/lib/asterisk/modules/app_senddtmf.so
/usr/lib/asterisk/modules/app_sendtext.so
/usr/lib/asterisk/modules/app_setcallerid.so
/usr/lib/asterisk/modules/app_setcdruserfield.so
/usr/lib/asterisk/modules/app_settransfercapability.so
/usr/lib/asterisk/modules/app_zapscan.so
/usr/lib/asterisk/modules/codec_a_mu.so
/usr/lib/asterisk/modules/codec_adpcm.so
/usr/lib/asterisk/modules/codec_alaw.so
/dev/pts/18
09:22:05
#screen -x
/dev/pts/3
09:25:08
#w
 10:31:14 up 58 min, 16 users,  load average: 0,00, 0,26, 0,42
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1     -                09:36   11:30   0.48s  0.00s /bin/lo
root     tty2     -                09:48   11:38   0.72s  0.00s /bin/lo
root     pts/1    10.0.100.3       09:46    0.00s  0.36s  0.26s script
root     pts/3    :pts/2:S.0       09:46    0.00s  0.56s  0.24s script
root     pts/5    192.168.104.1    09:46   44:12   0.30s  0.20s script
root     pts/7    192.168.111.1    09:47   12:40   0.36s  0.20s script
root     pts/9    192.168.105.1    09:47    6:06   0.32s  0.20s script
root     pts/11   192.168.102.1    09:47   43:16   0.32s  0.20s script
root     pts/13   192.168.103.1    09:47    9:20   0.36s  0.22s script
root     pts/16   192.168.101.1    09:48   42:30   0.30s  0.22s script
root     pts/18   192.168.112.2    10:22    8:51   0.20s  0.20s script
root     pts/20   192.168.107.1    09:48   41:40   0.34s  0.22s script
root     pts/22   192.168.106.1    09:48   42:14   0.38s  0.20s script
root     pts/24   192.168.109.1    09:49   36:54   0.28s  0.20s script
root     pts/26   192.168.110.1    09:50   36:03   0.30s  0.20s script
root     pts/28   192.168.112.2    09:56   18:49   0.28s  0.22s script
09:31:14
## http://xgu.ru/class/nt-voip-2010-oct/

прошло 12 минут
/dev/pts/18
09:43:22
#screen -x
прошло 13 минут
/dev/tty1
09:56:36
#vim /etc/asterisk/sip
/dev/pts/3
09:56:49
#~ [ ]
 13 secret=1234
 14
    [authentication]
 15
    [1801]
 16 type=friend
    secret=1234
    host=dynamic
 18
    [1802]
...
 10 register => tl:1234@192.168.105.1/ptr
  9 re
 12 [authentication]
 14 [1801]e mouse:  ":set mouse=a" to enable the mouse (in xterm or GUI))
Jump to a subject:
 16 secret=1234
                                                      2,0-1
  3 allowoverlap=no                 ; Disable overlap dialing support. (µÑ€Ñ…у
/etc/asterisk/sip.conf                                3,23-37         5%
:q
/dev/pts/28
09:57:02
#screen -x
прошла 41 минута
/dev/pts/18
10:39:01
#screen -x
/dev/pts/3
10:39:46
#ssh root@194.150.95.200
The authenticity of host '194.150.95.200 (194.150.95.200)' can't be established.
RSA key fingerprint is d6:14:17:c6:eb:48:62:8d:83:61:42:98:21:8c:cd:2e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '194.150.95.200' (RSA) to the list of known hosts.
root@194.150.95.200's password:
Linux pandora 2.6.32.24 #1 SMP Mon Oct 18 15:05:56 EEST 2010 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
...
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux-ng 2.17.2
done.
Mounting local filesystems...done.
Activating swapfile swap...done.
Cleaning up temporary files....
Setting kernel variables ...done.
Configuring network interfaces...done.
Cleaning up temporary files....
Setting console screen modes and fonts.
10:40:26
#ssh root@194.150.95.201
root@194.150.95.201's password:
Permission denied, please try again.
root@194.150.95.201's password:
Linux deb01 2.6.32.24 #1 SMP Mon Oct 18 15:05:56 EEST 2010 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct 26 11:39:41 2010 from relay02.techexpert.ua
...
say     skinny  sla     sqlite  ss7     stun
deb01*CLI> s
say     skinny  sla     sqlite  ss7     stun
deb01*CLI> sip show peers
No such command 'sip show peers' (type 'core show help sip show' for other possible commands)
deb01*CLI> exit
Executing last minute cleanups
root@deb01:~# exit
logout
Connection to 194.150.95.201 closed.
/dev/tty1
10:43:38
#vim /etc/asterisk/extensions.
10:43:50
#~
extensions.ael        extensions.conf       extensions.conf.orig
10:43:50
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2338.22659.19269	2010-10-26 11:43:53.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 11:44:38.000000000 +0300
@@ -13,3 +13,5 @@
 exten => _68XX,n,Dial(SIP/18${EXTEN:2})
 
 exten => 1898,1,Record(/tmp/warning1:gsm,,3)
+
+exten => 1601,1,Dial(SIP/kzn)
10:45:20
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2338.9925.9179	2010-10-26 11:45:30.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 11:46:21.000000000 +0300
@@ -14,4 +14,4 @@
 
 exten => 1898,1,Record(/tmp/warning1:gsm,,3)
 
-exten => 1601,1,Dial(SIP/kzn)
+exten => 1699,1,Dial(SIP/kzn)
10:46:51
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2338.7349.19729	2010-10-26 11:46:53.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 11:46:57.000000000 +0300
@@ -13,5 +13,3 @@
 exten => _68XX,n,Dial(SIP/18${EXTEN:2})
 
 exten => 1898,1,Record(/tmp/warning1:gsm,,3)
-
-exten => 1699,1,Dial(SIP/kzn)
/dev/pts/3
10:47:57
# 23
  8 exten => _18XX,1,Dial(SIP/${EXTEN})
  9 exten => _18XXX,1,Dial(SIP/1${EXTEN:1:4})
 10
 11 exten => _68XX,1,Wait(2)
"/etc/asterisk/extensions.conf" 15L, 351C
 12 exten => _68XX,n,Playback(/tmp/warning1)
 16
~   exten => _15XX,1,Dial(SIP/ptr/${EXTEN})
 17 exten => _16XX,1,Dial(SIP/kzn/${EXTEN})
 18            7XX,1,Dial(SIP/msk/${EXTEN})
 19 exten => _15XX,1,Dial(SIP/ptr/${EXTEN})
~
"/etc/asterisk/extensions.conf" 19L, 472C записа19,29        Весь
 20
    exten => _1XXX,1,Dial(SIP/msk/${EXTEN})
                         (                )
                                                      21,39        Весь
/dev/pts/18
10:57:36
#ssh 192.168.15.101
^C
10:57:48
#ssh 192.168.101.1
The authenticity of host '192.168.101.1 (192.168.101.1)' can't be established.
RSA key fingerprint is ee:eb:fa:79:c7:9e:0d:ae:d6:2f:fe:13:76:6f:21:ea.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.101.1' (RSA) to the list of known hosts.
root@192.168.101.1's password:
Linux linux1.unix.nt 2.6.26-2-686 #1 SMP Thu Sep 16 19:35:51 UTC 2010 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct 26 11:35:13 2010
l3-agent is already running: pid=4811; pidfile=/root/.lilalo/l3-agent.pid
10:58:07
#less /etc/asterisk/sip.conf
/dev/pts/28
10:58:12
#screen -x
/dev/pts/18
10:58:31
#asterisk -rx 'sip show peers'
Name/username              Host            Dyn Nat ACL Port     Status
vn/nk                      192.168.104.1    D          5060     Unmonitored
kv/nk                      192.168.103.1    D          5060     Unmonitored
rv/nk                      192.168.102.1    D          5060     Unmonitored
1102/1102                  192.168.101.201  D          49492    Unmonitored
1101/1101                  192.168.101.200  D          2048     Unmonitored
5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 5 online, 0 offline]
/dev/pts/3
10:59:53
#{EXTEN})
 13
 14 [1801]         ]
 15 [1801]riend
 16 secret=1234
 18
 19 [1802]
 20 type=friend
                                                      19,1           8%
 22 host=dynamic
 24 [msk]
 26 secret=1234
 25 type=friend                                       25,1          25%
/dev/tty1
11:04:19
#vim /etc/asterisk/ext
11:04:26
#~
extconfig.conf        extensions.conf
extensions.ael        extensions.conf.orig
11:04:26
#vim /etc/asterisk/ext
11:04:26
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2338.3341.29297	2010-10-26 12:06:06.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 12:06:46.000000000 +0300
@@ -6,6 +6,7 @@
 exten => 1899,n,Hangup
 
 exten => _18XX,1,Dial(SIP/${EXTEN})
+exten => _18XX,1,Playback(/tmp/11.gsm)
 exten => _18XXX,1,Dial(SIP/1${EXTEN:1:4})
 
 exten => _68XX,1,Wait(2)
11:04:46
#~ [ ]

/dev/pts/3
11:05:56
# 27 host=dynamic
zaptel-source - Zapata telephony interface (source code for kernel driver)
/dev/tty1
11:06:46
#dpkg -l asterisk-sounds-main |less
11:07:08
#locate asterisk-sounds-main
/usr/share/doc/asterisk-sounds-main
/usr/share/doc/asterisk-sounds-main/NEWS.Debian.gz
/usr/share/doc/asterisk-sounds-main/changelog.Debian.gz
/usr/share/doc/asterisk-sounds-main/changelog.gz
/usr/share/doc/asterisk-sounds-main/copyright
/usr/share/lintian/overrides/asterisk-sounds-main
/var/cache/apt/archives/asterisk-sounds-main_1%3a1.4.21.2~dfsg-3+lenny1_all.deb
/var/lib/dpkg/info/asterisk-sounds-main.list
/var/lib/dpkg/info/asterisk-sounds-main.md5sums
11:07:22
#cd /usr/share/doc/a
acpid/                 aptitude/              asterisk-sounds-extra/
acpi-support-base/     apt-utils/             asterisk-sounds-main/
adduser/               asterisk/              at/
apt/                   asterisk-config/
11:07:22
#cd /usr/share/doc/asterisk-sounds-main/

11:07:39
#ls
changelog.Debian.gz  changelog.gz  copyright  NEWS.Debian.gz
11:07:40
#cd ..

прошло 23 минуты
/dev/pts/28
11:30:41
#screen -x
/dev/tty1
11:31:14
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2338.19560.29781	2010-10-26 12:32:24.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 12:34:38.000000000 +0300
@@ -28,3 +28,6 @@
 exten => _12XX,1,Dial(SIP/kv/${EXTEN})
 exten => _13XX,1,Dial(SIP/kv/${EXTEN})
 exten => _14XX,1,Dial(SIP/kv/${EXTEN})
+
+[internal]
+
/dev/pts/30
11:33:57
#screen -x
/dev/pts/3
11:34:31
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2575.3613.23502	2010-10-26 12:34:41.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 12:36:58.000000000 +0300
@@ -29,5 +29,6 @@
 exten => _13XX,1,Dial(SIP/kv/${EXTEN})
 exten => _14XX,1,Dial(SIP/kv/${EXTEN})
 
-[internal]
+[group1]
+exten => 1802,1,Dial(SIP/1802)
 
11:36:58
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-2575.950.8650	2010-10-26 12:37:03.000000000 +0300
+++ /etc/asterisk/sip.conf	2010-10-26 12:39:31.000000000 +0300
@@ -16,12 +16,14 @@
 secret=1234
 host=dynamic
 callerid="Wilen (Tula)"
+context=group2
 
 [1802]
 type=friend
 secret=1234
 host=dynamic
 callerid="Wilen, Softphone (Tula)"
+context=group1
 
 [msk]
 type=friend
11:39:31
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2575.22293.11623	2010-10-26 12:39:40.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 12:40:12.000000000 +0300
@@ -32,3 +32,5 @@
 [group1]
 exten => 1802,1,Dial(SIP/1802)
 
+[group2]
+exten => 1801,1,Dial(SIP/1801)
11:40:12
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2575.19625.4640	2010-10-26 12:40:45.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 12:41:10.000000000 +0300
@@ -33,4 +33,4 @@
 exten => 1802,1,Dial(SIP/1802)
 
 [group2]
-exten => 1801,1,Dial(SIP/1801)
+exten => 1801,1,Dial(SIP/msk/${EXTEN})
/dev/pts/32
11:40:59
#sx
bash: sx: команда не найдена
11:41:01
#screen -x
/dev/pts/3
11:41:10
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2575.26690.25473	2010-10-26 12:41:35.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 12:42:02.000000000 +0300
@@ -30,7 +30,7 @@
 exten => _14XX,1,Dial(SIP/kv/${EXTEN})
 
 [group1]
-exten => 1802,1,Dial(SIP/1802)
+exten => 1802,1,Dial(SIP/1801)
 
 [group2]
-exten => 1801,1,Dial(SIP/msk/${EXTEN})
+exten => 1801,1,Dial(SIP/1802)
11:42:02
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2575.23437.13253	2010-10-26 12:42:18.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 12:42:29.000000000 +0300
@@ -30,7 +30,7 @@
 exten => _14XX,1,Dial(SIP/kv/${EXTEN})
 
 [group1]
-exten => 1802,1,Dial(SIP/1801)
+exten => 1802,1,Dial(SIP/1802)
 
 [group2]
-exten => 1801,1,Dial(SIP/1802)
+exten => 1801,1,Dial(SIP/1801)

Файлы

  • /etc/asterisk/extensions.conf
  • /etc/asterisk/s
  • /etc/asterisk/sip.conf
  • /etc/asterisk/sip.conf.orig
  • /etc/asterisk/extensions.conf
    >
    [default]
    exten => 1899,1,Answer
    exten => 1899,n,Wait(1)
    exten => 1899,n,Playback(demo-thanks)
    exten => 1899,n,Hangup
    
    /etc/asterisk/s
    >
    say.conf         sip.conf.orig    skinny.conf      smdi.conf
    sip.conf         sip_notify.conf  sla.conf
    
    /etc/asterisk/sip.conf
    >
    [general]
    context=default                 ; Default context for incoming calls
    allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
    bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
    bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
    srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
    [authentication]
    [1801]
    type=friend
    secret=1234
    host=dynamic
    
    /etc/asterisk/sip.conf.orig
    >
    ;
    ; SIP Configuration example for Asterisk
    ;
    ; Syntax for specifying a SIP device in extensions.conf is
    ; SIP/devicename where devicename is defined in a section below.
    ;
    ; You may also use
    ; SIP/username@domain to call any SIP user on the Internet
    ; (Don't forget to enable DNS SRV records if you want to use this)
    ;
    ; If you define a SIP proxy as a peer below, you may call
    ; SIP/proxyhostname/user or SIP/user@proxyhostname
    ; where the proxyhostname is defined in a section below
    ;
    ; Useful CLI commands to check peers/users:
    ;   sip show peers              Show all SIP peers (including friends)
    ;   sip show users              Show all SIP users (including friends)
    ;   sip show registry           Show status of hosts we register with
    ;
    ;   sip debug                   Show all SIP messages
    ;
    ;   reload chan_sip.so          Reload configuration file
    ;                               Active SIP peers will not be reconfigured
    ;
    [general]
    context=default                 ; Default context for incoming calls
    ;allowguest=no                  ; Allow or reject guest calls (default is yes)
    allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
    ;allowtransfer=no               ; Disable all transfers (unless enabled in peers or users)
                                    ; Default is enabled
    ;realm=mydomain.tld             ; Realm for digest authentication
                                    ; defaults to "asterisk". If you set a system name in
                                    ; asterisk.conf, it defaults to that system name
                                    ; Realms MUST be globally unique according to RFC 3261
                                    ; Set this to your host name or domain name
    bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
                                    ; bindport is the local UDP port that Asterisk will listen on
    bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
    srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
                                    ; Note: Asterisk only uses the first host
                                    ; in SRV records
                                    ; Disabling DNS SRV lookups disables the
                                    ; ability to place SIP calls based on domain
                                    ; names to some other SIP users on the Internet
    ;domain=mydomain.tld            ; Set default domain for this host
                                    ; If configured, Asterisk will only allow
                                    ; INVITE and REFER to non-local domains
                                    ; Use "sip show domains" to list local domains
    ;pedantic=yes                   ; Enable checking of tags in headers,
                                    ; international character conversions in URIs
                                    ; and multiline formatted headers for strict
                                    ; SIP compatibility (defaults to "no")
    ; See doc/ip-tos.txt for a description of these parameters.
    ;tos_sip=cs3                    ; Sets TOS for SIP packets.
    ;tos_audio=ef                   ; Sets TOS for RTP audio packets.
    ;tos_video=af41                 ; Sets TOS for RTP video packets.
    ;maxexpiry=3600                 ; Maximum allowed time of incoming registrations
                                    ; and subscriptions (seconds)
    ;minexpiry=60                   ; Minimum length of registrations/subscriptions (default 60)
    ;defaultexpiry=120              ; Default length of incoming/outgoing registration
    ;t1min=100                      ; Minimum roundtrip time for messages to monitored hosts
                                    ; Defaults to 100 ms
    ;notifymimetype=text/plain      ; Allow overriding of mime type in MWI NOTIFY
    ;checkmwi=10                    ; Default time between mailbox checks for peers
    ;buggymwi=no                    ; Cisco SIP firmware doesn't support the MWI RFC
                                    ; fully. Enable this option to not get error messages
                                    ; when sending MWI to phones with this bug.
    ;vmexten=voicemail              ; dialplan extension to reach mailbox sets the
                                    ; Message-Account in the MWI notify message
                                    ; defaults to "asterisk"
    ;disallow=all                   ; First disallow all codecs
    ;allow=ulaw                     ; Allow codecs in order of preference
    ;allow=ilbc                     ; see doc/rtp-packetization for framing options
    ;
    ; This option specifies a preference for which music on hold class this channel
    ; should listen to when put on hold if the music class has not been set on the
    ; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
    ; channel putting this one on hold did not suggest a music class.
    ;
    ; This option may be specified globally, or on a per-user or per-peer basis.
    ;
    ;mohinterpret=default
    ;
    ; This option specifies which music on hold class to suggest to the peer channel
    ; when this channel places the peer on hold. It may be specified globally or on
    ; a per-user or per-peer basis.
    ;
    ;mohsuggest=default
    ;
    ;language=en                    ; Default language setting for all users/peers
                                    ; This may also be set for individual users/peers
    ;relaxdtmf=yes                  ; Relax dtmf handling
    ;trustrpid = no                 ; If Remote-Party-ID should be trusted
    ;sendrpid = yes                 ; If Remote-Party-ID should be sent
    ;progressinband=never           ; If we should generate in-band ringing always
                                    ; use 'never' to never use in-band signalling, even in cases
                                    ; where some buggy devices might not render it
                                    ; Valid values: yes, no, never Default: never
    ;useragent=Asterisk PBX         ; Allows you to change the user agent string
    ;promiscredir = no              ; If yes, allows 302 or REDIR to non-local SIP address
                                    ; Note that promiscredir when redirects are made to the
                                    ; local system will cause loops since Asterisk is incapable
                                    ; of performing a "hairpin" call.
    ;usereqphone = no               ; If yes, ";user=phone" is added to uri that contains
                                    ; a valid phone number
    ;dtmfmode = rfc2833             ; Set default dtmfmode for sending DTMF. Default: rfc2833
                                    ; Other options:
                                    ; info : SIP INFO messages
                                    ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
                                    ; auto : Use rfc2833 if offered, inband otherwise
    ;compactheaders = yes           ; send compact sip headers.
    ;
    ;videosupport=yes               ; Turn on support for SIP video. You need to turn this on
                                    ; in the this section to get any video support at all.
                                    ; You can turn it off on a per peer basis if the general
                                    ; video support is enabled, but you can't enable it for
                                    ; one peer only without enabling in the general section.
    ;maxcallbitrate=384             ; Maximum bitrate for video calls (default 384 kb/s)
                                    ; Videosupport and maxcallbitrate is settable
                                    ; for peers and users as well
    ;callevents=no                  ; generate manager events when sip ua
                                    ; performs events (e.g. hold)
    ;alwaysauthreject = yes         ; When an incoming INVITE or REGISTER is to be rejected,
                                    ; for any reason, always reject with '401 Unauthorized'
                                    ; instead of letting the requester know whether there was
                                    ; a matching user or peer for their request
    ;g726nonstandard = yes          ; If the peer negotiates G726-32 audio, use AAL2 packing
                                    ; order instead of RFC3551 packing order (this is required
                                    ; for Sipura and Grandstream ATAs, among others). This is
                                    ; contrary to the RFC3551 specification, the peer _should_
                                    ; be negotiating AAL2-G726-32 instead :-(
    ;matchexterniplocally = yes     ; Only substitute the externip or externhost setting if it matches
                                    ; your localnet setting. Unless you have some sort of strange network
                                    ; setup you will not need to enable this.
    ;
    ; If regcontext is specified, Asterisk will dynamically create and destroy a
    ; NoOp priority 1 extension for a given peer who registers or unregisters with
    ; us and have a "regexten=" configuration item.
    ; Multiple contexts may be specified by separating them with '&'. The
    ; actual extension is the 'regexten' parameter of the registering peer or its
    ; name if 'regexten' is not provided.  If more than one context is provided,
    ; the context must be specified within regexten by appending the desired
    ; context after '@'.  More than one regexten may be supplied if they are
    ; separated by '&'.  Patterns may be used in regexten.
    ;
    ;regcontext=sipregistrations
    ;
    ;--------------------------- RTP timers ----------------------------------------------------
    ; These timers are currently used for both audio and video streams. The RTP timeouts
    ; are only applied to the audio channel.
    ; The settings are settable in the global section as well as per device
    ;
    ;rtptimeout=60                  ; Terminate call if 60 seconds of no RTP or RTCP activity
                                    ; on the audio channel
                                    ; when we're not on hold. This is to be able to hangup
                                    ; a call in the case of a phone disappearing from the net,
                                    ; like a powerloss or grandma tripping over a cable.
    ;rtpholdtimeout=300             ; Terminate call if 300 seconds of no RTP or RTCP activity
                                    ; on the audio channel
                                    ; when we're on hold (must be > rtptimeout)
    ;rtpkeepalive=<secs>            ; Send keepalives in the RTP stream to keep NAT open
                                    ; (default is off - zero)
    ;--------------------------- SIP DEBUGGING ---------------------------------------------------
    ;sipdebug = yes                 ; Turn on SIP debugging by default, from
                                    ; the moment the channel loads this configuration
    ;recordhistory=yes              ; Record SIP history by default
                                    ; (see sip history / sip no history)
    ;dumphistory=yes                ; Dump SIP history at end of SIP dialogue
                                    ; SIP history is output to the DEBUG logging channel
    ;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
    ; You can subscribe to the status of extensions with a "hint" priority
    ; (See extensions.conf.sample for examples)
    ; chan_sip support two major formats for notifications: dialog-info and SIMPLE
    ;
    ; You will get more detailed reports (busy etc) if you have a call limit set
    ; for a device. When the call limit is filled, we will indicate busy. Note that
    ; you need at least 2 in order to be able to do attended transfers.
    ;
    ; For queues, you will need this level of detail in status reporting, regardless
    ; if you use SIP subscriptions. Queues and manager use the same internal interface
    ; for reading status information.
    ;
    ; Note: Subscriptions does not work if you have a realtime dialplan and use the
    ; realtime switch.
    ;
    ;allowsubscribe=no              ; Disable support for subscriptions. (Default is yes)
    ;subscribecontext = default     ; Set a specific context for SUBSCRIBE requests
                                    ; Useful to limit subscriptions to local extensions
                                    ; Settable per peer/user also
    ;notifyringing = yes            ; Notify subscriptions on RINGING state (default: no)
    ;notifyhold = yes               ; Notify subscriptions on HOLD state (default: no)
                                    ; Turning on notifyringing and notifyhold will add a lot
                                    ; more database transactions if you are using realtime.
    ;limitonpeers = yes             ; Apply call limits on peers only. This will improve
                                    ; status notification when you are using type=friend
                                    ; Inbound calls, that really apply to the user part
                                    ; of a friend will now be added to and compared with
                                    ; the peer limit instead of applying two call limits,
                                    ; one for the peer and one for the user.
                                    ; "sip show inuse" will only show active calls on
                                    ; the peer side of a "type=friend" object if this
                                    ; setting is turned on.
    ;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
    ;
    ; This setting is available in the [general] section as well as in device configurations.
    ; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
    ; both parties have T38 support enabled in their Asterisk configuration
    ; This has to be enabled in the general section for all devices to work. You can then
    ; disable it on a per device basis.
    ;
    ; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
    ;
    ; t38pt_udptl = yes            ; Default false
    ;
    ;----------------------------------------- OUTBOUND SIP REGISTRATIONS  ------------------------
    ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
    ; Format for the register statement is:
    ;       register => user[:secret[:authuser]]@host[:port][/extension]
    ;
    ; If no extension is given, the 's' extension is used. The extension needs to
    ; be defined in extensions.conf to be able to accept calls from this SIP proxy
    ; (provider).
    ;
    ; host is either a host name defined in DNS or the name of a section defined
    ; below.
    ;
    ; Examples:
    ;
    ;register => 1234:password@mysipprovider.com
    ;
    ;     This will pass incoming calls to the 's' extension
    ;
    ;
    ;register => 2345:password@sip_proxy/1234
    ;
    ;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider
    ;    connect to local extension 1234 in extensions.conf, default context,
    ;    unless you configure a [sip_proxy] section below, and configure a
    ;    context.
    ;    Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
    ;    Tip 2: Use separate type=peer and type=user sections for SIP providers
    ;           (instead of type=friend) if you have calls in both directions
    ;registertimeout=20             ; retry registration calls every 20 seconds (default)
    ;registerattempts=10            ; Number of registration attempts before we give up
                                    ; 0 = continue forever, hammering the other server
                                    ; until it accepts the registration
                                    ; Default is 0 tries, continue forever
    ;----------------------------------------- NAT SUPPORT ------------------------
    ; The externip, externhost and localnet settings are used if you use Asterisk
    ; behind a NAT device to communicate with services on the outside.
    ;externip = 200.201.202.203     ; Address that we're going to put in outbound SIP
                                    ; messages if we're behind a NAT
                                    ; The externip and localnet is used
                                    ; when registering and communicating with other proxies
                                    ; that we're registered with
    ;externhost=foo.dyndns.net      ; Alternatively you can specify an
                                    ; external host, and Asterisk will
                                    ; perform DNS queries periodically.  Not
                                    ; recommended for production
                                    ; environments!  Use externip instead
    ;externrefresh=10               ; How often to refresh externhost if
                                    ; used
                                    ; You may add multiple local networks.  A reasonable
                                    ; set of defaults are:
    ;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
    ;localnet=10.0.0.0/255.0.0.0    ; Also RFC1918
    ;localnet=172.16.0.0/12         ; Another RFC1918 with CIDR notation
    ;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
    ; The nat= setting is used when Asterisk is on a public IP, communicating with
    ; devices hidden behind a NAT device (broadband router).  If you have one-way
    ; audio problems, you usually have problems with your NAT configuration or your
    ; firewall's support of SIP+RTP ports.  You configure Asterisk choice of RTP
    ; ports for incoming audio in rtp.conf
    ;
    ;nat=no                         ; Global NAT settings  (Affects all peers and users)
                                    ; yes = Always ignore info and assume NAT
                                    ; no = Use NAT mode only according to RFC3581 (;rport)
                                    ; never = Never attempt NAT mode or RFC3581 support
                                    ; route = Assume NAT, don't send rport
                                    ; (work around more UNIDEN bugs)
    ;----------------------------------- MEDIA HANDLING --------------------------------
    ; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
    ; no reason for Asterisk to stay in the media path, the media will be redirected.
    ; This does not really work with in the case where Asterisk is outside and have
    ; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
    ;
    ;canreinvite=yes                ; Asterisk by default tries to redirect the
                                    ; RTP media stream (audio) to go directly from
                                    ; the caller to the callee.  Some devices do not
                                    ; support this (especially if one of them is behind a NAT).
                                    ; The default setting is YES. If you have all clients
                                    ; behind a NAT, or for some other reason wants Asterisk to
                                    ; stay in the audio path, you may want to turn this off.
                                    ; In Asterisk 1.4 this setting also affect direct RTP
                                    ; at call setup (a new feature in 1.4 - setting up the
                                    ; call directly between the endpoints instead of sending
                                    ; a re-INVITE).
    ;directrtpsetup=yes             ; Enable the new experimental direct RTP setup. This sets up
                                    ; the call directly with media peer-2-peer without re-invites.
                                    ; Will not work for video and cases where the callee sends
                                    ; RTP payloads and fmtp headers in the 200 OK that does not match the
                                    ; callers INVITE. This will also fail if canreinvite is enabled when
                                    ; the device is actually behind NAT.
    ;canreinvite=nonat              ; An additional option is to allow media path redirection
                                    ; (reinvite) but only when the peer where the media is being
                                    ; sent is known to not be behind a NAT (as the RTP core can
                                    ; determine it based on the apparent IP address the media
                                    ; arrives from).
    ;canreinvite=update             ; Yet a third option... use UPDATE for media path redirection,
                                    ; instead of INVITE. This can be combined with 'nonat', as
                                    ; 'canreinvite=update,nonat'. It implies 'yes'.
    ;----------------------------------------- REALTIME SUPPORT ------------------------
    ; For additional information on ARA, the Asterisk Realtime Architecture,
    ; please read realtime.txt and extconfig.txt in the /doc directory of the
    ; source code.
    ;
    ;rtcachefriends=yes             ; Cache realtime friends by adding them to the internal list
                                    ; just like friends added from the config file only on a
                                    ; as-needed basis? (yes|no)
    ;rtsavesysname=yes              ; Save systemname in realtime database at registration
                                    ; Default= no
    ;rtupdate=yes                   ; Send registry updates to database using realtime? (yes|no)
                                    ; If set to yes, when a SIP UA registers successfully, the ip address,
                                    ; the origination port, the registration period, and the username of
                                    ; the UA will be set to database via realtime.
                                    ; If not present, defaults to 'yes'.
    ;rtautoclear=yes                ; Auto-Expire friends created on the fly on the same schedule
                                    ; as if it had just registered? (yes|no|<seconds>)
                                    ; If set to yes, when the registration expires, the friend will
                                    ; vanish from the configuration until requested again. If set
                                    ; to an integer, friends expire within this number of seconds
                                    ; instead of the registration interval.
    ;ignoreregexpire=yes            ; Enabling this setting has two functions:
                                    ;
                                    ; For non-realtime peers, when their registration expires, the
                                    ; information will _not_ be removed from memory or the Asterisk database
                                    ; if you attempt to place a call to the peer, the existing information
                                    ; will be used in spite of it having expired
                                    ;
                                    ; For realtime peers, when the peer is retrieved from realtime storage,
                                    ; the registration information will be used regardless of whether
                                    ; it has expired or not; if it expires while the realtime peer
                                    ; is still in memory (due to caching or other reasons), the
                                    ; information will not be removed from realtime storage
    ;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
    ; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
    ; domains, each of which can direct the call to a specific context if desired.
    ; By default, all domains are accepted and sent to the default context or the
    ; context associated with the user/peer placing the call.
    ; Domains can be specified using:
    ; domain=<domain>[,<context>]
    ; Examples:
    ; domain=myasterisk.dom
    ; domain=customer.com,customer-context
    ;
    ; In addition, all the 'default' domains associated with a server should be
    ; added if incoming request filtering is desired.
    ; autodomain=yes
    ;
    ; To disallow requests for domains not serviced by this server:
    ; allowexternaldomains=no
    ;domain=mydomain.tld,mydomain-incoming
                                    ; Add domain and configure incoming context
                                    ; for external calls to this domain
    ;domain=1.2.3.4                 ; Add IP address as local domain
                                    ; You can have several "domain" settings
    ;allowexternaldomains=no        ; Disable INVITE and REFER to non-local domains
                                    ; Default is yes
    ;autodomain=yes                 ; Turn this on to have Asterisk add local host
                                    ; name and local IP to domain list.
    ; fromdomain=mydomain.tld       ; When making outbound SIP INVITEs to
                                    ; non-peers, use your primary domain "identity"
                                    ; for From: headers instead of just your IP
                                    ; address. This is to be polite and
                                    ; it may be a mandatory requirement for some
                                    ; destinations which do not have a prior
                                    ; account relationship with your server.
    ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
    ; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
                                  ; SIP channel. Defaults to "no". An enabled jitterbuffer will
                                  ; be used only if the sending side can create and the receiving
                                  ; side can not accept jitter. The SIP channel can accept jitter,
                                  ; thus a jitterbuffer on the receive SIP side will be used only
                                  ; if it is forced and enabled.
    ; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a SIP
                                  ; channel. Defaults to "no".
    ; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
    ; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
                                  ; resynchronized. Useful to improve the quality of the voice, with
                                  ; big jumps in/broken timestamps, usually sent from exotic devices
                                  ; and programs. Defaults to 1000.
    ; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
                                  ; channel. Two implementations are currently available - "fixed"
                                  ; (with size always equals to jbmaxsize) and "adaptive" (with
                                  ; variable size, actually the new jb of IAX2). Defaults to fixed.
    ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
    ;-----------------------------------------------------------------------------------
    [authentication]
    ; Global credentials for outbound calls, i.e. when a proxy challenges your
    ; Asterisk server for authentication. These credentials override
    ; any credentials in peer/register definition if realm is matched.
    ;
    ; This way, Asterisk can authenticate for outbound calls to other
    ; realms. We match realm on the proxy challenge and pick an set of
    ; credentials from this list
    ; Syntax:
    ;       auth = <user>:<secret>@<realm>
    ;       auth = <user>#<md5secret>@<realm>
    ; Example:
    ;auth=mark:topsecret@digium.com
    ;
    ; You may also add auth= statements to [peer] definitions
    ; Peer auth= override all other authentication settings if we match on realm
    ;------------------------------------------------------------------------------
    ; Users and peers have different settings available. Friends have all settings,
    ; since a friend is both a peer and a user
    ;
    ; User config options:        Peer configuration:
    ; --------------------        -------------------
    ; context                     context
    ; callingpres                 callingpres
    ; permit                      permit
    ; deny                        deny
    ; secret                      secret
    ; md5secret                   md5secret
    ; dtmfmode                    dtmfmode
    ; canreinvite                 canreinvite
    ; nat                         nat
    ; callgroup                   callgroup
    ; pickupgroup                 pickupgroup
    ; language                    language
    ; allow                       allow
    ; disallow                    disallow
    ; insecure                    insecure
    ; trustrpid                   trustrpid
    ; progressinband              progressinband
    ; promiscredir                promiscredir
    ; useclientcode               useclientcode
    ; accountcode                 accountcode
    ; setvar                      setvar
    ; callerid                    callerid
    ; amaflags                    amaflags
    ; call-limit                  call-limit
    ; allowoverlap                allowoverlap
    ; allowsubscribe              allowsubscribe
    ; allowtransfer               allowtransfer
    ; subscribecontext            subscribecontext
    ; videosupport                videosupport
    ; maxcallbitrate              maxcallbitrate
    ; rfc2833compensate           mailbox
    ; t38pt_usertpsource          username
    ;                             template
    ;                             fromdomain
    ;                             regexten
    ;                             fromuser
    ;                             host
    ;                             port
    ;                             qualify
    ;                             defaultip
    ;                             rtptimeout
    ;                             rtpholdtimeout
    ;                             sendrpid
    ;                             outboundproxy
    ;                             rfc2833compensate
    ;                             t38pt_usertpsource
    ;[sip_proxy]
    ; For incoming calls only. Example: FWD (Free World Dialup)
    ; We match on IP address of the proxy for incoming calls
    ; since we can not match on username (caller id)
    ;type=peer
    ;context=from-fwd
    ;host=fwd.pulver.com
    ;[sip_proxy-out]
    ;type=peer                              ; we only want to call out, not be called
    ;secret=guessit
    ;username=yourusername                  ; Authentication user for outbound proxies
    ;fromuser=yourusername                  ; Many SIP providers require this!
    ;fromdomain=provider.sip.domain
    ;host=box.provider.com
    ;usereqphone=yes                        ; This provider requires ";user=phone" on URI
    ;call-limit=5                           ; permit only 5 simultaneous outgoing calls to this peer
    ;outboundproxy=proxy.provider.domain    ; send outbound signaling to this proxy, not directly to the peer
                                            ; Call-limits will not be enforced on real-time peers,
                                            ; since they are not stored in-memory
    ;port=80                                ; The port number we want to connect to on the remote side
                                            ; Also used as "defaultport" in combination with "defaultip" settings
    ;------------------------------------------------------------------------------
    ; Definitions of locally connected SIP devices
    ;
    ; type = user   a device that authenticates to us by "from" field to place calls
    ; type = peer   a device we place calls to or that calls us and we match by host
    ; type = friend two configurations (peer+user) in one
    ;
    ; For device names, we recommend using only a-z, numerics (0-9) and underscore
    ;
    ; For local phones, type=friend works most of the time
    ;
    ; If you have one-way audio, you probably have NAT problems.
    ; If Asterisk is on a public IP, and the phone is inside of a NAT device
    ; you will need to configure nat option for those phones.
    ; Also, turn on qualify=yes to keep the nat session open
    ;[grandstream1]
    ;type=friend
    ;context=from-sip               ; Where to start in the dialplan when this phone calls
    ;callerid=John Doe <1234>       ; Full caller ID, to override the phones config
                                    ; on incoming calls to Asterisk
    ;host=192.168.0.23              ; we have a static but private IP address
                                    ; No registration allowed
    ;nat=no                         ; there is not NAT between phone and Asterisk
    ;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk
    ;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
    ;call-limit=1                   ; permit only 1 outgoing call and 1 incoming call at a time
                                    ; from the phone to asterisk
                                    ; 1 for the explicit peer, 1 for the explicit user,
                                    ; remember that a friend equals 1 peer and 1 user in
                                    ; memory
                                    ; This will affect your subscriptions as well.
                                    ; There is no combined call counter for a "friend"
                                    ; so there's currently no way in sip.conf to limit
                                    ; to one inbound or outbound call per phone. Use
                                    ; the group counters in the dial plan for that.
                                    ;
    ;mailbox=1234@default           ; mailbox 1234 in voicemail context "default"
    ;disallow=all                   ; need to disallow=all before we can use allow=
    ;allow=ulaw                     ; Note: In user sections the order of codecs
                                    ; listed with allow= does NOT matter!
    ;allow=alaw
    ;allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
    ;allow=g729                     ; Pass-thru only unless g729 license obtained
    ;callingpres=allowed_passed_screen      ; Set caller ID presentation
                                    ; See doc/callingpres.txt for more information
    ;[xlite1]
    ; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
    ; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
    ;type=friend
    ;regexten=1234                  ; When they register, create extension 1234
    ;callerid="Jane Smith" <5678>
    ;host=dynamic                   ; This device needs to register
    ;nat=yes                        ; X-Lite is behind a NAT router
    ;canreinvite=no                 ; Typically set to NO if behind NAT
    ;disallow=all
    ;allow=gsm                      ; GSM consumes far less bandwidth than ulaw
    ;allow=ulaw
    ;allow=alaw
    ;mailbox=1234@default,1233@default      ; Subscribe to status of multiple mailboxes
    ;[snom]
    ;type=friend                    ; Friends place calls and receive calls
    ;context=from-sip               ; Context for incoming calls from this user
    ;secret=blah
    ;subscribecontext=localextensions       ; Only allow SUBSCRIBE for local extensions
    ;language=de                    ; Use German prompts for this user
    ;host=dynamic                   ; This peer register with us
    ;dtmfmode=inband                ; Choices are inband, rfc2833, or info
    ;defaultip=192.168.0.59         ; IP used until peer registers
    ;mailbox=1234@context,2345      ; Mailbox(-es) for message waiting indicator
    ;subscribemwi=yes               ; Only send notifications if this phone
                                    ; subscribes for mailbox notification
    ;vmexten=voicemail              ; dialplan extension to reach mailbox
                                    ; sets the Message-Account in the MWI notify message
                                    ; defaults to global vmexten which defaults to "asterisk"
    ;disallow=all
    ;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
    ;[polycom]
    ;type=friend                    ; Friends place calls and receive calls
    ;context=from-sip               ; Context for incoming calls from this user
    ;secret=blahpoly
    ;host=dynamic                   ; This peer register with us
    ;dtmfmode=rfc2833               ; Choices are inband, rfc2833, or info
    ;username=polly                 ; Username to use in INVITE until peer registers
                                    ; Normally you do NOT need to set this parameter
    ;disallow=all
    ;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
    ;progressinband=no              ; Polycom phones don't work properly with "never"
    ;[pingtel]
    ;type=friend
    ;secret=blah
    ;host=dynamic
    ;insecure=port                  ; Allow matching of peer by IP address without
                                    ; matching port number
    ;insecure=invite                ; Do not require authentication of incoming INVITEs
    ;insecure=port,invite           ; (both)
    ;qualify=1000                   ; Consider it down if it's 1 second to reply
                                    ; Helps with NAT session
                                    ; qualify=yes uses default value
    ;
    ; Call group and Pickup group should be in the range from 0 to 63
    ;
    ;callgroup=1,3-4                ; We are in caller groups 1,3,4
    ;pickupgroup=1,3-5              ; We can do call pick-p for call group 1,3,4,5
    ;defaultip=192.168.0.60         ; IP address to use if peer has not registered
    ;deny=0.0.0.0/0.0.0.0           ; ACL: Control access to this account based on IP address
    ;permit=192.168.0.60/255.255.255.0
    ;[cisco1]
    ;type=friend
    ;secret=blah
    ;qualify=200                    ; Qualify peer is no more than 200ms away
    ;nat=yes                        ; This phone may be natted
                                    ; Send SIP and RTP to the IP address that packet is
                                    ; received from instead of trusting SIP headers
    ;host=dynamic                   ; This device registers with us
    ;canreinvite=no                 ; Asterisk by default tries to redirect the
                                    ; RTP media stream (audio) to go directly from
                                    ; the caller to the callee.  Some devices do not
                                    ; support this (especially if one of them is
                                    ; behind a NAT).
    ;defaultip=192.168.0.4          ; IP address to use until registration
    ;username=goran                 ; Username to use when calling this device before registration
                                    ; Normally you do NOT need to set this parameter
    ;setvar=CUSTID=5678             ; Channel variable to be set for all calls from this device
    ;[pre14-asterisk]
    ;type=friend
    ;secret=digium
    ;host=dynamic
    ;rfc2833compensate=yes          ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
                                    ; You must have this turned on or DTMF reception will work improperly.
    ;t38pt_usertpsource=yes         ; Use the source IP address of RTP as the destination IP address for UDPTL packets
                                    ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the
                                    ; external IP address of the remote device. If port forwarding is done at the client side
                                    ; then UDPTL will flow to the remote device.
    

    Статистика

    Время первой команды журнала16:00:36 2010-10-25
    Время последней команды журнала11:42:02 2010-10-26
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, % 7.92
    Процент синтаксически неверно набранных команд, % 2.97
    Суммарное время работы с терминалом *, час 3.93
    Количество командных строк в единицу времени, команда/мин 0.43
    Частота использования команд
    screen25|========================| 24.04%
    vim16|===============| 15.38%
    cat8|=======| 7.69%
    asterisk6|=====| 5.77%
    ls6|=====| 5.77%
    less5|====| 4.81%
    ~5|====| 4.81%
    ssh5|====| 4.81%
    cd3|==| 2.88%
    echo3|==| 2.88%
    vi3|==| 2.88%
    dpkg1|| 0.96%
    {EXTEN})1|| 0.96%
    man1|| 0.96%
    /etc/init.d/asterisk1|| 0.96%
    #1|| 0.96%
    rm1|| 0.96%
    reboot1|| 0.96%
    271|| 0.96%
    locate1|| 0.96%
    231|| 0.96%
    131|| 0.96%
    scren1|| 0.96%
    sx1|| 0.96%
    "1|| 0.96%
    grep1|| 0.96%
    mv1|| 0.96%
    file1|| 0.96%
    which1|| 0.96%
    w1|| 0.96%
    ____
    *) Интервалы неактивности длительностью 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$