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

Содержание

Журнал

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

/dev/pts/0
13:27:39
#ls -lah
total 64K
drwxr-xr-x 4 andrey andrey 4.0K 2010-10-25 14:21 .
drwxr-xr-x 4 root   root   4.0K 2010-10-25 11:40 ..
-rw------- 1 andrey andrey  121 2010-10-25 13:04 .bash_history
-rw-r--r-- 1 andrey andrey  220 2010-10-25 11:40 .bash_logout
-rw-r--r-- 1 andrey root     10 2010-10-25 14:21 .bash_profile
-rw-r--r-- 1 andrey andrey 3.2K 2010-10-25 14:21 .bashrc
drwx------ 3 root   root   4.0K 2010-10-25 12:58 .dbus
-rw------- 1 root   root    179 2010-10-25 12:58 .ICEauthority
-rw-r--r-- 1 root   root   5.2K 2010-10-25 14:19 install
-rw-r--r-- 1 andrey root     58 2010-10-25 14:21 .l3rc
drwxr-xr-x 2 andrey root   4.0K 2010-10-25 14:21 .lilalo
-rw-r--r-- 1 andrey andrey  675 2010-10-25 11:40 .profile
-rw-r--r-- 1 root   root    503 2010-10-25 12:03 q
-rw------- 1 root   root     61 2010-10-25 12:58 .Xauthority
-rw------- 2 andrey andrey    0 2010-10-25 13:50 .Xauthority-c
-rw------- 2 andrey andrey    0 2010-10-25 13:50 .Xauthority-l
-rw------- 1 root   root    995 2010-10-25 12:58 .xsession-errors
13:28:04
#cat .l3rc
l3cd=/users/Andrey/nt-voip/linux12.unix.nt.unix.nt/andrey
13:28:37
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth0
default         192.168.15.254  0.0.0.0         UG    0      0        0 eth0
13:29:37
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth0
default         192.168.15.254  0.0.0.0         UG    0      0        0 eth0
13:31:04
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth0
default         192.168.15.254  0.0.0.0         UG    0      0        0 eth0
13:31:05
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth0
default         192.168.15.254  0.0.0.0         UG    0      0        0 eth0
13:31:06
#host 192.168.1522
Host 192.168.1522 not found: 3(NXDOMAIN)
13:31:25
#host 192.168.15.22
22.15.168.192.in-addr.arpa domain name pointer linux2.unix.nt.
22.15.168.192.in-addr.arpa domain name pointer esx2.unix.nt.
13:31:32
#host 192.168.15.254
254.15.168.192.in-addr.arpa domain name pointer gw.unix.nt.
13:32:31
#vi /etc/network/interfaces
прошло 10 минут
13:43:24
#~
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface loaddress 192.168.112.1
        netmask 255.255.255.0
        network 192.168.112.0
        broadcast 192.168.112.255
# The prgateway 192.168.15.254e
        # dns-* options are implemented by the resolvconf package, if installed
allow-hodns-nameservers 10.0.35.1
...
~
~
~
~
~
~
~
~
~
"/etc/network/interfaces" 18L, 519C written
13:44:21
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1b:fc:7d:bb:37
          inet addr:192.168.15.32  Bcast:192.168.15.255  Mask:255.255.255.0
          inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24222 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8716 errors:0 dropped:0 overruns:0 carrier:3
          collisions:0 txqueuelen:1000
          RX bytes:17939533 (17.1 MiB)  TX bytes:998400 (975.0 KiB)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:31 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1926 (1.8 KiB)  TX bytes:1926 (1.8 KiB)
13:53:33
#ls
install  q
прошло 13 минут
14:06:49
#pwd
/home/andrey
14:06:52
#ls -lah
.bash_history     .bash_profile     .dbus/            install           .lilalo/          q                 .Xauthority-c     .xsession-errors
.bash_logout      .bashrc           .ICEauthority     .l3rc             .profile          .Xauthority       .Xauthority-l
14:06:52
#find -name vim.rc /
find: paths must precede expression: /
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
14:12:09
#find / -name vim.rc

14:12:30
#locate vim
locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory
14:12:50
#whereis vim
vim: /usr/bin/vim /usr/bin/vim.tiny /usr/bin/vim.basic /etc/vim /usr/share/vim /usr/share/man/man1/vim.1.gz
/dev/pts/2
14:18:17
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1b:fc:7d:bb:37
          inet addr:192.168.15.32  Bcast:192.168.15.255  Mask:255.255.255.0
          inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26193 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9043 errors:0 dropped:0 overruns:0 carrier:7
          collisions:0 txqueuelen:1000
          RX bytes:18146041 (17.3 MiB)  TX bytes:1044127 (1019.6 KiB)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:31 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1926 (1.8 KiB)  TX bytes:1926 (1.8 KiB)
14:18:28
#cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 192.168.112.1
        netmask 255.255.255.0
        network 192.168.112.0
        broadcast 192.168.112.255
        gateway 192.168.15.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 10.0.35.1
        dns-search unix.nt
14:18:39
#/etc/init.d/networking stop
Deconfiguring network interfaces...done.
прошло 46 минут
/dev/pts/2
15:05:20
#apt-get install dhcp3-server
 │                                                                           │
 └───────────────────────────────────────────────────────────────────────────┘
Selecting previously deselected package dhcp3-server.
(Reading database ... 40094 files and directories currently installed.)
Unpacking dhcp3-server (from .../dhcp3-server_3.1.1-6+lenny4_i386.deb) ...
Processing triggers for man-db ...
Setting up dhcp3-server (3.1.1-6+lenny4) ...
Generating /etc/default/dhcp3-server...
Starting DHCP server: dhcpd3check syslog for diagnostics. failed!
 failed!
invoke-rc.d: initscript dhcp3-server, action "start" failed.
15:08:42
#vi /etc/dhcp3/dhcpd.conf
15:09:26
#: 8

15:15:12
#vi /etc/de
15:15:12
#vi /etc/def
15:15:12
#vi /etc/default/d
15:15:12
#vi /etc/default/dhcp3-server
--- /tmp/l3-saved-4675.1563.21928	2010-10-25 16:15:31.000000000 +0300
+++ /etc/default/dhcp3-server	2010-10-25 16:15:54.000000000 +0300
@@ -8,4 +8,4 @@
 
 # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
 #	Separate multiple interfaces with spaces, e.g. "eth0 eth1".
-INTERFACES=""
+INTERFACES="eth0"
15:15:54
#/etc/init.d/dhcp3-server start
Starting DHCP server: dhcpd3.
15:16:13
#ps awwx | grep dhcp
 4975 ?        Ss     0:00 /usr/sbin/dhcpd3 -q eth0
прошло 30 минут
/dev/pts/4
15:46:52
#tail /var/lib/dhcp3/dhcpd.leases
lease 192.168.112.11 {
  starts 1 2010/10/25 13:45:10;
  ends 1 2010/10/25 13:55:10;
  cltt 1 2010/10/25 13:45:10;
  binding state active;
  next binding state free;
  hardware ethernet 00:13:80:78:1c:a2;
  uid "\001\000\023\200x\034\242";
  client-hostname "SIP001380781CA2";
}
15:46:55
#apt-get install nmap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libpcap0.8
The following NEW packages will be installed:
  libpcap0.8 nmap
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1143kB of archives.
After this operation, 3936kB of additional disk space will be used.
...
Get:2 http://ftp.ua.debian.org lenny/main nmap 4.62-1 [1049kB]
Fetched 1143kB in 4s (265kB/s)
Selecting previously deselected package libpcap0.8.
(Reading database ... 40107 files and directories currently installed.)
Unpacking libpcap0.8 (from .../libpcap0.8_0.9.8-5_i386.deb) ...
Selecting previously deselected package nmap.
Unpacking nmap (from .../archives/nmap_4.62-1_i386.deb) ...
Processing triggers for man-db ...
Setting up libpcap0.8 (0.9.8-5) ...
Setting up nmap (4.62-1) ...
15:50:39
#nmap 192.168.112.11
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 16:50 EEST
All 1715 scanned ports on 192.168.112.11 are filtered
MAC Address: 00:13:80:78:1C:A2 (Cisco Systems)
Nmap done: 1 IP address (1 host up) scanned in 36.879 seconds
15:51:30
#apt-get install asterisk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  asterisk-config asterisk-sounds-main ca-certificates debhelper gettext
  html2text intltool-debian libc-client2007b libcompress-raw-zlib-perl
  libcompress-zlib-perl libcurl3 libdigest-hmac-perl libdigest-sha1-perl
  libfile-remove-perl libgsm1 libiksemel3 libio-compress-base-perl
  libio-compress-zlib-perl libio-stringy-perl libltdl3 libmail-box-perl
  libmail-sendmail-perl libmailtools-perl libmime-types-perl
...
Setting up libio-stringy-perl (2.110-4) ...
Setting up libmime-types-perl (1.24-1) ...
Setting up libmailtools-perl (2.03-1) ...
Setting up libobject-realize-later-perl (0.18-1) ...
Setting up libuser-identity-perl (0.92-2) ...
Setting up libmail-box-perl (2.082-2) ...
Setting up libsys-hostname-long-perl (1.4-2) ...
Setting up libmail-sendmail-perl (0.79-5) ...
Setting up module-assistant (0.10.11.0) ...
Setting up vpb-driver-source (4.2.38.1-1) ...
15:53:29
#asterisk-sounds-extra asterisk-config
bash: asterisk-sounds-extra: command not found
15:53:50
#apt-get install asterisk-sounds-extra asterisk-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
asterisk-config is already the newest version.
asterisk-config set to manually installed.
The following NEW packages will be installed:
  asterisk-sounds-extra
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 3224kB of archives.
After this operation, 6291kB of additional disk space will be used.
Get:1 http://ftp.ua.debian.org lenny/main asterisk-sounds-extra 1.4.7-1 [3224kB]
Fetched 3224kB in 10s (317kB/s)
Selecting previously deselected package asterisk-sounds-extra.
(Reading database ... 43359 files and directories currently installed.)
Unpacking asterisk-sounds-extra (from .../asterisk-sounds-extra_1.4.7-1_all.deb) ...
Setting up asterisk-sounds-extra (1.4.7-1) ...
15:54:15
#netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:5038          0.0.0.0:*               LISTEN      9425/asterisk
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1990/portmap
tcp        0      0 0.0.0.0:2000            0.0.0.0:*               LISTEN      9425/asterisk
tcp        0      0 0.0.0.0:58578           0.0.0.0:*               LISTEN      2005/rpc.statd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      4554/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2511/exim4
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      2683/0
tcp6       0      0 :::22                   :::*                    LISTEN      4554/sshd
tcp6       0      0 ::1:6010                :::*                    LISTEN      2683/0
15:54:48
#dpkg -L asterisk
/.
/etc
/etc/asterisk
/etc/logrotate.d
/etc/logrotate.d/asterisk
/etc/default
/etc/default/asterisk
/etc/init.d
/etc/init.d/asterisk
/usr
...
/var/lib/asterisk
/var/lib/asterisk/moh
/var/lib/asterisk/sounds
/var/lib/asterisk/sounds/custom
/var/run
/var/run/asterisk
/usr/share/asterisk/sounds/recordings
/usr/share/asterisk/sounds/custom
/usr/share/man/man8/rasterisk.8.gz
/usr/sbin/rasterisk
16:00:35
#/etc/init.d/asterisk status
Asterisk PBX is running: 9425
16:00:50
#asterisk -rvv
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/asterisk.conf': Found
  == Parsing '/etc/asterisk/extconfig.conf': Found
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 9425)
Verbosity was 0 and is now 2
linux12*CLI> sip show pee
peers  peer
linux12*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]
linux12*CLI> quit
Executing last minute cleanups
16:03:05
#less /etc/asterisk/m
16:03:05
#less /var/log/asterisk/messages
16:09:05
#vi /etc/asterisk/sip.conf
прошло 12 минут
16:21:50
#669 ; then UDPTL will flow to the remote device.
grep: /tmp/sip.conf: No such file or directory
16:21:53
#grep -v "^\s*;" /etc/asterisk/sip.conf | grep -vx '' | less
16:22:12
#mv /etc/asterisk/sip.conf{,.orig}

16:25:43
#grep -v "^\s*;" /etc/asterisk/sip.conf | grep -vx '' > /etc/asterisk/sip.conf

16:25:49
#ls /etc/asterisk/sip.conf
/etc/asterisk/sip.conf
16:26:07
#ls /etc/asterisk/sip.conf.orig
/etc/asterisk/sip.conf.orig
16:26:52
#~

16:27:17
#grep -v "^\s*;" /etc/asterisk/sip.conf.orig | grep -vx '' | less
16:29:35
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-5286.2471.9554	2010-10-25 17:29:45.000000000 +0300
+++ /etc/asterisk/sip.conf	2010-10-25 17:34:45.000000000 +0300
@@ -0,0 +1,14 @@
+[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:36:14
#nmap 192.168.111.201
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 17:36 EEST
Stats: 0:00:02 elapsed; 0 hosts completed (0 up), 0 undergoing Ping Scan
Ping Scan Timing: About 50.00% done; ETC: 17:36 (0:00:02 remaining)
16:36:36
#nmap 192.168.111.151
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 17:36 EEST
Interesting ports on 192.168.111.151:
Not shown: 1714 closed ports
PORT   STATE SERVICE
80/tcp open  http
Nmap done: 1 IP address (1 host up) scanned in 2.195 seconds
16:36:41
#nmap 192.168.112.11
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 17:36 EEST
All 1715 scanned ports on 192.168.112.11 are filtered
MAC Address: 00:13:80:78:1C:A2 (Cisco Systems)
Nmap done: 1 IP address (1 host up) scanned in 36.859 seconds
16:37:31
#tail /var/lib/dhcp3/dhcpd.leases
lease 192.168.112.11 {
  starts 1 2010/10/25 14:35:09;
  ends 1 2010/10/25 14:45:09;
  cltt 1 2010/10/25 14:35:09;
  binding state active;
  next binding state free;
  hardware ethernet 00:13:80:78:1c:a2;
  uid "\001\000\023\200x\034\242";
  client-hostname "SIP001380781CA2";
}
прошло 13 минут
/dev/pts/0
16:50:31
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1b:fc:7d:bb:37
          inet addr:192.168.112.1  Bcast:192.168.112.255  Mask:255.255.255.0
          inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:51123 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36699 errors:0 dropped:0 overruns:0 carrier:9
          collisions:0 txqueuelen:1000
          RX bytes:43441568 (41.4 MiB)  TX bytes:3338442 (3.1 MiB)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:470 errors:0 dropped:0 overruns:0 frame:0
          TX packets:470 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:40833 (39.8 KiB)  TX bytes:40833 (39.8 KiB)
16:51:09
#asterisk -rcv
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
=========================================================================
...
linux12*CLI> sip show peer
peers  peer
linux12*CLI> sip show peer
peers  peer
linux12*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]
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
16:56:13
#vi /etc/asterisk/extensions.conf
16:56:55
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-10112.10003.5433	2010-10-25 17:57:03.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-25 17:57:47.000000000 +0300
@@ -549,6 +549,10 @@
 ;exten => 2,1,Goto(default,mark,2)
 
 [default]
+exten =>1899,1,Answer
+exten =>1899,n,Wait(1)
+exten =>1899,n,Playback(demo-thanks)
+exten =>1899,n,Hangup
 ;
 ; By default we include the demo.  In a production system, you 
 ; probably don't want to have the demo there.
16:57:47
#vi /etc/asterisk/extensions.conf
17:01:39
#man scp
17:02:07
#scp root@192.168.108.1:/etc/asterisk/sip.conf.orig .
The authenticity of host '192.168.108.1 (192.168.108.1)' can't be established.
RSA key fingerprint is da:4a:92:81:55:fc:a8:1b:fd:c8:e4:7a:2e:68:f0:fa.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.108.1' (RSA) to the list of known hosts.
root@192.168.108.1's password:
sip.conf.orig                                 100%   31KB  31.1KB/s   00:00
17:04:31
#cat 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:04:43
#cat /etc/asterisk/sip.conf.orig

17:04:59
#rm /etc/asterisk/sip.conf.orig

17:05:05
#cp sip.conf.orig /etc/asterisk/

17:05:44
#less /etc/asterisk/sip.conf.orig
17:05:59
#asterisk -rcx "sip show peers"
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
=========================================================================
[ Booting...
[ Reading Master Configuration ]
[ Initializing Custom Configuration Options ]
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 9425)
Name/username              Host            Dyn Nat ACL Port     Status
1801/1801                  192.168.112.2    D          5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]

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

/dev/pts/0
08:39:42
#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
08:39:51
#less /etc/asterisk/extensions.conf
/dev/pts/0
08:46:07
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-3040.9189.3119	2010-10-26 09:46:13.000000000 +0300
+++ /etc/asterisk/sip.conf	2010-10-26 09:46:52.000000000 +0300
@@ -8,7 +8,12 @@
 
 [authentication]
 
-[1801]
+[2201]
+type=friend
+secret=1234
+host=dynamic
+
+[2202]
 type=friend
 secret=1234
 host=dynamic
08:46:52
#asterisk -rcv
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
=========================================================================
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552)
Verbosity was 0 and is now 1
linux12*CLI> sip reload
 Reloading SIP
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
08:47:08
#vi /etc/asterisk/sip.conf
08:50:16
#vi /etc/asterisk/ext
--- /tmp/l3-saved-3040.13874.18550	2010-10-26 09:50:35.000000000 +0300
+++ /etc/asterisk/extensions.conf	2010-10-26 09:53:13.000000000 +0300
@@ -549,10 +549,13 @@
 ;exten => 2,1,Goto(default,mark,2)
 
 [default]
-exten =>1899,1,Answer
-exten =>1899,n,Wait(1)
-exten =>1899,n,Playback(demo-thanks)
-exten =>1899,n,Hangup
+exten =>2299,1,Answer
+exten =>2299,n,Wait(1)
+exten =>2299,n,Playback(demo-thanks)
+exten =>2299,n,Hangup
+
+exten =>2201,1,Dial(SIP/2201)
+exten =>2202,2,DIal(SIP/2202)
 ;
 ; By default we include the demo.  In a production system, you 
 ; probably don't want to have the demo there.
08:50:16
#vi /etc/asterisk/extensions.conf
08:53:13
#asterisk -rcv
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
=========================================================================
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552)
Verbosity is at least 1
linux12*CLI> extensions reload
Dialplan reloaded.
The 'extensions reload' command is deprecated and will be removed in a future release. Please use 'dialplan reload' instead.
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
08:54:03
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1b:fc:7d:bb:37
          inet addr:192.168.112.1  Bcast:192.168.112.255  Mask:255.255.255.0
          inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2374 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1445 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:231331 (225.9 KiB)  TX bytes:254639 (248.6 KiB)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:11 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1106 (1.0 KiB)  TX bytes:1106 (1.0 KiB)
/dev/pts/0
08:55:20
#cat /etc/asterisk/extensions.conf
; extensions.conf - the Asterisk dial plan
;
; Static extension configuration file, used by
; the pbx_config module. This is where you configure all your
; inbound and outbound calls in Asterisk.
;
; This configuration file is reloaded
; - With the "dialplan reload" command in the CLI
; - With the "reload" command (that reloads everything) in the CLI
;
...
;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
;
; For more information on applications, just type "core show applications" at your
; friendly Asterisk CLI prompt.
;
; "core show application <command>" will show details of how you
; use that particular application in this file, the dial plan.
; "core show functions" will list all dialplan functions
; "core show function <COMMAND>" will show you more information about
; one function. Remember that function names are UPPER CASE.
/dev/pts/2
09:03:35
#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]
[2201]
type=friend
secret=1234
host=dynamic
[2202]
type=friend
secret=1234
host=dynamic
/dev/pts/0
09:12:41
#asterisk -rcv
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
=========================================================================
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552)
Verbosity is at least 1
linux12*CLI> extensions reload
Dialplan reloaded.
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
09:13:39
#ls /tmp/warning1.gsm
/tmp/warning1.gsm
09:14:09
#ls -lah /tmp/warning1.gsm
-rw-r----- 1 asterisk asterisk 0 2010-10-26 10:13 /tmp/warning1.gsm
09:14:14
#less /etc/asterisk/extensions.conf
09:20:35
#asterisk -rcvvv
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/asterisk.conf': Found
  == Parsing '/etc/asterisk/extconfig.conf': Found
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552)
Verbosity was 1 and is now 3
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
09:23:04
#apt-get install sox
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libsamplerate0 libsox-fmt-alsa libsox-fmt-base libsox0
Suggested packages:
  libsox-fmt-all
The following NEW packages will be installed:
  libsamplerate0 libsox-fmt-alsa libsox-fmt-base libsox0 sox
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
...
Selecting previously deselected package libsox-fmt-base.
Unpacking libsox-fmt-base (from .../libsox-fmt-base_14.0.1-2+b1_i386.deb) ...
Selecting previously deselected package sox.
Unpacking sox (from .../sox_14.0.1-2+b1_i386.deb) ...
Processing triggers for man-db ...
Setting up libsamplerate0 (0.1.4-1) ...
Setting up libsox0 (14.0.1-2+b1) ...
Setting up libsox-fmt-alsa (14.0.1-2+b1) ...
Setting up libsox-fmt-base (14.0.1-2+b1) ...
Setting up sox (14.0.1-2+b1) ...
09:23:21
#man sox
09:23:36
#sox /tmp/
.ICE-unix/                l3-saved-2758.1533.12585  l3-saved-2913.28927.9583  lost+found/               warning1.gsm              .X11-unix/
09:23:36
#sox /tmp/warning1.gsm
sox: SoX v14.0.1
Failed: Not enough input filenames specified
Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopts]]...
SPECIAL FILENAMES:
-               stdin (infile) or stdout (outfile)
-n              use the null file handler; for use with e.g. synth & stat
GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect):
--buffer BYTES  set the buffer size (default 8192)
--combine concatenate  concatenate multiple input files (default for sox, rec)
--combine sequence  sequence multiple input files (default for play)
...
-N, --reverse-nibbles  nibble-order
-X, --reverse-bits  bit-order of data
-B/-L           force endianness to big/little
-s/-u/-U/-A/    sample encoding: signed/unsigned/u-law/A-law
  -a/-i/-g/-f   ADPCM/IMA ADPCM/GSM/floating point
-1/-2/-3/-4/-8  sample size in bytes
-v, --volume FACTOR  volume input file volume adjustment factor (real number)
SUPPORTED FILE FORMATS: 8svx aif aifc aiff aiffc al alsa au auto avr cdda cdr cvs cvsd dat dvms fssd hcom ima ircam la lpc lpc10 lu m3u maud nist nul null pls prc raw s1 s2 s3 s4 sb sf sl smp snd sndt sou sph sw txw u1 u2 u3 u4 ub ul uw vms voc vox wav wavpcm wve xa
SUPPORTED EFFECTS: allpass band bandpass bandreject bass chorus compand dcshift deemph dither earwax echo echos equalizer fade filter flanger highpass key ladspa lowpass mcompand mixer noiseprof noisered oops pad pan phaser polyphase rabbit repeat resample reverb reverse silence speed stat swap synth tempo treble tremolo trim vol
effopts: depends on effect
09:23:45
#vi /etc/asterisk/extensions.conf
09:26:49
#exten =>2298,1,Record(/tmp/warning1:gsm,,3)
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
=========================================================================
...
  == Spawn extension (default, 2299, 4) exited non-zero on 'SIP/2202-095b1160'
peers
Name/username              Host            Dyn Nat ACL Port     Status
2202/2202                  192.168.112.2    D          1193     Unmonitored
2201/2201                  192.168.112.2    D          5060     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
    -- Unregistered SIP '2201'
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
/dev/pts/0
09:29:08
#asterisk -rcv
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
=========================================================================
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552)
Verbosity is at least 3
linux12*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
2202/2202                  192.168.112.2    D          1193     Unmonitored
2201/2201                  (Unspecified)    D          0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
09:30:04
#asterisk -rcv
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
=========================================================================
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552)
Verbosity is at least 3
linux12*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
2202/2202                  192.168.112.2    D          1193     Unmonitored
2201/2201                  (Unspecified)    D          0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
linux12*CLI> quit
Executing last minute cleanups
Asterisk cleanly ending (0).
09:31:41
#ping 192.168.122.11
PING 192.168.122.11 (192.168.122.11) 56(84) bytes of data.
^C
--- 192.168.122.11 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 4999ms
09:31:57
#ping 192.168.112.11
PING 192.168.112.11 (192.168.112.11) 56(84) bytes of data.
64 bytes from 192.168.112.11: icmp_seq=1 ttl=64 time=10.4 ms
64 bytes from 192.168.112.11: icmp_seq=2 ttl=64 time=0.802 ms
64 bytes from 192.168.112.11: icmp_seq=3 ttl=64 time=0.906 ms
64 bytes from 192.168.112.11: icmp_seq=4 ttl=64 time=0.800 ms
64 bytes from 192.168.112.11: icmp_seq=5 ttl=64 time=0.790 ms
64 bytes from 192.168.112.11: icmp_seq=6 ttl=64 time=0.799 ms
64 bytes from 192.168.112.11: icmp_seq=7 ttl=64 time=0.824 ms
64 bytes from 192.168.112.11: icmp_seq=8 ttl=64 time=0.790 ms
64 bytes from 192.168.112.11: icmp_seq=9 ttl=64 time=0.797 ms
...
64 bytes from 192.168.112.11: icmp_seq=13 ttl=64 time=0.791 ms
64 bytes from 192.168.112.11: icmp_seq=14 ttl=64 time=0.798 ms
64 bytes from 192.168.112.11: icmp_seq=15 ttl=64 time=0.790 ms
64 bytes from 192.168.112.11: icmp_seq=16 ttl=64 time=0.825 ms
64 bytes from 192.168.112.11: icmp_seq=17 ttl=64 time=0.791 ms
64 bytes from 192.168.112.11: icmp_seq=18 ttl=64 time=0.791 ms
^C
--- 192.168.112.11 ping statistics ---
18 packets transmitted, 18 received, 0% packet loss, time 17006ms
rtt min/avg/max/mdev = 0.790/1.346/10.447/2.207 ms
09:32:24
#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]
[2201]
type=friend
secret=1234
host=dynamic
[2202]
type=friend
secret=1234
host=dynamic
09:36:25
#vim /etc/asterisk/sip.conf
09:36:33
#rm /etc/asterisk/.sip.conf.sw
rm: cannot remove `/etc/asterisk/.sip.conf.sw': No such file or directory
09:36:54
#rm /etc/asterisk/.sip.conf.sw*

Файлы

  • .l3rc
  • /etc/asterisk/extensions.conf
  • /etc/asterisk/sip.conf
  • /etc/asterisk/sip.conf.orig
  • /etc/network/interfaces
  • sip.conf.orig
  • .l3rc
    >
    l3cd=/users/Andrey/nt-voip/linux12.unix.nt.unix.nt/andrey
    
    /etc/asterisk/extensions.conf
    >
    ; extensions.conf - the Asterisk dial plan
    ;
    ; Static extension configuration file, used by
    ; the pbx_config module. This is where you configure all your
    ; inbound and outbound calls in Asterisk.
    ;
    ; This configuration file is reloaded
    ; - With the "dialplan reload" command in the CLI
    ; - With the "reload" command (that reloads everything) in the CLI
    ;
    ; The "General" category is for certain variables.
    ;
    [general]
    ;
    ; If static is set to no, or omitted, then the pbx_config will rewrite
    ; this file when extensions are modified.  Remember that all comments
    ; made in the file will be lost when that happens.
    ;
    ; XXX Not yet implemented XXX
    ;
    static=yes
    ;
    ; if static=yes and writeprotect=no, you can save dialplan by
    ; CLI command "dialplan save" too
    ;
    writeprotect=no
    ;
    ; If autofallthrough is set, then if an extension runs out of
    ; things to do, it will terminate the call with BUSY, CONGESTION
    ; or HANGUP depending on Asterisk's best guess. This is the default.
    ;
    ; If autofallthrough is not set, then if an extension runs out of
    ; things to do, Asterisk will wait for a new extension to be dialed
    ; (this is the original behavior of Asterisk 1.0 and earlier).
    ;
    ;autofallthrough=no
    ;
    ; If clearglobalvars is set, global variables will be cleared
    ; and reparsed on an extensions reload, or Asterisk reload.
    ;
    ; If clearglobalvars is not set, then global variables will persist
    ; through reloads, and even if deleted from the extensions.conf or
    ; one of its included files, will remain set to the previous value.
    ;
    ; NOTE: A complication sets in, if you put your global variables into
    ; the AEL file, instead of the extensions.conf file. With clearglobalvars
    ; set, a "reload" will often leave the globals vars cleared, because it
    ; is not unusual to have extensions.conf (which will have no globals)
    ; load after the extensions.ael file (where the global vars are stored).
    ; So, with "reload" in this particular situation, first the AEL file will
    ; clear and then set all the global vars, then, later, when the extensions.conf
    ; file is loaded, the global vars are all cleared, and then not set, because
    ; they are not stored in the extensions.conf file.
    ;
    clearglobalvars=no
    ;
    ; If priorityjumping is set to 'yes', then applications that support
    ; 'jumping' to a different priority based on the result of their operations
    ; will do so (this is backwards compatible behavior with pre-1.2 releases
    ; of Asterisk). Individual applications can also be requested to do this
    ; by passing a 'j' option in their arguments.
    ;
    ;priorityjumping=yes
    ;
    ; User context is where entries from users.conf are registered.  The
    ; default value is 'default'
    ;
    ;userscontext=default
    ;
    ; You can include other config files, use the #include command
    ; (without the ';'). Note that this is different from the "include" command
    ; that includes contexts within other contexts. The #include command works
    ; in all asterisk configuration files.
    ;#include "filename.conf"
    ; The "Globals" category contains global variables that can be referenced
    ; in the dialplan with the GLOBAL dialplan function:
    ; ${GLOBAL(VARIABLE)}
    ; ${${GLOBAL(VARIABLE)}} or ${text${GLOBAL(VARIABLE)}} or any hybrid
    ; Unix/Linux environmental variables can be reached with the ENV dialplan
    ; function: ${ENV(VARIABLE)}
    ;
    [globals]
    CONSOLE=Console/dsp                             ; Console interface for demo
    ;CONSOLE=Zap/1
    ;CONSOLE=Phone/phone0
    IAXINFO=guest                                   ; IAXtel username/password
    ;IAXINFO=myuser:mypass
    TRUNK=Zap/G2                                    ; Trunk interface
    ;
    ; Note the 'G2' in the TRUNK variable above. It specifies which group (defined
    ; in zapata.conf) to dial, i.e. group 2, and how to choose a channel to use in
    ; the specified group. The four possible options are:
    ;
    ; g: select the lowest-numbered non-busy Zap channel
    ;    (aka. ascending sequential hunt group).
    ; G: select the highest-numbered non-busy Zap channel
    ;    (aka. descending sequential hunt group).
    ; r: use a round-robin search, starting at the next highest channel than last
    ;    time (aka. ascending rotary hunt group).
    ; R: use a round-robin search, starting at the next lowest channel than last
    ;    time (aka. descending rotary hunt group).
    ;
    TRUNKMSD=1                                      ; MSD digits to strip (usually 1 or 0)
    ;TRUNK=IAX2/user:pass@provider
    ;
    ; Any category other than "General" and "Globals" represent
    ; extension contexts, which are collections of extensions.
    ;
    ; Extension names may be numbers, letters, or combinations
    ; thereof. If an extension name is prefixed by a '_'
    ; character, it is interpreted as a pattern rather than a
    ; literal.  In patterns, some characters have special meanings:
    ;
    ;   X - any digit from 0-9
    ;   Z - any digit from 1-9
    ;   N - any digit from 2-9
    ;   [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
    ;   . - wildcard, matches anything remaining (e.g. _9011. matches
    ;       anything starting with 9011 excluding 9011 itself)
    ;   ! - wildcard, causes the matching process to complete as soon as
    ;       it can unambiguously determine that no other matches are possible
    ;
    ; For example the extension _NXXXXXX would match normal 7 digit dialings,
    ; while _1NXXNXXXXXX would represent an area code plus phone number
    ; preceded by a one.
    ;
    ; Each step of an extension is ordered by priority, which must
    ; always start with 1 to be considered a valid extension.  The priority
    ; "next" or "n" means the previous priority plus one, regardless of whether
    ; the previous priority was associated with the current extension or not.
    ; The priority "same" or "s" means the same as the previously specified
    ; priority, again regardless of whether the previous entry was for the
    ; same extension.  Priorities may be immediately followed by a plus sign
    ; and another integer to add that amount (most useful with 's' or 'n').
    ; Priorities may then also have an alias, or label, in
    ; parenthesis after their name which can be used in goto situations
    ;
    ; Contexts contain several lines, one for each step of each
    ; extension, which can take one of two forms as listed below,
    ; with the first form being preferred.
    ;
    ;[context]
    ;exten => someexten,{priority|label{+|-}offset}[(alias)],application(arg1,arg2,...)
    ;exten => someexten,{priority|label{+|-}offset}[(alias)],application,arg1|arg2...
    ;
    ; Included Contexts
    ;
    ; One may include another context in the current one as well, optionally with a
    ; date and time.  Included contexts are included in the order
    ; they are listed.
    ; The reason a context would include other contexts is for their
    ; extensions.
    ; The algorithm to find an extension is recursive, and works in this
    ; fashion:
    ;        first, given a stack on which to store context references,
    ;           push the context to find the extension onto the stack...
    ;    a) Try to find a matching extension in the context at the top of
    ;       the stack, and, if found, begin executing the priorities
    ;       there in sequence.
    ;    b) If not found, Search the switches, if any declared, in
    ;       sequence.
    ;    c) If still not found, for each include, push that context onto
    ;       the top of the context stack, and recurse to a).
    ;    d) If still not found, pop the entry from the top of the stack;
    ;       if the stack is empty, the search has failed. If it's not,
    ;       continue with the next context in c).
    ; This is a depth-first traversal, and stops with the first context
    ; that provides a matching extension. As usual, if more than one
    ; pattern in a context will match, the 'best' match will win.
    ; Please note that that extensions found in an included context are
    ; treated as if they were in the context from which the search began.
    ; The PBX's notion of the "current context" is not changed.
    ; Please note that in a context, it does not matter where an include
    ; directive occurs. Whether at the top, or near the bottom, the effect
    ; will be the same. The only thing that matters is that if there is
    ; more than one include directive, they will be searched for extensions
    ; in order, first to last.
    ; Also please note that pattern matches (like _9XX) are not treated
    ; any differently than exact matches (like 987). Also note that the
    ; order of extensions in a context have no affect on the outcome.
    ;
    ; Timing list for includes is
    ;
    ;   <time range>|<days of week>|<days of month>|<months>
    ;
    ; Note that ranges may be specified to wrap around the ends.  Also, minutes are
    ; fine-grained only down to the closest even minute.
    ;
    ;include => daytime|9:00-17:00|mon-fri|*|*
    ;include => weekend|*|sat-sun|*|*
    ;include => weeknights|17:02-8:58|mon-fri|*|*
    ;
    ; ignorepat can be used to instruct drivers to not cancel dialtone upon
    ; receipt of a particular pattern.  The most commonly used example is
    ; of course '9' like this:
    ;
    ;ignorepat => 9
    ;
    ; so that dialtone remains even after dialing a 9.
    ;
    ;
    ; Sample entries for extensions.conf
    ;
    ;
    [dundi-e164-canonical]
    ;
    ; List canonical entries here
    ;
    ;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo)
    ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
    [dundi-e164-customers]
    ;
    ; If you are an ITSP or Reseller, list your customers here.
    ;
    ;exten => _12564286000,1,Dial(SIP/customer1)
    ;exten => _12564286001,1,Dial(IAX2/customer2)
    [dundi-e164-via-pstn]
    ;
    ; If you are freely delivering calls to the PSTN, list them here
    ;
    ;exten => _1256428XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Expose all of 256-428
    ;exten => _1256325XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Ditto for 256-325
    [dundi-e164-local]
    ;
    ; Context to put your dundi IAX2 or SIP user in for
    ; full access
    ;
    include => dundi-e164-canonical
    include => dundi-e164-customers
    include => dundi-e164-via-pstn
    [dundi-e164-switch]
    ;
    ; Just a wrapper for the switch
    ;
    switch => DUNDi/e164
    [dundi-e164-lookup]
    ;
    ; Locally to lookup, try looking for a local E.164 solution
    ; then try DUNDi if we don't have one.
    ;
    include => dundi-e164-local
    include => dundi-e164-switch
    ;
    ; DUNDi can also be implemented as a Macro instead of using
    ; the Local channel driver.
    ;
    [macro-dundi-e164]
    ;
    ; ARG1 is the extension to Dial
    ;
    ; Extension "s" is not a wildcard extension that matches "anything".
    ; In macros, it is the start extension. In most other cases,
    ; you have to goto "s" to execute that extension.
    ;
    ; For wildcard matches, see above - all pattern matches start with
    ; an underscore.
    exten => s,1,Goto(${ARG1},1)
    include => dundi-e164-lookup
    ;
    ; Here are the entries you need to participate in the IAXTEL
    ; call routing system.  Most IAXTEL numbers begin with 1-700, but
    ; there are exceptions.  For more information, and to sign
    ; up, please go to www.gnophone.com or www.iaxtel.com
    ;
    [iaxtel700]
    exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)
    ;
    ; The SWITCH statement permits a server to share the dialplan with
    ; another server. Use with care: Reciprocal switch statements are not
    ; allowed (e.g. both A -> B and B -> A), and the switched server needs
    ; to be on-line or else dialing can be severly delayed.
    ;
    [iaxprovider]
    ;switch => IAX2/user:[key]@myserver/mycontext
    [trunkint]
    ;
    ; International long distance through trunk
    ;
    exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
    exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
    [trunkld]
    ;
    ; Long distance context accessed through trunk
    ;
    exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
    exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
    [trunklocal]
    ;
    ; Local seven-digit dialing accessed through trunk interface
    ;
    exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
    [trunktollfree]
    ;
    ; Long distance context accessed through trunk interface
    ;
    exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
    exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
    exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
    exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
    [international]
    ;
    ; Master context for international long distance
    ;
    ignorepat => 9
    include => longdistance
    include => trunkint
    [longdistance]
    ;
    ; Master context for long distance
    ;
    ignorepat => 9
    include => local
    include => trunkld
    [local]
    ;
    ; Master context for local, toll-free, and iaxtel calls only
    ;
    ignorepat => 9
    include => default
    include => trunklocal
    include => iaxtel700
    include => trunktollfree
    include => iaxprovider
    ;Include parkedcalls (or the context you define in features conf)
    ;to enable call parking.
    include => parkedcalls
    ;
    ; You can use an alternative switch type as well, to resolve
    ; extensions that are not known here, for example with remote
    ; IAX switching you transparently get access to the remote
    ; Asterisk PBX
    ;
    ; switch => IAX2/user:password@bigserver/local
    ;
    ; An "lswitch" is like a switch but is literal, in that
    ; variable substitution is not performed at load time
    ; but is passed to the switch directly (presumably to
    ; be substituted in the switch routine itself)
    ;
    ; lswitch => Loopback/12${EXTEN}@othercontext
    ;
    ; An "eswitch" is like a switch but the evaluation of
    ; variable substitution is performed at runtime before
    ; being passed to the switch routine.
    ;
    ; eswitch => IAX2/context@${CURSERVER}
    [macro-trunkdial]
    ;
    ; Standard trunk dial macro (hangs up on a dialstatus that should
    ; terminate call)
    ;   ${ARG1} - What to dial
    ;
    exten => s,1,Dial(${ARG1})
    exten => s,n,Goto(s-${DIALSTATUS},1)
    exten => s-NOANSWER,1,Hangup
    exten => s-BUSY,1,Hangup
    exten => _s-.,1,NoOp
    [macro-stdexten];
    ;
    ; Standard extension macro:
    ;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
    ;   ${ARG2} - Device(s) to ring
    ;
    exten => s,1,Dial(${ARG2},20)                   ; Ring the interface, 20 seconds maximum
    exten => s,2,Goto(s-${DIALSTATUS},1)            ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
    exten => s-NOANSWER,1,Voicemail(${ARG1},u)      ; If unavailable, send to voicemail w/ unavail announce
    exten => s-NOANSWER,2,Goto(default,s,1)         ; If they press #, return to start
    exten => s-BUSY,1,Voicemail(${ARG1},b)          ; If busy, send to voicemail w/ busy announce
    exten => s-BUSY,2,Goto(default,s,1)             ; If they press #, return to start
    exten => _s-.,1,Goto(s-NOANSWER,1)              ; Treat anything else as no answer
    exten => a,1,VoicemailMain(${ARG1})             ; If they press *, send the user into VoicemailMain
    [macro-stdPrivacyexten];
    ;
    ; Standard extension macro:
    ;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
    ;   ${ARG2} - Device(s) to ring
    ;   ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
    ;   ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)`
    ;
    exten => s,1,Dial(${ARG2},20|p)                 ; Ring the interface, 20 seconds maximum, call screening
                                                    ; option (or use P for databased call screening)
    exten => s,2,Goto(s-${DIALSTATUS},1)            ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
    exten => s-NOANSWER,1,Voicemail(${ARG1},u)      ; If unavailable, send to voicemail w/ unavail announce
    exten => s-NOANSWER,2,Goto(default,s,1)         ; If they press #, return to start
    exten => s-BUSY,1,Voicemail(${ARG1},b)          ; If busy, send to voicemail w/ busy announce
    exten => s-BUSY,2,Goto(default,s,1)             ; If they press #, return to start
    exten => s-DONTCALL,1,Goto(${ARG3},s,1)         ; Callee chose to send this call to a polite "Don't call again" script.
    exten => s-TORTURE,1,Goto(${ARG4},s,1)          ; Callee chose to send this call to a telemarketer torture script.
    exten => _s-.,1,Goto(s-NOANSWER,1)              ; Treat anything else as no answer
    exten => a,1,VoicemailMain(${ARG1})             ; If they press *, send the user into VoicemailMain
    [macro-page];
    ;
    ; Paging macro:
    ;
    ;       Check to see if SIP device is in use and DO NOT PAGE if they are
    ;
    ;   ${ARG1} - Device to page
    exten => s,1,ChanIsAvail(${ARG1}|js)                    ; j is for Jump and s is for ANY call
    exten => s,n,GoToIf([${AVAILSTATUS} = "1"]?autoanswer:fail)
    exten => s,n(autoanswer),Set(_ALERT_INFO="RA")                  ; This is for the PolyComs
    exten => s,n,SIPAddHeader(Call-Info: Answer-After=0)    ; This is for the Grandstream, Snoms, and Others
    exten => s,n,NoOp()                                     ; Add others here and Post on the Wiki!!!!
    exten => s,n,Dial(${ARG1}||)
    exten => s,n(fail),Hangup
    [demo]
    ;
    ; We start with what to do when a call first comes in.
    ;
    exten => s,1,Wait(1)                    ; Wait a second, just for fun
    exten => s,n,Answer                     ; Answer the line
    exten => s,n,Set(TIMEOUT(digit)=5)      ; Set Digit Timeout to 5 seconds
    exten => s,n,Set(TIMEOUT(response)=10)  ; Set Response Timeout to 10 seconds
    exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
    exten => s,n(instruct),BackGround(demo-instruct)        ; Play some instructions
    exten => s,n,WaitExten                  ; Wait for an extension to be dialed.
    exten => 2,1,BackGround(demo-moreinfo)  ; Give some more information.
    exten => 2,n,Goto(s,instruct)
    exten => 3,1,Set(LANGUAGE()=fr)         ; Set language to french
    exten => 3,n,Goto(s,restart)            ; Start with the congratulations
    exten => 1000,1,Goto(default,s,1)
    ;
    ; We also create an example user, 1234, who is on the console and has
    ; voicemail, etc.
    ;
    exten => 1234,1,Playback(transfer,skip)         ; "Please hold while..."
                                            ; (but skip if channel is not up)
    exten => 1234,n,Macro(stdexten,1234,${GLOBAL(CONSOLE)})
    exten => 1235,1,Voicemail(1234,u)               ; Right to voicemail
    exten => 1236,1,Dial(Console/dsp)               ; Ring forever
    exten => 1236,n,Voicemail(1234,b)               ; Unless busy
    ;
    ; # for when they're done with the demo
    ;
    exten => #,1,Playback(demo-thanks)      ; "Thanks for trying the demo"
    exten => #,n,Hangup                     ; Hang them up.
    ;
    ; A timeout and "invalid extension rule"
    ;
    exten => t,1,Goto(#,1)                  ; If they take too long, give up
    exten => i,1,Playback(invalid)          ; "That's not valid, try again"
    ;
    ; Create an extension, 500, for dialing the
    ; Asterisk demo.
    ;
    exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
    exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default)        ; Call the Asterisk demo
    exten => 500,n,Playback(demo-nogo)      ; Couldn't connect to the demo site
    exten => 500,n,Goto(s,6)                ; Return to the start over message.
    ;
    ; Create an extension, 600, for evaluating echo latency.
    ;
    exten => 600,1,Playback(demo-echotest)  ; Let them know what's going on
    exten => 600,n,Echo                     ; Do the echo test
    exten => 600,n,Playback(demo-echodone)  ; Let them know it's over
    exten => 600,n,Goto(s,6)                ; Start over
    ;
    ;       You can use the Macro Page to intercom a individual user
    exten => 76245,1,Macro(page,SIP/Grandstream1)
    ; or if your peernames are the same as extensions
    exten => _7XXX,1,Macro(page,SIP/${EXTEN})
    ;
    ;
    ; System Wide Page at extension 7999
    ;
    exten => 7999,1,Set(TIMEOUT(absolute)=60)
    exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n|d)
    ; Give voicemail at extension 8500
    ;
    exten => 8500,1,VoicemailMain
    exten => 8500,n,Goto(s,6)
    ;
    ; Here's what a phone entry would look like (IXJ for example)
    ;
    ;exten => 1265,1,Dial(Phone/phone0,15)
    ;exten => 1265,n,Goto(s,5)
    ;
    ;       The page context calls up the page macro that sets variables needed for auto-answer
    ;       It is in is own context to make calling it from the Page() application as simple as
    ;       Local/{peername}@page
    ;
    [page]
    exten => _X.,1,Macro(page,SIP/${EXTEN})
    ;[mainmenu]
    ;
    ; Example "main menu" context with submenu
    ;
    ;exten => s,1,Answer
    ;exten => s,n,Background(thanks)                ; "Thanks for calling press 1 for sales, 2 for support, ..."
    ;exten => s,n,WaitExten
    ;exten => 1,1,Goto(submenu,s,1)
    ;exten => 2,1,Hangup
    ;include => default
    ;
    ;[submenu]
    ;exten => s,1,Ringing                                   ; Make them comfortable with 2 seconds of ringback
    ;exten => s,n,Wait,2
    ;exten => s,n,Background(submenuopts)   ; "Thanks for calling the sales department.  Press 1 for steve, 2 for..."
    ;exten => s,n,WaitExten
    ;exten => 1,1,Goto(default,steve,1)
    ;exten => 2,1,Goto(default,mark,2)
    [default]
    exten =>2299,1,Answer
    exten =>2299,n,Wait(1)
    exten =>2299,n,Playback(demo-thanks)
    exten =>2299,n,Hangup
    exten =>2201,1,Dial(SIP/2201)
    exten =>2202,2,DIal(SIP/2202)
    ;
    ; By default we include the demo.  In a production system, you
    ; probably don't want to have the demo there.
    ;
    include => demo
    ;
    ; An extension like the one below can be used for FWD, Nikotel, sipgate etc.
    ; Note that you must have a [sipprovider] section in sip.conf
    ;
    ;exten => _41X.,1,Dial(SIP/${EXTEN:2}@sipprovider,,r)
    ; Real extensions would go here. Generally you want real extensions to be
    ; 4 or 5 digits long (although there is no such requirement) and start with a
    ; single digit that is fairly large (like 6 or 7) so that you have plenty of
    ; room to overlap extensions and menu options without conflict.  You can alias
    ; them with names, too, and use global variables
    ;exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1,Joe Schmoe ; Channel hints for presence
    ;exten => 6245,1,Dial(SIP/Grandstream1,20,rt)   ; permit transfer
    ;exten => 6245,n(dial),Dial(${HINT},20,rtT)     ; Use hint as listed
    ;exten => 6245,n,Voicemail(6245,u)              ; Voicemail (unavailable)
    ;exten => 6245,s+1,Hangup                       ; s+1, same as n
    ;exten => 6245,dial+101,Voicemail(6245,b)       ; Voicemail (busy)
    ;exten => 6361,1,Dial(IAX2/JaneDoe,,rm)         ; ring without time limit
    ;exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14)
    ;exten => 6390,1,Dial(JINGLE/caller/callee) ; Dial via jingle using labels
    ;exten => 6391,1,Dial(JINGLE/asterisk@digium.com/mogorman@astjab.org) ;Dial via jingle using asterisk as the transport and calling mogorman.
    ;exten => 6394,1,Dial(Local/6275/n)             ; this will dial ${MARK}
    ;exten => 6275,1,Macro(stdexten,6275,${MARK})   ; assuming ${MARK} is something like Zap/2
    ;exten => mark,1,Goto(6275|1)                   ; alias mark to 6275
    ;exten => 6536,1,Macro(stdexten,6236,${WIL})    ; Ditto for wil
    ;exten => wil,1,Goto(6236|1)
    ;If you want to subscribe to the status of a parking space, this is
    ;how you do it. Subscribe to extension 6600 in sip, and you will see
    ;the status of the first parking lot with this extensions' help
    ;exten => 6600,hint,park:701@parkedcalls
    ;exten => 6600,1,noop
    ;
    ; Some other handy things are an extension for checking voicemail via
    ; voicemailmain
    ;
    ;exten => 8500,1,VoicemailMain
    ;exten => 8500,n,Hangup
    ;
    ; Or a conference room (you'll need to edit meetme.conf to enable this room)
    ;
    ;exten => 8600,1,Meetme(1234)
    ;
    ; Or playing an announcement to the called party, as soon it answers
    ;
    ;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
    ;
    ; For more information on applications, just type "core show applications" at your
    ; friendly Asterisk CLI prompt.
    ;
    ; "core show application <command>" will show details of how you
    ; use that particular application in this file, the dial plan.
    ; "core show functions" will list all dialplan functions
    ; "core show function <COMMAND>" will show you more information about
    ; one function. Remember that function names are UPPER CASE.
    
    /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]
    [2201]
    type=friend
    secret=1234
    host=dynamic
    [2202]
    type=friend
    secret=1234
    host=dynamic
    
    /etc/asterisk/sip.conf.orig
    >
    /etc/network/interfaces
    >
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    # The loopback network interface
    auto lo
    iface lo inet loopback
    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet static
            address 192.168.112.1
            netmask 255.255.255.0
            network 192.168.112.0
            broadcast 192.168.112.255
            gateway 192.168.15.254
            # dns-* options are implemented by the resolvconf package, if installed
            dns-nameservers 10.0.35.1
            dns-search unix.nt
    
    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.
    

    Статистика

    Время первой команды журнала13:27:39 2010-10-25
    Время последней команды журнала09:36:54 2010-10-26
    Количество командных строк в журнале100
    Процент команд с ненулевым кодом завершения, % 7.00
    Процент синтаксически неверно набранных команд, % 1.00
    Суммарное время работы с терминалом *, час 3.30
    Количество командных строк в единицу времени, команда/мин 0.50
    Частота использования команд
    vi16|==============| 14.68%
    asterisk9|========| 8.26%
    cat8|=======| 7.34%
    ls7|======| 6.42%
    less7|======| 6.42%
    apt-get5|====| 4.59%
    ifconfig4|===| 3.67%
    nmap4|===| 3.67%
    route4|===| 3.67%
    grep4|===| 3.67%
    host3|==| 2.75%
    rm3|==| 2.75%
    "3|==| 2.75%
    man2|=| 1.83%
    ~2|=| 1.83%
    find2|=| 1.83%
    sox2|=| 1.83%
    ping2|=| 1.83%
    tail2|=| 1.83%
    dpkg1|| 0.92%
    then1|| 0.92%
    /etc/asterisk/sip.conf1|| 0.92%
    /etc/init.d/asterisk1|| 0.92%
    cp1|| 0.92%
    whereis1|| 0.92%
    warning1:gsm,,3)1|| 0.92%
    netstat1|| 0.92%
    mv1|| 0.92%
    6691|| 0.92%
    :1|| 0.92%
    /etc/init.d/networking1|| 0.92%
    ps1|| 0.92%
    pwd1|| 0.92%
    /etc/init.d/dhcp3-server1|| 0.92%
    asterisk-sounds-extra1|| 0.92%
    vim1|| 0.92%
    scp1|| 0.92%
    locate1|| 0.92%
    exten1|| 0.92%
    ____
    *) Интервалы неактивности длительностью 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$