/l3/users/a.krivulya/asterisk/linux2.unix.nt/root :1 :2 :3 :4 :5 |
|
#w
12:10:44 up 26 min, 2 users, load average: 0,00, 0,00, 0,01 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 - 12:07 0.00s 0.04s 0.02s /bin/login -- root tty2 - 11:46 3:37 1.72s 1.62s ssh 192.168.15. |
#vi /etc/network/interfaces
--- /tmp/l3-saved-3957.9303.30644 2010-05-25 12:21:51.000000000 +0300 +++ /etc/network/interfaces 2010-05-25 12:25:35.000000000 +0300 @@ -8,11 +8,11 @@ # The primary network interface allow-hotplug eth0 iface eth0 inet static - address 192.168.15.2 + address 192.168.2.1 netmask 255.255.255.0 - network 192.168.15.0 - broadcast 192.168.15.255 - gateway 192.168.15.254 + network 192.168.2.0 + broadcast 192.168.2.255 + gateway 192.168.2.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 10.0.35.1 dns-search unix.nt |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:02:44:29:e5:ae inet addr:192.168.15.2 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::202:44ff:fe29:e5ae/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:21614 errors:0 dropped:0 overruns:0 frame:0 TX packets:5880 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:28638878 (27.3 MiB) TX bytes:405148 (395.6 KiB) Interrupt:22 Base address:0xd800 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:5 errors:0 dropped:0 overruns:0 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:416 (416.0 B) TX bytes:416 (416.0 B) |
#ping 192.168.2.254
PING 192.168.2.254 (192.168.2.254) 56(84) bytes of data. 64 bytes from 192.168.2.254: icmp_seq=1 ttl=64 time=0.588 ms 64 bytes from 192.168.2.254: icmp_seq=2 ttl=64 time=0.573 ms 64 bytes from 192.168.2.254: icmp_seq=3 ttl=64 time=0.584 ms 64 bytes from 192.168.2.254: icmp_seq=4 ttl=64 time=0.571 ms 64 bytes from 192.168.2.254: icmp_seq=5 ttl=64 time=0.922 ms 64 bytes from 192.168.2.254: icmp_seq=6 ttl=64 time=0.580 ms ^C --- 192.168.2.254 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5004ms rtt min/avg/max/mdev = 0.571/0.636/0.922/0.129 ms |
#c<t
![]() bash: t: Нет такого файла или каталога |
#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 eth0 iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.2.1 netmask 255.255.255.0 network 192.168.2.0 broadcast 192.168.2.255 gateway 192.168.2.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 10.0.35.1 dns-search unix.nt |
#.
![]() bash: .: требуется аргумент имя файла .: usage: . filename [arguments] |
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.226 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.208 ms ^C --- 10.0.35.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.208/0.217/0.226/0.009 ms |
#ping 193.239.74.7
PING 193.239.74.7 (193.239.74.7) 56(84) bytes of data. 64 bytes from 193.239.74.7: icmp_seq=1 ttl=57 time=5.26 ms 64 bytes from 193.239.74.7: icmp_seq=2 ttl=57 time=4.33 ms ^C --- 193.239.74.7 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1005ms rtt min/avg/max/mdev = 4.334/4.799/5.264/0.465 ms |
#ps ax|grep ssh
2661 tty2 S+ 0:02 ssh 192.168.15.4 4144 ? Ss 0:00 /usr/sbin/sshd 4224 pts/0 S+ 0:00 grep ssh |
#kill 2661
|
#apt-cache search dhcp
autodns-dhcp - Automatic DNS updates for DHCP avahi-autoipd - Avahi IPv4LL network address configuration daemon backuppc - high-performance, enterprise-grade system for backing up PCs bootp - server for the bootp protocol with DHCP support dhcdbd - D-Bus interface to the ISC DHCP client dhcp-helper - A DHCP relay agent dhcp-client - DHCP client transitional package dhcp3-client - DHCP client dhcp3-common - common files used by all the dhcp3* packages dhcp3-dev - API for accessing and modifying the DHCP server and client state ... resolvconf - name server information handler totd - Small DNS proxy that supports IPv6/IPv4 record translation udhcpc - very small DHCP client udhcpd - very small DHCP server whereami - Automatically reconfigure your (laptop) system for a new location wide-dhcpv6-client - DHCPv6 client for automatic IPv6 hosts configuration wide-dhcpv6-relay - DHCPv6 relay for automatic IPv6 hosts configuration wide-dhcpv6-server - DHCPv6 server for automatic IPv6 hosts configuration yersinia - Network vulnerabilities check software network-manager-gnome - network management framework (GNOME frontend) |
#apt-cache search dhcp3-server
dhcp3-server-ldap - DHCP server able to use LDAP as backend dhcp3-server - DHCP server for automatic IP address assignment udhcpd - very small DHCP server |
#apt-get install dhcp3-server
│ │ └───────────────────────────────────────────────────────────────────────────┘ Выбор ранее не выбранного пакета dhcp3-server. (Чтение базы данных... на данный момент установлено 19112 файлов и каталогов.) Распаковывается пакет dhcp3-server (из файла .../dhcp3-server_3.1.1-6+lenny4_i386.deb)... Обрабатываются триггеры для man-db ... Настраивается пакет dhcp3-server (3.1.1-6+lenny4) ... Generating /etc/default/dhcp3-server... Starting DHCP server: dhcpd3check syslog for diagnostics. failed! failed! invoke-rc.d: initscript dhcp3-server, action "start" failed. |
#vi /etc/default/dhcp3-server
--- /tmp/l3-saved-3957.31334.30312 2010-05-25 12:45:43.000000000 +0300 +++ /etc/default/dhcp3-server 2010-05-25 12:45:50.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" |
#vi /etc/dhcp3/dhcpd.conf
--- /tmp/l3-saved-3957.10331.28199 2010-05-25 12:47:07.000000000 +0300 +++ /etc/dhcp3/dhcpd.conf 2010-05-25 12:50:59.000000000 +0300 @@ -11,8 +11,8 @@ 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; +option domain-name "unix.tn"; +option domain-name-servers 10.0.35.1; default-lease-time 600; max-lease-time 7200; @@ -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.2.0 netmask 255.255.255.0 { + range 192.168.2.2 192.168.2.10 + option routers 192.168.2.254; +} # This declaration allows BOOTP clients to get dynamic addresses, # which we don't really recommend. |
#psa
![]() bash: psa: команда не найдена |
#less /var/lib/dhcp3/dhcpd.leases
![]() |
#apt-get install less
Чтение списков пакетов... Готово Построение дерева зависимостей Чтение информации о состоянии... Готово НОВЫЕ пакеты, которые будут установлены: less обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено. Необходимо скачать 115kБ архивов. После данной операции, объём занятого дискового пространства возрастёт на 229kB. Получено:1 http://10.0.35.1 lenny/main less 418-1 [115kB] Получено 115kБ за 0s (1810kБ/c) Выбор ранее не выбранного пакета less. (Чтение базы данных... на данный момент установлено 19125 файлов и каталогов.) Распаковывается пакет less (из файла .../archives/less_418-1_i386.deb)... Обрабатываются триггеры для man-db ... Настраивается пакет less (418-1) ... |
#date
Вто Май 25 13:44:14 EEST 2010 |
#ssh 89.252.37.33
![]() The authenticity of host '89.252.37.33 (89.252.37.33)' can't be established. DSA key fingerprint is 93:ba:99:52:36:1a:bf:40:30:f7:24:30:17:b5:2f:9a. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '89.252.37.33' (DSA) to the list of known hosts. Password: |
#ssh shurik@89.252.37.33
===>>> Dependency check complete for devel/libsoup gvfs-1.4.3_2 >> libsoup-2.28.2_2 ===> Cleaning for libsoup-2.30.1 libsoup has the following configurable option(s): WITHOUT_SSL Disable GnuTLS SSL support ===> Extracting for libsoup-2.30.1 => MD5 Checksum OK for gnome2/libsoup-2.30.1.tar.bz2. => SHA256 Checksum OK for gnome2/libsoup-2.30.1.tar.bz2. ===> Patching for libsoup-2.30.1 ===> libsoup-2.30.1 depends on package: libtool>=2.2 - found ... 1314 ?? I 0:00,01 kdm-bin: :0 (kdm-bin) 1315 ?? I 0:00,92 /usr/local/kde4/lib/kde4/libexec/kdm-bin_greet > su Password: work-nb# work-nb# exit > logout Connection to 10.1.1.131 closed. shurik@mozart:/home/shurik> logout Connection to 89.252.37.33 closed. |
#tail -f /var/log/messages
![]() May 25 13:58:54 linux2 dhcpd: DHCPREQUEST for 192.168.2.2 from 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 13:58:54 linux2 dhcpd: DHCPACK on 192.168.2.2 to 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:03:54 linux2 dhcpd: DHCPREQUEST for 192.168.2.2 from 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:03:54 linux2 dhcpd: DHCPACK on 192.168.2.2 to 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:08:54 linux2 dhcpd: DHCPREQUEST for 192.168.2.2 from 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:08:54 linux2 dhcpd: DHCPACK on 192.168.2.2 to 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:15:57 linux2 dhcpd: DHCPREQUEST for 192.168.2.2 from 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:15:57 linux2 dhcpd: DHCPACK on 192.168.2.2 to 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:16:32 linux2 kernel: [ 9119.636422] eth0: link down May 25 14:16:46 linux2 kernel: [ 9133.312928] eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1 May 25 14:16:58 linux2 kernel: [ 9145.168011] eth0: link down May 25 14:17:02 linux2 kernel: [ 9148.842500] eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1 ^C |
#tail -f /var/log/messages
![]() May 25 14:03:54 linux2 dhcpd: DHCPREQUEST for 192.168.2.2 from 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:03:54 linux2 dhcpd: DHCPACK on 192.168.2.2 to 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:08:54 linux2 dhcpd: DHCPREQUEST for 192.168.2.2 from 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:08:54 linux2 dhcpd: DHCPACK on 192.168.2.2 to 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:15:57 linux2 dhcpd: DHCPREQUEST for 192.168.2.2 from 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:15:57 linux2 dhcpd: DHCPACK on 192.168.2.2 to 00:07:e9:0c:45:11 (UC-03) via eth0 May 25 14:16:32 linux2 kernel: [ 9119.636422] eth0: link down May 25 14:16:46 linux2 kernel: [ 9133.312928] eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1 May 25 14:16:58 linux2 kernel: [ 9145.168011] eth0: link down May 25 14:17:02 linux2 kernel: [ 9148.842500] eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1 May 25 14:17:40 linux2 kernel: [ 9186.932011] eth0: link down May 25 14:17:44 linux2 kernel: [ 9191.241898] eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1 ^C |
#less /var/lib/dhcp3/dhcpd.leases
|
#apt-get install asterisk asterisk-config asterisk-sounds-extra
Чтение списков пакетов... Готово Построение дерева зависимостей Чтение информации о состоянии... Готово Будут установлены следующие дополнительные пакеты: asterisk-sounds-main ca-certificates debhelper file gettext gettext-base html2text intltool-debian libasound2 libc-client2007b libcap2 libcompress-raw-zlib-perl libcompress-zlib-perl libcurl3 libdigest-hmac-perl libdigest-sha1-perl libfile-remove-perl libgsm1 libidn11 libiksemel3 libio-compress-base-perl libio-compress-zlib-perl libio-stringy-perl libldap-2.4-2 libltdl3 libmagic1 libmail-box-perl libmail-sendmail-perl ... Настраивается пакет libmime-types-perl (1.24-1) ... Настраивается пакет libmailtools-perl (2.03-1) ... Настраивается пакет libobject-realize-later-perl (0.18-1) ... Настраивается пакет liburi-perl (1.35.dfsg.1-1) ... Настраивается пакет libuser-identity-perl (0.92-2) ... Настраивается пакет libmail-box-perl (2.082-2) ... Настраивается пакет libsys-hostname-long-perl (1.4-2) ... Настраивается пакет libmail-sendmail-perl (0.79-5) ... Настраивается пакет module-assistant (0.10.11.0) ... Настраивается пакет vpb-driver-source (4.2.38.1-1) ... |
#cd /etc/asterisk/
|
#mv sip.conf sip.conf.dist
|
#vi sip.conf
![]() |
#~
4144 ? Ss 0:00 /usr/sbin/sshd 4239 tty2 S+ 0:02 ssh 192.168.4.1 9251 pts/0 S+ 0:00 grep ssh |
#vi sip.conf
![]() --- /dev/null 2010-05-25 11:44:35.522691071 +0300 +++ sip.conf 2010-05-25 16:01:53.000000000 +0300 @@ -0,0 +1,8 @@ +context=default + +[201] +type=friend +secret=password +host=dynamic + + |
#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 linux2 (pid = 9306) linux2*CLI> sip show peers No such command 'sip show peers' (type 'help sip show' for other possible commands) linux2*CLI> sip show No such command 'sip show' (type 'help sip show' for other possible commands) linux2*CLI> help sip No such command 'sip'. linux2*CLI> exit |
#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 linux2 (pid = 9306) Verbosity was 0 and is now 2 linux2*CLI> exit Executing last minute cleanups |
#asterisk -rx "reload"
The 'reload' command is deprecated and will be removed in a future release. Please use 'module reload' instead. |
#asterisk -rx "sip reload"
No such command 'sip reload' (type 'help sip reload' for other possible commands) |
#asterisk -rx "module reload"
|
#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 linux2 (pid = 9306) Verbosity is at least 2 linux2*CLI> sip show peers No such command 'sip show peers' (type 'help sip show' for other possible commands) linux2*CLI> exit |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#sockstat -4l|grep ast
![]() bash: sockstat: команда не найдена |
#netstat -l|grep aster
unix 2 [ ACC ] STREAM LISTENING 24847 /var/run/asterisk/asterisk.ctl |
#vm extensions.conf extensions.conf.dist
![]() bash: vm: команда не найдена |
#mv extensions.conf extensions.conf.dist
|
#vi extensions.conf
![]() --- /dev/null 2010-05-25 11:44:35.522691071 +0300 +++ extensions.conf 2010-05-25 16:18:55.000000000 +0300 @@ -0,0 +1,5 @@ +[default] + +exten => 8000,1,Answer +exten => 8000,n,Wait(1) +exten => 8000,n,Playback(demo-thanks) |
#asterisk -rx "extensions reload"
Dialplan reloaded. The 'extensions reload' command is deprecated and will be removed in a future release. Please use 'dialplan reload' instead. |
#asterisk -rx "dialplan reload"
Dialplan reloaded. |
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Added extension '8000' priority 2 to default -- Added extension '8000' priority 3 to default == Parsing '/etc/asterisk/users.conf': Found -- Executing [8000@default:1] Answer("SIP/201-081ab798", "") in new stack -- Executing [8000@default:2] Wait("SIP/201-081ab798", "1") in new stack -- Executing [8000@default:3] Playback("SIP/201-081ab798", "demo-thanks") in new stack -- <SIP/201-081ab798> Playing 'demo-thanks' (language 'en') == Auto fallthrough, channel 'SIP/201-081ab798' status is 'UNKNOWN' linux2*CLI> exit Executing last minute cleanups |
#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 ========================================================================= ... [ Context 'ael-dundi-e164-canonical' created by 'pbx_ael' ] [ Context 'parkedcalls' created by 'res_features' ] '700' => 1. Park() [res_features] -= 27 extensions (66 priorities) in 21 contexts. =- linux2*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 201/201 192.168.2.3 D 2048 Unmonitored 1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline] linux2*CLI> exit Executing last minute cleanups |
#vi sip.conf
--- /tmp/l3-saved-3957.32538.18768 2010-05-25 16:30:01.000000000 +0300 +++ sip.conf 2010-05-25 16:30:50.000000000 +0300 @@ -6,4 +6,8 @@ secret=password host=dynamic +[202] +type=friend +secret=password +host=dynamic |
#asterisk -rx "sip reload"
|
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] |
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': Found == Parsing '/etc/asterisk/extconfig.conf': Found Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux2 (pid = 9440) Verbosity is at least 3 linux2*CLI> exit Executing last minute cleanups |
#vi extensions.conf
--- /tmp/l3-saved-3957.27650.23130 2010-05-25 16:35:50.000000000 +0300 +++ extensions.conf 2010-05-25 16:36:18.000000000 +0300 @@ -3,3 +3,5 @@ exten => 8000,1,Answer exten => 8000,n,Wait(1) exten => 8000,n,Playback(demo-thanks) + +exten => 201,1,Dial(SIP/201) |
#asterisk -rx "sip reload"
|
#asterisk -rx "dialplan reload"
Dialplan reloaded. |
#vi extensions.conf
--- /tmp/l3-saved-3957.13077.6571 2010-05-25 16:38:00.000000000 +0300 +++ extensions.conf 2010-05-25 16:38:48.000000000 +0300 @@ -4,4 +4,4 @@ exten => 8000,n,Wait(1) exten => 8000,n,Playback(demo-thanks) -exten => 201,1,Dial(SIP/201) +exten => _2XX,1,Dial(SIP/${EXTEN}) |
#asterisk -rx "dialplan reload"
Dialplan reloaded. |
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': Found == Parsing '/etc/asterisk/extconfig.conf': Found Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux2 (pid = 9440) Verbosity is at least 3 -- Executing [202@default:1] Dial("SIP/201-081ab4e8", "SIP/202") in new stack -- Called 202 -- SIP/202-081d6f10 is ringing [May 25 16:39:26] NOTICE[9451]: chan_sip.c:15500 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 202 == Spawn extension (default, 202, 1) exited non-zero on 'SIP/201-081ab4e8' linux2*CLI> exit Executing last minute cleanups |
#~
[201] type=friendc callerid="ip phone" secret=password [202=dynamic c callerid="softphone" ~ ~ ~ ~ ~ ~ ~ "sip.conf" 16 lines, 165 characters written |
#asterisk -rx "sip reload"
|
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-3957.18934.18507 2010-05-25 16:55:46.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-05-25 17:00:50.000000000 +0300 @@ -1,5 +1,6 @@ [general] context=default +register=kiev:password@192.168.1.1/kiev [201] type=friend @@ -14,3 +15,9 @@ callerid="softphone" +[dnepr] +type=friend +secret=passowrd +host=192.168.1.1 + + |
#asterisk -rx "sip reload"
|
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status dnepr 192.168.1.1 5060 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 0 offline] |
#vi /etc/asterisk/sip.conf
|
#~
Name/username Host Dyn Nat ACL Port Status dnepr 192.168.1.1 5060 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 0 offline] |
#asterisk -rx "sip show peer dnepr"
* Name : dnepr Secret : <Set> MD5Secret : <Not set> Context : default Subscr.Cont. : <Not set> Language : AMA flags : Unknown Transfer mode: open CallingPres : Presentation Allowed, Not Screened Callgroup : ... Addr->IP : 192.168.1.1 Port 5060 Defaddr->IP : 0.0.0.0 Port 0 Def. Username: SIP Options : (none) Codecs : 0x8000e (gsm|ulaw|alaw|h263) Codec Order : (none) Auto-Framing: No Status : Unmonitored Useragent : Reg. Contact : |
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status dnepr 192.168.1.1 5060 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 0 offline] |
#~
exten => 8000,1,Answer exten => 8000,n,Wait(1) ) exten => _1XX,1,Dial(SIP/dnepr) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "extensions.conf" 9 lines, 165 characters written |
#vi /etc/asterisk/sip.conf
|
#asterisk -rx "dialplan reload"
Dialplan reloaded. |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-3957.3201.21269 2010-05-25 17:17:43.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-05-25 17:18:19.000000000 +0300 @@ -18,6 +18,6 @@ [dnepr] type=friend secret=passowrd -host=192.168.1.1 +host=dynamic |
#asterisk -rx "sip reload"
|
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status dnepr (Unspecified) D 0 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 1 offline] |
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status dnepr (Unspecified) D 0 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 1 offline] |
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status dnepr (Unspecified) D 0 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 1 offline] |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-3957.29338.32615 2010-05-25 17:19:20.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-05-25 17:20:01.000000000 +0300 @@ -20,4 +20,7 @@ secret=passowrd host=dynamic - +[crimea] +type=friend +secret=password +host=dynamic |
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status crimea (Unspecified) D 0 Unmonitored dnepr/kiev 192.168.1.1 D 5060 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 4 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 1 offline] |
#asterisk -rx "sip show peers"
Name/username Host Dyn Nat ACL Port Status crimea/crimea 192.168.5.1 D 5060 Unmonitored dnepr/kiev 192.168.1.1 D 5060 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 4 sip peers [Monitored: 0 online, 0 offline Unmonitored: 4 online, 0 offline] |
#vi /etc/asterisk/extensions.conf
|
#type=friend
![]() |
#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/sip_notify.conf': Found linux2*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status crimea/crimea 192.168.5.1 D 5060 Unmonitored dnepr/kiev 192.168.1.1 D 5060 Unmonitored 202/202 192.168.2.2 D 64402 Unmonitored 201/201 192.168.2.3 D 2048 Unmonitored 4 sip peers [Monitored: 0 online, 0 offline Unmonitored: 4 online, 0 offline] linux2*CLI> quit Executing last minute cleanups |
#cat /etc/asterisk/extensions.conf
[default] exten => 8000,1,Answer exten => 8000,n,Wait(1) exten => 8000,n,Playback(demo-thanks) exten => _2XX,1,Dial(SIP/${EXTEN}) exten => _1XX,1,Dial(SIP/dnepr/${EXTEN}) |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-10194.4322.2117 2010-05-25 17:25:48.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-05-25 17:26:13.000000000 +0300 @@ -7,13 +7,14 @@ secret=password host=dynamic callerid="ip phone" +canreinvite=no [202] type=friend secret=password host=dynamic callerid="softphone" - +canreinvite=no [dnepr] type=friend |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-10194.19610.6337 2010-05-25 17:30:00.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-05-25 17:30:42.000000000 +0300 @@ -1,6 +1,6 @@ [general] context=default -register=>kiev:password@192.168.1.1/dnepr +register=>kiev:password@192.168.1.1/dnepr-out [201] type=friend @@ -16,8 +16,14 @@ callerid="softphone" canreinvite=no -[dnepr] -type=friend +[dnepr-in] +type=user +secret=passowrd +host=dynamic +canreinvite=no + +[dnepr-out] +type=peer secret=passowrd host=dynamic canreinvite=no |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-10194.1385.10395 2010-05-25 17:32:21.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-05-25 17:32:27.000000000 +0300 @@ -18,7 +18,7 @@ [dnepr-in] type=user -secret=passowrd +secret=password host=dynamic canreinvite=no |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... 101/101 192.168.1.11 D 2048 Unmonitored 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 1 offline] linux1*CLI> sip reload Reloading SIP == Parsing '/etc/asterisk/sip.conf': Found == Parsing '/etc/asterisk/users.conf': Found == Parsing '/etc/asterisk/sip_notify.conf': Found [May 25 17:33:04] WARNING[12199]: chan_sip.c:12627 handle_response_register: Got 404 Not found on SIP register to service dnepr-in@192.168.2.1, giving up linux1*CLI> quit Executing last minute cleanups |
#exit
exit Connection to 192.168.1.1 closed. |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-10194.22905.3869 2010-05-25 17:33:44.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-05-25 17:33:50.000000000 +0300 @@ -1,6 +1,6 @@ [general] context=default -register=>kiev:password@192.168.1.1/dnepr-out +register=>kiev-in:password@192.168.1.1/dnepr-out [201] type=friend |