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

Содержание

Журнал

Вторник (05/25/10)

/dev/pts/1
11:05:18
#vi /root/.bashrc
--- /tmp/l3-saved-4129.14755.5971	2010-05-25 12:05:50.000000000 +0300
+++ /root/.bashrc	2010-05-25 12:06:07.000000000 +0300
@@ -14,4 +14,4 @@
 # alias rm='rm -i'
 # alias cp='cp -i'
 # alias mv='mv -i'
-[ $0 == l3script ] && . /root/.lilalo/l3bashrc && _l3_start
+. /root/.lilalo/l3bashrc && _l3_start
11:06:07
#echo '. ~/.bashrc' >> /root/.bash_profile

11:07:55
#cat /root/.bash_profile
l3-agent
. ~/.bashrc
/dev/pts/0
11:09:11
#ls

11:10:09
#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.15.3
        netmask 255.255.255.0
        network 192.168.15.0
        broadcast 192.168.15.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
прошло 11 минут
11:21:48
#vi /etc/network/interfaces
11:25:22
#fg
# 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 loaddress 192.168.15.3
        netmask 255.255.255.0
        network 192.168.15.0
        broadcast 192.168.15.255
# The prgateway 192.168.15.254e
        # dns-* options are implemented by the resolvconf package, if installed
allow-hodns-nameservers 10.0.35.1
        dns-search unix.nt
iface eth0 inet static
11:25:42
#~
# 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 loaddress 192.168.3.3
        netmask 255.255.255.0
        network 192.168.3.0
        broadcast 192.168.3.255
# The prgateway 192.168.3.254ce
        # dns-* options are implemented by the resolvconf package, if installed
...
~
~
~
~
~
~
~
~
~
"/etc/network/interfaces" 18L, 512C written
11:25:52
#jobs

11:27:05
#jobs
[1]+  Stopped                 /usr/bin/vim "$@"
11:27:09
#fg
# 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 loaddress 192.168.3.3
        netmask 255.255.255.0
        network 192.168.3.0
        broadcast 192.168.3.255
# The prgateway 192.168.3.254ce
        # dns-* options are implemented by the resolvconf package, if installed
allow-hodns-nameservers 10.0.35.1
        dns-search unix.nt
iface eth0 inet static
11:27:14
#~
Reconfiguring network interfaces...SIOCDELRT: No such process
done.
11:32:28
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:04:a2:11:f3
          inet addr:192.168.15.3  Bcast:192.168.15.255  Mask:255.255.255.0
          inet6 addr: fe80::250:4ff:fea2:11f3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24151 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6278 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30757458 (29.3 MiB)  TX bytes:668124 (652.4 KiB)
          Interrupt:18 Base address:0xc000
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:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)
11:32:37
#/etc/init.d/networking restart
Reconfiguring network interfaces...done.
11:32:47
#ifconfig down eth0
^[[Aeth0: Host name lookup failure
ifconfig: `--help' gives usage information.
/dev/tty1
11:33:22
#ifconfig up eth0
eth0: Host name lookup failure
ifconfig: `--help' gives usage information.
11:33:40
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:04:a2:11:f3
          inet addr:192.168.15.3  Bcast:192.168.15.255  Mask:255.255.255.0
          inet6 addr: fe80::250:4ff:fea2:11f3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6352 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30762738 (29.3 MiB)  TX bytes:676942 (661.0 KiB)
          Interrupt:18 Base address:0xc000
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:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1496 (1.4 KiB)  TX bytes:1496 (1.4 KiB)
11:34:25
#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.3.3
        netmask 255.255.255.0
        network 192.168.3.0
        broadcast 192.168.3.255
        gateway 192.168.3.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 10.0.35.1
        dns-search unix.nt
11:34:39
#/etc/init.d/networking restart
Reconfiguring network interfaces...done.
11:35:03
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:04:a2:11:f3
          inet addr:192.168.15.3  Bcast:192.168.15.255  Mask:255.255.255.0
          inet6 addr: fe80::250:4ff:fea2:11f3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24215 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6383 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30763278 (29.3 MiB)  TX bytes:678802 (662.8 KiB)
          Interrupt:18 Base address:0xc000
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:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2424 (2.3 KiB)  TX bytes:2424 (2.3 KiB)
11:35:07
#if down eth0
> if up eth0
>
11:35:58
#ifdown eth0
ifdown: interface eth0 not configured
11:36:04
#ifup eth0

11:36:11
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:04:a2:11:f3
          inet addr:192.168.3.3  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::250:4ff:fea2:11f3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24218 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6409 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30763698 (29.3 MiB)  TX bytes:680383 (664.4 KiB)
          Interrupt:18 Base address:0xc000
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:38 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3096 (3.0 KiB)  TX bytes:3096 (3.0 KiB)
/dev/pts/2
11:37:47
#ping ya.ru
PING ya.ru (213.180.204.3) 56(84) bytes of data.
64 bytes from www.yandex.ru (213.180.204.3): icmp_seq=1 ttl=49 time=53.8 ms
64 bytes from www.yandex.ru (213.180.204.3): icmp_seq=2 ttl=49 time=55.0 ms
^C
--- ya.ru ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1003ms
rtt min/avg/max/mdev = 53.801/54.415/55.029/0.614 ms
11:37:57
#ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=63 time=0.193 ms
^C
--- 192.168.2.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.193/0.193/0.193/0.000 ms
11:38:42
#ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=63 time=0.134 ms
^C
--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.134/0.134/0.134/0.000 ms
11:38:45
#ping 192.168.5.1
PING 192.168.5.1 (192.168.5.1) 56(84) bytes of data.
64 bytes from 192.168.5.1: icmp_seq=1 ttl=63 time=0.148 ms
64 bytes from 192.168.5.1: icmp_seq=2 ttl=63 time=0.122 ms
^C
--- 192.168.5.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.122/0.135/0.148/0.013 ms
11:38:48
#ping 192.168.15.1
PING 192.168.15.1 (192.168.15.1) 56(84) bytes of data.
^C
--- 192.168.15.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
/dev/tty1
11:40:04
#ifdown eth0

11:40:12
#ifup eth0

11:40:34
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:04:a2:11:f3
          inet addr:192.168.3.1  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::250:4ff:fea2:11f3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24813 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6913 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30827172 (29.3 MiB)  TX bytes:741853 (724.4 KiB)
          Interrupt:18 Base address:0xc000
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:38 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3096 (3.0 KiB)  TX bytes:3096 (3.0 KiB)
/dev/pts/5
11:41:24
#apt-cache search dhcp server
avahi-autoipd - Avahi IPv4LL network address configuration daemon
bootp - server for the bootp protocol with DHCP support
dhcp-helper - A DHCP relay agent
dhcp3-dev - API for accessing and modifying the DHCP server and client state
dhcp3-relay - DHCP relay daemon
dhcp3-server-ldap - DHCP server able to use LDAP as backend
dhcp3-server - DHCP server for automatic IP address assignment
dhcpdump - Parse DHCP packets from tcpdump
dhcping - DHCP Daemon Ping Program
dhis-server - Dynamic Host Information System - server
...
libnm-util-dev - network management framework (development files)
libnm-util0 - network management framework (shared library)
network-manager - network management framework daemon
pump - BOOTP and DHCP client for automatic IP configuration
pxe - free PXE daemon
resolvconf - name server information handler
totd - Small DNS proxy that supports IPv6/IPv4 record translation
udhcpd - very small DHCP server
wide-dhcpv6-server - DHCPv6 server for automatic IPv6 hosts configuration
network-manager-gnome - network management framework (GNOME frontend)
11:44:38
#cat /etc/default//dhcp3-server
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts
#
# This is a POSIX shell fragment
#
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=""
11:45:38
#vim /etc/default//dhcp3-server
--- /tmp/l3-saved-5080.21349.10883	2010-05-25 12:45:49.000000000 +0300
+++ /etc/default//dhcp3-server	2010-05-25 12:46:04.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"
11:46:06
#vim /etc/dhcp3/dhcpd.conf
11:50:55
#vim /etc/dhcp3/dhcpd.conf
--- /tmp/l3-saved-5080.24515.4299	2010-05-25 12:50:56.000000000 +0300
+++ /etc/dhcp3/dhcpd.conf	2010-05-25 12:53:02.000000000 +0300
@@ -33,10 +33,10 @@
 
 # This is a very basic subnet declaration.
 
-#subnet 10.254.239.0 netmask 255.255.255.224 {
-#  range 10.254.239.10 10.254.239.20;
-#  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
-#}
+subnet 192.168.3.0 netmask 255.255.255.0 {
+  range 192.168.3.10 192.168.3.30;
+  option routers 192.168.3.254;
+}
 
 # This declaration allows BOOTP clients to get dynamic addresses,
 # which we don't really recommend.
11:53:02
#vim /etc/dhcp3/dhcpd.conf
11:54:08
#/etc/init.d/dhcp3-server status
Status of DHCP server: dhcpd3 is running.
11:54:12
#ps aux | grep dhcp
root      5388  0.0  0.1   3528  1552 ?        Ss   12:54   0:00 /usr/sbin/dhcpd3 -q eth0
root      5413  0.0  0.0   3116   728 pts/6    S+   12:54   0:00 grep dhcp
/dev/pts/7
11:56:03
#tail /var/lib/dhcp3/dhcpd.leases
lease 192.168.3.10 {
  starts 2 2010/05/25 09:55:30;
  ends 2 2010/05/25 10:05:30;
  cltt 2 2010/05/25 09:55:30;
  binding state active;
  next binding state free;
  hardware ethernet 00:1b:fc:7d:ba:d9;
  uid "\001\000\033\374}\272\331";
  client-hostname "UC-05";
}
11:57:09
#ps
  PID TTY          TIME CMD
 5470 pts/8    00:00:00 bash
 5537 pts/8    00:00:00 ps
11:58:00
#tail -f /var/lib/dhcp3/dhcpd.leases
lease 192.168.3.12 {
  starts 2 2010/05/25 11:20:32;
  ends 2 2010/05/25 11:30:32;
  cltt 2 2010/05/25 11:20:32;
  binding state active;
  next binding state free;
  hardware ethernet 00:23:69:7d:e6:c9;
  uid "\001\000#i}\346\311";
  client-hostname "voip0001";
}
...
  starts 2 2010/05/25 11:25:13;
  ends 2 2010/05/25 11:35:13;
  cltt 2 2010/05/25 11:25:13;
  binding state active;
  next binding state free;
  hardware ethernet 00:0e:08:d2:2e:07;
  uid "\001\000\016\010\322.\007";
  client-hostname "SipuraSPA";
}
^[[B^[[A^[^C
прошло 87 минут
13:25:25
#apt-get install asterisk asterisk-sound-extra
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package asterisk-sound-extra
13:26:48
#apt-get install asterisk asterisk-sounds-extra
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
  libasound2 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 libobject-realize-later-perl libogg0
  libperl5.10 libpq5 libpri1.0 libradiusclient-ng2 libsensors3 libsnmp-base libsnmp15 libspeex1
...
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 liburi-perl (1.35.dfsg.1-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) ...
13:27:40
#dpkg -l |grep -i aster
ii  asterisk                          1:1.4.21.2~dfsg-3+lenny1 Open Source Private Branch Exchange (PBX)
ii  asterisk-config                   1:1.4.21.2~dfsg-3+lenny1 Configuration files for Asterisk
ii  asterisk-sounds-extra             1.4.7-1                  Additional sound files for the Asterisk PBX
ii  asterisk-sounds-main              1:1.4.21.2~dfsg-3+lenny1 Core Sound files for Asterisk (English)
ii  base-passwd                       3.5.20                   Debian base system master password and group files
13:28:02
#dpkg -l |grep -i aster
ii  asterisk                          1:1.4.21.2~dfsg-3+lenny1 Open Source Private Branch Exchange (PBX)
ii  asterisk-config                   1:1.4.21.2~dfsg-3+lenny1 Configuration files for Asterisk
ii  asterisk-sounds-extra             1.4.7-1                  Additional sound files for the Asterisk PBX
ii  asterisk-sounds-main              1:1.4.21.2~dfsg-3+lenny1 Core Sound files for Asterisk (English)
ii  base-passwd                       3.5.20                   Debian base system master password and group files
13:28:06
#ls /etc/asterisk/
adsi.conf           cdr_odbc.conf    features.conf     logger.conf       phone.conf       skinny.conf
adtranvofr.conf     cdr_pgsql.conf   festival.conf     manager.conf      privacy.conf     sla.conf
agents.conf         cdr_tds.conf     followme.conf     manager.d         queues.conf      smdi.conf
alarmreceiver.conf  codecs.conf      func_odbc.conf    meetme.conf       res_odbc.conf    telcordia-1.adsi
alsa.conf           dnsmgr.conf      gtalk.conf        mgcp.conf         res_pgsql.conf   udptl.conf
amd.conf            dundi.conf       h323.conf         misdn.conf        res_snmp.conf    users.conf
asterisk.adsi       enum.conf        http.conf         modules.conf      rpt.conf         voicemail.conf
asterisk.conf       esel.conf        iax.conf          musiconhold.conf  rtp.conf         vpb.conf
cdr.conf            extconfig.conf   iaxprov.conf      muted.conf        say.conf         watchdog.conf
cdr_custom.conf     extensions.ael   indications.conf  osp.conf          sip.conf         zapata.conf
cdr_manager.conf    extensions.conf  jabber.conf       oss.conf          sip_notify.conf
13:28:24
#dpjg -L: asterisk | less
13:29:01
#dpkg -L: asterisk | less
13:29:29
#less /etc/logrotate.d/asterisk
13:31:01
#dpkg -S /etc/asterisk/sip.conf
asterisk-config: /etc/asterisk/sip.conf
13:32:47
#ls -l /etc/asterisk/extensions.conf
-rw-r----- 1 asterisk asterisk 22516 2009-12-14 21:08 /etc/asterisk/extensions.conf
13:33:48
#ls -l /etc/asterisk/sip.conf
-rw-r----- 1 asterisk asterisk 31889 2009-12-14 21:08 /etc/asterisk/sip.conf
прошло 54 минуты
14:28:46
#cd /etc/asterisk/

прошла 21 минута
14:50:18
#ls s
ls: cannot access s: No such file or directory
14:50:21
#dir
adsi.conf           cdr_odbc.conf    features.conf     logger.conf       phone.conf       skinny.conf
adtranvofr.conf     cdr_pgsql.conf   festival.conf     manager.conf      privacy.conf     sla.conf
agents.conf         cdr_tds.conf     followme.conf     manager.d         queues.conf      smdi.conf
alarmreceiver.conf  codecs.conf      func_odbc.conf    meetme.conf       res_odbc.conf    telcordia-1.adsi
alsa.conf           dnsmgr.conf      gtalk.conf        mgcp.conf         res_pgsql.conf   udptl.conf
amd.conf            dundi.conf       h323.conf         misdn.conf        res_snmp.conf    users.conf
asterisk.adsi       enum.conf        http.conf         modules.conf      rpt.conf         voicemail.conf
asterisk.conf       esel.conf        iax.conf          musiconhold.conf  rtp.conf         vpb.conf
cdr.conf            extconfig.conf   iaxprov.conf      muted.conf        say.conf         watchdog.conf
cdr_custom.conf     extensions.ael   indications.conf  osp.conf          sip.conf         zapata.conf
cdr_manager.conf    extensions.conf  jabber.conf       oss.conf          sip_notify.conf
14:50:43
#ls
adsi.conf           cdr_odbc.conf    features.conf     logger.conf       phone.conf       skinny.conf
adtranvofr.conf     cdr_pgsql.conf   festival.conf     manager.conf      privacy.conf     sla.conf
agents.conf         cdr_tds.conf     followme.conf     manager.d         queues.conf      smdi.conf
alarmreceiver.conf  codecs.conf      func_odbc.conf    meetme.conf       res_odbc.conf    telcordia-1.adsi
alsa.conf           dnsmgr.conf      gtalk.conf        mgcp.conf         res_pgsql.conf   udptl.conf
amd.conf            dundi.conf       h323.conf         misdn.conf        res_snmp.conf    users.conf
asterisk.adsi       enum.conf        http.conf         modules.conf      rpt.conf         voicemail.conf
asterisk.conf       esel.conf        iax.conf          musiconhold.conf  rtp.conf         vpb.conf
cdr.conf            extconfig.conf   iaxprov.conf      muted.conf        say.conf         watchdog.conf
cdr_custom.conf     extensions.ael   indications.conf  osp.conf          sip.conf         zapata.conf
cdr_manager.conf    extensions.conf  jabber.conf       oss.conf          sip_notify.conf
14:50:48
#ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.
Mandatory arguments to long options are mandatory for short options too.
  -a, --all                  do not ignore entries starting with .
  -A, --almost-all           do not list implied . and ..
      --author               with -l, print the author of each file
  -b, --escape               print octal escapes for nongraphic characters
      --block-size=SIZE      use SIZE-byte blocks
  -B, --ignore-backups       do not list implied entries ending with ~
...
SIZE may be (or may be an integer optionally followed by) one of following:
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
By default, color is not used to distinguish types of files.  That is
equivalent to using --color=none.  Using the --color option without the
optional WHEN argument is equivalent to using --color=always.  With
--color=auto, color codes are output only if standard output is connected
to a terminal (tty).  The environment variable LS_COLORS can influence the
colors, and can be set easily by the dircolors command.
Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble.
Report bugs to <bug-coreutils@gnu.org>.
14:50:54
#ls s
ls: cannot access s: No such file or directory
14:50:59
#ls s*
say.conf  sip.conf  sip_notify.conf  skinny.conf  sla.conf  smdi.conf
14:51:01
#mc
14:52:31
#cp /etc/asterisk/sip.conf /etc/asterisk/back/

14:52:51
#cp /etc/asterisk/sip.conf /etc/asterisk/back/

14:52:55
#mc
14:53:23
#cp /etc/asterisk/sip.conf /etc/asterisk/back/

14:53:25
#ls /etc/asterisk/back/
sip.conf
14:53:42
#mv sip.conf sip.conf.SAVE

14:58:52
#echo >> sip.conf

14:59:27
#vi sip.conf
15:00:22
#[201:q]
[301]
~         swor
host=dynamic
~
secret=password
~
~
~
~
~
...
~
~
~
~
~
~
~
~
~
"sip.conf" 6L, 64C written
15:05:20
#cat sip.conf
context=default
[301]
type=friend
secret=password
host=dynamic
15:05:25
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
15:07:41
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
15:07:43
#asterisk -r
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 linux3 (pid = 10413)
linux3*CLI> s
save    say     send    set     show    sip     skinny  sla     soft    stop    stun
linux3*CLI> exit
15:08:07
#asterisk -rx 'sip show peers'
Name/username              Host            Dyn Nat ACL Port     Status
301                        (Unspecified)    D          0        Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 offline]
15:09:02
#asterisk -r
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
=========================================================================
...
       Option "load" forces lookup of peer in realtime storage.
linux3*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
301                        (Unspecified)    D          0        Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 offline]
linux3*CLI> sip show peers\
Name/username              Host            Dyn Nat ACL Port     Status
301/301                    192.168.3.13     D          5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
linux3*CLI> exit
15:11:52
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
15:13:20
#mv extensions.conf extention.conf.SAVE

15:14:28
#vim extention.conf
--- /dev/null	2010-05-25 11:06:19.519277833 +0300
+++ extention.conf	2010-05-25 16:17:14.000000000 +0300
@@ -0,0 +1,5 @@
+[default]
+
+exten => 8000,1,Answer
+exten => 8000,n,Wait(1)
+exten => 8000,n,Playback(demo-thanks)
15:17:14
#cat extention.conf
[default]
exten => 8000,1,Answer
exten => 8000,n,Wait(1)
exten => 8000,n,Playback(demo-thanks)
15:17:21
#cat extention.conf.SAVE
; 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.
15:19:39
#asterisk -r
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 linux3 (pid = 10675)
linux3*CLI> dial
dialplan  dial
linux3*CLI> dialplan reload
No such command 'dialplan reload' (type 'help dialplan reload' for other possible commands)
linux3*CLI> exit
15:21:22
#asterisk -rx
asterisk: option requires an argument -- x
15:22:19
#less /var/log/asterisk/messages
15:24:11
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
15:25:39
#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 linux3 (pid = 10808)
Verbosity was 0 and is now 2
[May 25 16:26:16] NOTICE[10817]: chan_sip.c:14441 handle_request_invite: Call from '301' to extension '8000' rejected because extension not found.
linux3*CLI> exit
Executing last minute cleanups
15:26:24
#mc
15:27:05
#mv extentions.conf extensions.conf

15:29:07
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
15:31:52
#vim sip.conf
--- /tmp/l3-saved-5470.23399.19968	2010-05-25 16:31:58.000000000 +0300
+++ sip.conf	2010-05-25 16:33:05.000000000 +0300
@@ -11,3 +11,7 @@
 secret=password
 host=dynamic
 
+[303]
+type=friend
+secret=password
+host=dynamic
15:33:22
#cat sip.conf
[general]
context=default
[301]
type=friend
secret=password
host=dynamic
[302]
type=friend
secret=password
host=dynamic
[303]
type=friend
secret=password
host=dynamic
15:35:19
#viw sip.conf
bash: viw: command not found
15:37:02
#vim sip.conf
15:39:46
#ca extensions.conf
bash: ca: command not found
15:40:12
#cat extensions.conf
[default]
exten => 8000,1,Answer
exten => 8000,n,Wait(1)
exten => 8000,n,Playback(demo-thanks)
exten => _3xx,1,Dial(STP/${EXTEN})
15:40:36
#asterisk -rx 'dialplan reload'
Dialplan reloaded.
15:43:18
#mc
15:47:27
#vim sip.conf
--- /tmp/l3-saved-5470.29590.586	2010-05-25 16:55:25.000000000 +0300
+++ sip.conf	2010-05-25 17:00:37.000000000 +0300
@@ -1,21 +1,27 @@
 [general]
 context=default
+register => odessa:password@192.168.4.1/odessa
 
 [301]
 type=friend
 secret=password
 host=dynamic
-callerid="Linksys1"
+callerid="Linksys Phone"
 
 [302]
 type=friend
 secret=password
 host=dynamic
-callerid="LinksysAnalog"
+callerid="Linksys Analog"
 
 [303]
 type=friend
 secret=password
 host=dynamic
-callerid="SoftPhone"
+callerid="Soft Phone"
+
+[kharkov]
+type=friend
+secret=password
+host=192.168.4.1
 
прошло 13 минут
16:00:37
#asterisk -rx 'sip reload'

Файлы

  • /etc/default//dhcp3-server
  • /etc/network/interfaces
  • /root/.bash_profile
  • extensions.conf
  • extention.conf
  • extention.conf.SAVE
  • sip.conf
  • /etc/default//dhcp3-server
    >
    # Defaults for dhcp initscript
    # sourced by /etc/init.d/dhcp
    # installed at /etc/default/dhcp3-server by the maintainer scripts
    #
    # This is a POSIX shell fragment
    #
    # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
    #       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
    INTERFACES=""
    
    /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.3.3
            netmask 255.255.255.0
            network 192.168.3.0
            broadcast 192.168.3.255
            gateway 192.168.3.254
            # dns-* options are implemented by the resolvconf package, if installed
            dns-nameservers 10.0.35.1
            dns-search unix.nt
    
    /root/.bash_profile
    >
    l3-agent
    . ~/.bashrc
    
    extensions.conf
    >
    [default]
    exten => 8000,1,Answer
    exten => 8000,n,Wait(1)
    exten => 8000,n,Playback(demo-thanks)
    exten => _3xx,1,Dial(STP/${EXTEN})
    
    extention.conf
    >
    [default]
    exten => 8000,1,Answer
    exten => 8000,n,Wait(1)
    exten => 8000,n,Playback(demo-thanks)
    
    extention.conf.SAVE
    >
    ; 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]
    ;
    ; 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.
    
    sip.conf
    >
    [general]
    context=default
    [301]
    type=friend
    secret=password
    host=dynamic
    [302]
    type=friend
    secret=password
    host=dynamic
    [303]
    type=friend
    secret=password
    host=dynamic
    

    Статистика

    Время первой команды журнала11:05:18 2010- 5-25
    Время последней команды журнала16:00:37 2010- 5-25
    Количество командных строк в журнале100
    Процент команд с ненулевым кодом завершения, % 8.00
    Процент синтаксически неверно набранных команд, % 2.00
    Суммарное время работы с терминалом *, час 2.55
    Количество командных строк в единицу времени, команда/мин 0.65
    Частота использования команд
    ls10|=========| 9.17%
    cat9|========| 8.26%
    asterisk8|=======| 7.34%
    vim8|=======| 7.34%
    ifconfig7|======| 6.42%
    /etc/init.d/asterisk5|====| 4.59%
    ping5|====| 4.59%
    dpkg4|===| 3.67%
    less4|===| 3.67%
    mc4|===| 3.67%
    cp3|==| 2.75%
    mv3|==| 2.75%
    vi3|==| 2.75%
    grep3|==| 2.75%
    fg2|=| 1.83%
    echo2|=| 1.83%
    apt-get2|=| 1.83%
    ~2|=| 1.83%
    /etc/init.d/networking2|=| 1.83%
    ps2|=| 1.83%
    ifup2|=| 1.83%
    >2|=| 1.83%
    ifdown2|=| 1.83%
    tail2|=| 1.83%
    jobs2|=| 1.83%
    dpjg1|| 0.92%
    sip.conf1|| 0.92%
    ca1|| 0.92%
    cd1|| 0.92%
    dir1|| 0.92%
    [201:q]1|| 0.92%
    viw1|| 0.92%
    /etc/init.d/dhcp3-server1|| 0.92%
    .bash_profile1|| 0.92%
    if1|| 0.92%
    apt-cache1|| 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$