/l3/users/2014-11-nt-voip/nt-voip/debian3/root :1 :2 :3 :4 :5 |
|
#screen
|
#screen -x
|
#screen -x
|
#шifconfig
eth0 Link encap:Ethernet HWaddr 6c:3b:e5:39:36:5c inet addr:192.168.12.3 Bcast:192.168.12.255 Mask:255.255.255.0 inet6 addr: fe80::6e3b:e5ff:fe39:365c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:16866 errors:0 dropped:4 overruns:0 frame:0 TX packets:7459 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:12542442 (11.9 MiB) TX bytes:755212 (737.5 KiB) Interrupt:18 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:138 errors:0 dropped:0 overruns:0 frame:0 TX packets:138 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:8328 (8.1 KiB) TX bytes:8328 (8.1 KiB) |
#screen
|
## vse ok
|
#alias exit='echo no exit'
|
#ssh manager@192.168.15.253
^C |
#ping 192.168.12.253
PING 192.168.12.253 (192.168.12.253) 56(84) bytes of data. 64 bytes from 192.168.12.253: icmp_req=1 ttl=64 time=1.45 ms 64 bytes from 192.168.12.253: icmp_req=2 ttl=64 time=0.630 ms 64 bytes from 192.168.12.253: icmp_req=3 ttl=64 time=0.695 ms 64 bytes from 192.168.12.253: icmp_req=4 ttl=64 time=0.704 ms 64 bytes from 192.168.12.253: icmp_req=5 ttl=64 time=0.699 ms 64 bytes from 192.168.12.253: icmp_req=6 ttl=64 time=0.932 ms 64 bytes from 192.168.12.253: icmp_req=7 ttl=64 time=0.771 ms 64 bytes from 192.168.12.253: icmp_req=8 ttl=64 time=0.702 ms 64 bytes from 192.168.12.253: icmp_req=9 ttl=64 time=0.707 ms ... 64 bytes from 192.168.12.253: icmp_req=165 ttl=64 time=0.698 ms 64 bytes from 192.168.12.253: icmp_req=166 ttl=64 time=0.699 ms 64 bytes from 192.168.12.253: icmp_req=167 ttl=64 time=0.694 ms 64 bytes from 192.168.12.253: icmp_req=168 ttl=64 time=0.707 ms 64 bytes from 192.168.12.253: icmp_req=169 ttl=64 time=0.638 ms 64 bytes from 192.168.12.253: icmp_req=170 ttl=64 time=0.714 ms ^C --- 192.168.12.253 ping statistics --- 170 packets transmitted, 170 received, 0% packet loss, time 168999ms rtt min/avg/max/mdev = 0.613/1.339/42.623/4.051 ms |
#sed -i s/192.168.12.1/192.168.10.1/ /etc/network/
sed: couldn't edit /etc/network/: not a regular file |
#sed -i s/192.168.12.1/192.168.10.1/ /etc/network/interfaces |
> ^C |
#ifdown eth0
RTNETLINK answers: No such process |
#ifup eth0
|
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 6c:3b:e5:39:36:5c inet addr:192.168.30.1 Bcast:192.168.30.255 Mask:255.255.255.0 inet6 addr: fe80::6e3b:e5ff:fe39:365c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:107 errors:0 dropped:4 overruns:0 frame:0 TX packets:137 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:15765 (15.3 KiB) TX bytes:15397 (15.0 KiB) Interrupt:18 |
#vim /etc/network/interfaces
|
## iapt-get install isc-dhcp-server
Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libgadu3 Use 'apt-get autoremove' to remove it. Suggested packages: isc-dhcp-server-ldap The following NEW packages will be installed: isc-dhcp-server ... Preconfiguring packages ... Selecting previously unselected package isc-dhcp-server. (Reading database ... 128676 files and directories currently installed.) Unpacking isc-dhcp-server (from .../isc-dhcp-server_4.2.2.dfsg.1-5+deb70u6_amd64.deb) ... Processing triggers for man-db ... Setting up isc-dhcp-server (4.2.2.dfsg.1-5+deb70u6) ... Generating /etc/default/isc-dhcp-server... Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed! failed! invoke-rc.d: initscript isc-dhcp-server, action "start" failed. |
#sed -i s/eth1/eth0/ /etc/default/isc-dhcp-server
|
#vi .
|
#vi .
|
#vi .
|
#vi .
|
#vi .
|
#vi .
|
#vi .
|
#vi .
|
#vi ./etc/default/isc-dhcp-server
|
#vim /etc/dhcp/dhcpd.conf
--- /tmp/l3-saved-4181.21943.6800 2014-11-24 14:57:06.296903453 +0200 +++ /etc/dhcp/dhcpd.conf 2014-11-24 15:06:13.116917656 +0200 @@ -1,107 +1,25 @@ -# -# Sample configuration file for ISC dhcpd for Debian -# -# - -# The ddns-updates-style parameter controls whether or not the server will -# attempt to do a DNS update when a lease is confirmed. We default to the -# behavior of the version 2 packages ('none', since DHCP v2 didn't -# have support for DDNS.) +# вы можете комменты не удалять +# это просто для вас + ddns-update-style none; -# option definitions common to all supported networks... -option domain-name "example.org"; -option domain-name-servers ns1.example.org, ns2.example.org; +# доменное имя unix.nt +option domain-name "unix.nt"; + +# IP-адрес DNS-сервера +option domain-name-servers 192.168.30.254; default-lease-time 600; max-lease-time 7200; - -# If this DHCP server is the official DHCP server for the local -# network, the authoritative directive should be uncommented. -#authoritative; - -# Use this to send dhcp log messages to a different log file (you also -# have to hack syslog.conf to complete the redirection). log-facility local7; -# No service will be given on this subnet, but declaring it helps the -# DHCP server to understand the network topology. -#subnet 10.152.187.0 netmask 255.255.255.0 { -#} +# надо раскомментировать subnet и прописать там свою сеть +subnet 192.168.30.0 netmask 255.255.255.0 { + range 192.168.30.100 192.168.30.200; + option routers 192.168.30.254; +} + +# это весь файл -# 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; -#} - -# This declaration allows BOOTP clients to get dynamic addresses, -# which we don't really recommend. - -#subnet 10.254.239.32 netmask 255.255.255.224 { -# range dynamic-bootp 10.254.239.40 10.254.239.60; -# option broadcast-address 10.254.239.31; -# option routers rtr-239-32-1.example.org; -#} - -# A slightly different configuration for an internal subnet. -#subnet 10.5.5.0 netmask 255.255.255.224 { -# range 10.5.5.26 10.5.5.30; -# option domain-name-servers ns1.internal.example.org; -# option domain-name "internal.example.org"; -# option routers 10.5.5.1; -# option broadcast-address 10.5.5.31; -# default-lease-time 600; -# max-lease-time 7200; -#} - -# Hosts which require special configuration options can be listed in -# host statements. If no address is specified, the address will be -# allocated dynamically (if possible), but the host-specific information -# will still come from the host declaration. - -#host passacaglia { -# hardware ethernet 0:0:c0:5d:bd:95; -# filename "vmunix.passacaglia"; -# server-name "toccata.fugue.com"; -#} - -# Fixed IP addresses can also be specified for hosts. These addresses -# should not also be listed as being available for dynamic assignment. -# Hosts for which fixed IP addresses have been specified can boot using -# BOOTP or DHCP. Hosts for which no fixed address is specified can only -# be booted with DHCP, unless there is an address range on the subnet -# to which a BOOTP client is connected which has the dynamic-bootp flag -# set. -#host fantasia { -# hardware ethernet 08:00:07:26:c0:a5; -# fixed-address fantasia.fugue.com; -#} - -# You can declare a class of clients and then do address allocation -# based on that. The example below shows a case where all clients -# in a certain class get addresses on the 10.17.224/24 subnet, and all -# other clients get addresses on the 10.0.29/24 subnet. - -#class "foo" { -# match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; -#} - -#shared-network 224-29 { -# subnet 10.17.224.0 netmask 255.255.255.0 { -# option routers rtr-224.example.org; -# } -# subnet 10.0.29.0 netmask 255.255.255.0 { -# option routers rtr-29.example.org; -# } -# pool { -# allow members of "foo"; -# range 10.17.224.10 10.17.224.250; -# } -# pool { -# deny members of "foo"; -# range 10.0.29.10 10.0.29.230; -# } -#} |
#oll 'ps aux |gripd
> ^C |
#oll 'ps aux'
bash: oll: command not found |
#cat /var/lib/dhcp/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page. # This lease file was written by isc-dhcp-4.2.2 server-duid "\000\001\000\001\034\005\352\342l;\34596\\"; lease 192.168.30.100 { starts 1 2014/11/24 13:11:05; ends 1 2014/11/24 13:21:05; cltt 1 2014/11/24 13:11:05; binding state active; next binding state free; rewind binding state free; ... lease 192.168.30.101 { starts 1 2014/11/24 13:28:11; ends 1 2014/11/24 13:38:11; cltt 1 2014/11/24 13:28:11; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:1d:72:1d:f4:ab; uid "\001\000\035r\035\364\253"; } |
#установка
bash: $'\321\203\321\201\321\202\320\260\320\275\320\276\320\262\320\272\320\260': command not found |
#apt-cache search asterisk | wc -l
67 |
#apt-get asterisk install
E: Invalid operation asterisk |
#apt-get install asterisk
┌───────────────────────────────┤ Configuring libvpb0 ├────────────────────────────────┐ │ This is the numeric code for the region your phone system will be operating in (eg. │ │ 61 for Australia or 33 for France). It is used to configure the default regional │ │ standards that Voicetronix telephony hardware should comply with. │ │ │ │ ITU-T telephone code: │ │ │ │ 61__________________________________________________________________________________ │ │ │ │ <Ok> │ ... Setting up libmail-sendmail-perl (0.79.16-1) ... Setting up libsox2 (14.4.0-3) ... Setting up libsox-fmt-alsa (14.4.0-3) ... Setting up libsox-fmt-base (14.4.0-3) ... Setting up module-assistant (0.11.4) ... Setting up rsync (3.0.9-4) ... update-rc.d: using dependency based boot sequencing Setting up sox (14.4.0-3) ... Setting up vpb-driver-source (4.2.55-1) ... Setting up asterisk-moh-opsound-gsm (2.03-1) ... |
#dpkg-reconfigure asterisk
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#dpkg-reconfigure asterisk
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#dpkg-reconfigure asterisk-config
|
#/etc/init.d/asterisk restsrt
Usage: /etc/init.d/asterisk {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|restart-convenient|force-reload} |
#/etc/init.d/asterisk restsrt
Usage: /etc/init.d/asterisk {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|restart-convenient|force-reload} |
#/etc/init.d/asterisk restasrt
Usage: /etc/init.d/asterisk {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|restart-convenient|force-reload} |
#/etc/init.d/ asterisk restasrt
bash: /etc/init.d/: Is a directory |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 11421) debian3*CLI> ! ael agent agi aoc calendar cc ... data database devstate dialplan dnsmgr dundi event fax features file group gtalk hangup help http iax2 indication jabber jingle keys local logger manager minivm mixmonitor module moh no odbc originate parkedcalls phoneprov pri queue realtime reload rtcp rtp say sip skinny sqlite stun timing udptl ulimit unistim voicemail debian3*CLI> sip show pe No such command 'sip show pe' (type 'core show help sip show pe' for other possible commands) debian3*CLI> quit |
#mv /etc/asterisk/extensions.conf{,.bak}
|
#mv /etc/asterisk/sip.conf{,.bak}
|
#vim /etc/asterisk/sip.conf.bak
|
#vim /etc/asterisk/sip.conf
--- /dev/null 2014-11-24 09:43:31.066459590 +0200 +++ /etc/asterisk/sip.conf 2014-11-24 17:13:27.013078179 +0200 @@ -0,0 +1,15 @@ +[genetal] +context=default + +[1301] +type=friend +secret=1234 +host=dynamic + + + +[1302] +type=friend +secret=1234 +host=dynamic + |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#vim /etc/asterisk/sip.conf.bak
|
#xset s off
|
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 11683) debian3*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1301/1301 192.168.30.100 D N 5060 Unmonitored 1302/1302 192.168.30.101 D N 33728 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] [Nov 24 18:01:42] NOTICE[11708]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1302 [Nov 24 18:04:43] NOTICE[11708]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1302 debian3*CLI> Disconnected from Asterisk server |
#ls -la /etc/asterisk/ext
extconfig.conf extensions.conf.bak extensions_minivm.conf extensions.ael extensions.lua |
#ls -la /etc/asterisk/ext
extconfig.conf extensions.conf.bak extensions_minivm.conf extensions.ael extensions.lua |
#ls -la /etc/asterisk/extensions.conf.bak
-rw-r----- 1 asterisk asterisk 30823 Jan 4 2014 /etc/asterisk/extensions.conf.bak |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-4181.15335.29691 2014-11-24 18:16:46.885158073 +0200 +++ /etc/asterisk/extensions.conf 2014-11-24 18:17:51.757159438 +0200 @@ -1 +1,4 @@ +[default] + + exten => _13XX,1,Dial(SIP/${EXTEN}) |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 11683) debian3*CLI> dialplan re reload remove debian3*CLI> dialplan reload Dialplan reloaded. [Nov 24 18:19:22] WARNING[11708]: chan_sip.c:20457 handle_response_invite: just did sched_add waitid(37) for sip_reinvite_retry for dialog Nzc3Y2Y2OTc2MzZkNzkyOWYzNDdjYzg3ZmU3ZWNhMTY. in handle_response_invite [Nov 24 18:19:29] NOTICE[11708]: chan_sip.c:23107 handle_request_invite: Unable to create/find SIP channel for this INVITE [Nov 24 18:19:44] NOTICE[11708]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1302 debian3*CLI> Disconnected from Asterisk server |
#ÑÑÑÐhistory
1 vim /etc/resolv.conf 2 vi /etc/resolv.conf 3 exit 4 vim /etc/apt/sources.list 5 vi /etc/apt/sources.list 6 exit 7 vim /etc/network/interfaces 8 nano /etc/network/interfaces 9 vim /etc/resolv.conf 10 nano /etc/resolv.conf ... 104 vim /etc/asteriks/extansions.conf 105 vim /etc/asteriks/extansions.conf 106 ls -la /etc/asteriks/extansions.conf 107 ls -la /etc/asterisk/extensions.conf.bak 108 ls -l /etc/asterisk/extensions.conf 109 touch /etc/asterisk/extensions.conf 110 vim /etc/asterisk/extensions.conf 111* 112 asterisk -r 113 history |
#cat /ets/asterisk/sip.conf
cat: /ets/asterisk/sip.conf: No such file or directory |
#cat /etc/asterisk/sip.conf
[genetal] context=default [1301] type=friend secret=1234 host=dynamic [1302] type=friend secret=1234 host=dynamic |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) debian3*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1301/1301 192.168.30.100 D N 5060 Unmonitored 1302/1302 192.168.30.101 D N 57178 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] debian3*CLI> sip show peers Disconnected from Asterisk server |
#cat /etc/asterisk/sip.conf
[genetal] context=default [1301] type=friend secret=1234 host=dynamic [1302] type=friend secret=1234 host=dynamic |
#asterisk -rv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) Verbosity was 0 and is now 1 debian3*CLI> sip reload Reloading SIP debian3*CLI> sip show peers Disconnected from Asterisk server Executing last minute cleanups |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) Verbosity is at least 1 debian3*CLI> sip shov peers No such command 'sip shov peers' (type 'core show help sip shov peers' for other possible commands) [Nov 25 10:13:20] NOTICE[2765]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1302 debian3*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1301/1301 192.168.30.100 D N 5060 Unmonitored 1302/1302 192.168.30.101 D N 57178 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] [Nov 25 10:16:20] NOTICE[2765]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1302 debian3*CLI> Disconnected from Asterisk server |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-4114.28997.10042 2014-11-25 10:16:52.840552306 +0200 +++ /etc/asterisk/sip.conf 2014-11-25 10:27:45.180560031 +0200 @@ -1,8 +1,27 @@ -quntext=yes + [genetal] context=default +qualify=yes + +[phone](!) +type=friend +host=dynamic +qualify=yes + +[softphone](!) + +;... +qualify=no + +[smartphon](~.,softphone) +qualify=yes + +[uplink](!) +;... + + [1301] type=friend |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-4114.21958.17287 2014-11-25 10:29:11.692561054 +0200 +++ /etc/asterisk/sip.conf 2014-11-25 10:36:11.296566025 +0200 @@ -5,6 +5,12 @@ context=default qualify=yes +#include "/etc/asterisk/sip.conf.kiev" +#include "/etc/asterisk/sip.conf.kharkov" +#include "/etc/asterisk/sip.conf.odessa" + + + [phone](!) type=friend host=dynamic |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-4114.1604.4449 2014-11-25 10:36:15.308566068 +0200 +++ /etc/asterisk/sip.conf 2014-11-25 10:37:46.212567141 +0200 @@ -1,13 +1,9 @@ - - - [genetal] context=default qualify=yes #include "/etc/asterisk/sip.conf.kiev" -#include "/etc/asterisk/sip.conf.kharkov" -#include "/etc/asterisk/sip.conf.odessa" + @@ -16,16 +12,7 @@ host=dynamic qualify=yes -[softphone](!) - -;... -qualify=no - -[smartphon](~.,softphone) -qualify=yes -[uplink](!) -;... |
#ls -l /etc/asterisk/extensions
ls: cannot access /etc/asterisk/extensions: No such file or directory |
#ls -l /etc/asterisk/extensions.*
-rw-r----- 1 asterisk asterisk 12776 Jan 4 2014 /etc/asterisk/extensions.ael -rw-r--r-- 1 root root 48 Nov 24 18:17 /etc/asterisk/extensions.conf -rw-r----- 1 asterisk asterisk 30823 Jan 4 2014 /etc/asterisk/extensions.conf.bak -rw-r----- 1 asterisk asterisk 5253 Jan 4 2014 /etc/asterisk/extensions.lua |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-4114.14283.8210 2014-11-25 11:47:38.908616773 +0200 +++ /etc/asterisk/extensions.conf 2014-11-25 11:53:47.980621211 +0200 @@ -2,7 +2,14 @@ exten => _13XX,1,Dial(SIP/${EXTEN}) - +exten => _13XX,n,No0p(to extension ${EXTEN}) +exten => _11XX,n,Dial(SIP/${EXTEN}) + +exten => 8100,1,Record(/var/tmp/asterisk/record00:gsm) + + + + |
#mkdir /var/tmp/asterisk
|
#chowd asterisk: /var/tmp/asterisk
bash: chowd: command not found |
#chown asterisk: /var/tmp/asterisk
|
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5140.31881.15037 2014-11-25 12:07:47.280631069 +0200 +++ /etc/asterisk/extensions.conf 2014-11-25 12:27:43.440645237 +0200 @@ -9,7 +9,8 @@ - +exten => _81XX,1,Record(/var/tmp/asterisk/record ${EXTEN:2}:gsm) +exten => _82XX,1,Playback(/var/tmp/asterisk/record ${EXTEN:2}) |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) Verbosity is at least 1 debian3*CLI> dialplan re reload remove debian3*CLI> dialplan reload Dialplan reloaded. [Nov 25 12:28:30] NOTICE[2765]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1302 [Nov 25 12:28:46] NOTICE[2765]: chan_sip.c:22753 handle_request_invite: Call from '1301' (192.168.30.100:5060) to extension '81100' rejected because extension not found in context 'default'. debian3*CLI> Disconnected from Asterisk server |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5140.2732.24062 2014-11-25 12:29:43.580646650 +0200 +++ /etc/asterisk/extensions.conf 2014-11-25 12:30:28.232647179 +0200 @@ -9,8 +9,8 @@ -exten => _81XX,1,Record(/var/tmp/asterisk/record ${EXTEN:2}:gsm) -exten => _82XX,1,Playback(/var/tmp/asterisk/record ${EXTEN:2}) +exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm) +exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) |
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) ... -- Registered extension context 'demo'; registrar: pbx_lua -- merging incls/swits/igpats from old(demo) to new(demo) context, registrar = pbx_config -- Including switch 'Lua/' in context 'demo' -- Time to scan old dialplan and merge leftovers back into the new: 0.001994 sec -- Time to restore hints and swap in new dialplan: 0.000006 sec -- Time to delete the old dialplan: 0.000064 sec -- Total time merge_contexts_delete: 0.002064 sec debian3*CLI> dialplan reload Disconnected from Asterisk server Executing last minute cleanups |
#ls -ls /var/tmp/asterisk/
total 8 8 -rw-rw---- 1 asterisk asterisk 4620 Nov 25 12:31 record00.gsm |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) Verbosity is at least 3 debian3*CLI> Disconnected from Asterisk server |
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-5140.14042.23926 2014-11-25 13:34:40.576692773 +0200 +++ /etc/asterisk/sip.conf 2014-11-25 13:35:34.560693409 +0200 @@ -2,7 +2,7 @@ context=default qualify=yes -#include "/etc/asterisk/sip.conf.kiev" +;include "/etc/asterisk/sip.conf.kiev" register => minsk:1234@192.168.60.1/brest |
#vim /etc/asterisk/sip.conf
|
#vim /etc/asterisk/sip.conf
|
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-5140.19583.23414 2014-11-25 13:42:16.248698167 +0200 +++ /etc/asterisk/sip.conf 2014-11-25 13:42:38.008698425 +0200 @@ -1,4 +1,4 @@ -[genetal] +[general] context=default qualify=yes |
#vim /etc/asterisk/sip.conf
|
#vim /etc/asterisk/extensions.conf
|
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) Verbosity is at least 3 debian3*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1301/1301 192.168.30.100 D N 5060 OK (20 ms) 1302/1302 192.168.30.101 D N 55782 OK (105 ms) brest/minsk (Unspecified) D N 0 UNKNOWN 3 sip peers [Monitored: 2 online, 1 offline Unmonitored: 0 online, 0 offline] -- Registered SIP 'brest' at 192.168.60.1:5060 [Nov 25 13:48:57] NOTICE[2765]: chan_sip.c:20886 handle_response_peerpoke: Peer 'brest' is now Reachable. (1ms / 2000ms) debian3*CLI> quit Executing last minute cleanups |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5140.10103.13444 2014-11-25 13:51:01.552704385 +0200 +++ /etc/asterisk/extensions.conf 2014-11-25 13:51:35.680704787 +0200 @@ -12,7 +12,7 @@ exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm) exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) -exten => 23,XX,1,Dial(SIP/${EXTEN}) +exten =>_23XX,1,Dial(SIP/${EXTEN}) |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian3 (pid = 2704) Verbosity is at least 3 == Using SIP RTP CoS mark 5 [Nov 25 13:52:16] NOTICE[2765]: chan_sip.c:22753 handle_request_invite: Call from '1301' (192.168.30.100:5060) to extension '2301' rejected because extension not found in context 'default'. [Nov 25 13:52:34] NOTICE[2765]: chan_sip.c:24850 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1302 debian3*CLI> sip reload Disconnected from Asterisk server |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5140.10.24679 2014-11-25 13:52:43.772705595 +0200 +++ /etc/asterisk/extensions.conf 2014-11-25 13:54:01.844706517 +0200 @@ -12,7 +12,7 @@ exten => _81XX,1,Record(/var/tmp/asterisk/record${EXTEN:2}:gsm) exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) -exten =>_23XX,1,Dial(SIP/${EXTEN}) +exten =>_23XX,1,Dial(SIP/brest/${EXTEN}) |
[genetal] context=default [1301] type=friend secret=1234 host=dynamic [1302] type=friend secret=1234 host=dynamic
# The format of this file is documented in the dhcpd.leases(5) manual page. # This lease file was written by isc-dhcp-4.2.2 server-duid "\000\001\000\001\034\005\352\342l;\34596\\"; lease 192.168.30.100 { starts 1 2014/11/24 13:11:05; ends 1 2014/11/24 13:21:05; cltt 1 2014/11/24 13:11:05; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:19:56:fd:75:0a; uid "\001\000\031V\375u\012"; client-hostname "SEP001956FD750A"; } lease 192.168.30.100 { starts 1 2014/11/24 13:16:06; ends 1 2014/11/24 13:26:06; cltt 1 2014/11/24 13:16:06; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:19:56:fd:75:0a; uid "\001\000\031V\375u\012"; client-hostname "SEP001956FD750A"; } lease 192.168.30.100 { starts 1 2014/11/24 13:21:06; ends 1 2014/11/24 13:31:06; cltt 1 2014/11/24 13:21:06; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:19:56:fd:75:0a; uid "\001\000\031V\375u\012"; client-hostname "SEP001956FD750A"; } lease 192.168.30.100 { starts 1 2014/11/24 13:26:07; ends 1 2014/11/24 13:36:07; cltt 1 2014/11/24 13:26:07; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:19:56:fd:75:0a; uid "\001\000\031V\375u\012"; client-hostname "SEP001956FD750A"; } lease 192.168.30.101 { starts 1 2014/11/24 13:28:11; ends 1 2014/11/24 13:38:11; cltt 1 2014/11/24 13:28:11; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:1d:72:1d:f4:ab; uid "\001\000\035r\035\364\253"; }
Время первой команды журнала | 09:06:04 2014-11-24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 12:52:39 2014-11-25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 13.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 5.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 6.31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ 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 |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008