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

Содержание

Журнал

Вторник (04/22/14)

/dev/pts/0
12:59:50
#l3-agent

12:59:59
#l3pwd
/users/YOUR-L3BACKEND-USER/SET-YOUR-FIRSTLAB-NAME-HERE/debian6/root
13:00:30
#vim install
13:00:37
#nano install
--- /tmp/l3-saved-5159.6610.18550	2014-04-22 14:00:40.633807249 +0300
+++ install	2014-04-22 14:01:10.933806838 +0300
@@ -7,8 +7,8 @@
 #
 # Set this variables before installation:
 
-lilalo_user=${lilalo_user:-YOUR-L3BACKEND-USER}
-lab=${lab:-SET-YOUR-FIRSTLAB-NAME-HERE}
+lilalo_user=briksi4
+lab=NT-VOIP
 install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
 lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
 
/dev/pts/0
13:01:22
#l3pwd
/users/briksi4/NT-VOIP/debian6/root
13:01:24
#apt-cache asterisk
E: Invalid operation asterisk
прошло 18 минут
13:19:51
#apt-cache search asterisk
asterisk - Open Source Private Branch Exchange (PBX)
asterisk-config - Configuration files for Asterisk
asterisk-dahdi - DAHDI devices support for the Asterisk PBX
asterisk-dbg - Debugging symbols for Asterisk
asterisk-dev - Development files for Asterisk
asterisk-doc - Source code documentation for Asterisk
asterisk-mobile - Bluetooth phone support for the Asterisk PBX
asterisk-modules - loadable modules for the Asterisk PBX
asterisk-mp3 - MP3 playback support for the Asterisk PBX
asterisk-mysql - MySQL database protocol support for the Asterisk PBX
...
libopenr2-3 - MFC/R2 (telephony) call setup library
python-asterisk - Asterisk Manager API interface module for Python
libsipwitch-dev - secure peer-to-peer SIP VoIP server - development files
libsipwitch1 - secure peer-to-peer SIP VoIP server - development files
libsipwitch1-dbg - secure peer-to-peer SIP VoIP server - development files
sipwitch - secure peer-to-peer VoIP server for the SIP protocol
sipwitch-cgi - secure peer-to-peer SIP VoIP server - CGI XML-RPC interface
python-starpy - Asterisk (AMI) protocols for Twisted Python
asterisk-prompt-es - Spanish prompts for the Asterisk PBX
dahdi-firmware-nonfree - DAHDI non-free firmware
13:20:18
#apt-get install asterisk
Reading package lists... Done
Building dependency tree
Reading state information... Done
asterisk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
13:25:57
#apt-get install asterisk
Reading package lists... Done
Building dependency tree
Reading state information... Done
asterisk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
13:26:22
#apt-cash show asterisk
l3script: apt-cash: command not found
13:28:21
#apt-cash show asterisk
l3script: apt-cash: command not found
13:28:36
#dpkg -l asterisk
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  asterisk       1:1.8.13.1~d amd64        Open Source Private Branch Exchan
13:30:12
#dpkg -l asterisk | less
/dev/pts/2
13:37:41
#asterisk -rvvvvv
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 debian6 (pid = 2274)
Verbosity was 0 and is now 5
debian6*CLI> co
No such command 'co' (type 'core show help co' for other possible commands)
debian6*CLI> coreshowversion
No such command 'coreshowversion' (type 'core show help coreshowversion' for other possible commands)
debian6*CLI> core show version
Asterisk 1.8.13.1~dfsg1-3+deb7u3 built by pbuilder @ pungenday on a x86_64 running Linux on 2014-01-04 01:03:48 UTC
debian6*CLI> quit
Executing last minute cleanups
прошла 21 минута
13:59:09
#/etc/init.d/asterisk stop
Stopping Asterisk PBX: asterisk.
14:00:16
#/etc/init.d/asterisk start
Starting Asterisk PBX: asterisk.
14:00:23
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
14:00:38
#/etc/init.d/asterisk start
Asterisk PBX is already running. Use restart.
14:00:53
#mv /etc/asterisk/sip.conf{,.SAVED}

прошла 31 минута
14:32:34
#echo /etc/asterisk/sip.conf.SAVED
/etc/asterisk/sip.conf.SAVED
14:41:31
#context=default

прошло 25 минут
15:07:17
#apt-get install isc-dhcp-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  isc-dhcp-server-ldap
The following NEW packages will be installed:
  isc-dhcp-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 935 kB of archives.
After this operation, 2,075 kB of additional disk space will be used.
...
Preconfiguring packages ...
Selecting previously unselected package isc-dhcp-server.
(Reading database ... 128750 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...
[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!
 failed!
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
15:10:25
#vim /etc/d
15:10:25
#vim /etc/dhcp/dhcp.conf
15:11:10
#nano /etc/dhcp/dhcp.conf
прошло 11 минут
15:22:58
#dpkg -Lisc-dhcp-server | gerp /etc/
l3script: gerp: command not found
dpkg: error: conflicting actions -i (--install) and -L (--listfiles)
Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Options marked [*] produce a lot of output - pipe it through `less' or `more' !
15:23:03
#dpkg -L isc-dhcp-server | gerp /etc/
l3script: gerp: command not found
15:23:35
#dpkg -L isc-dhcp-server | grep /etc
/etc
/etc/init.d
/etc/init.d/isc-dhcp-server
/etc/dhcp
/etc/dhcp/dhcpd.conf
прошло 17 минут
15:40:36
#vim /etc/default/isc-dhcp-server
15:42:18
#Defaults for isc-dhcp-server initscript
l3script: nono: command not found
15:43:10
#nano /etc/bash.bashrc
--- /tmp/l3-saved-5972.14786.4581	2014-04-22 16:43:20.429676499 +0300
+++ /etc/bash.bashrc	2014-04-22 16:43:30.057676360 +0300
@@ -29,13 +29,13 @@
 #esac
 
 # enable bash completion in interactive shells
-#if ! shopt -oq posix; then
-#  if [ -f /usr/share/bash-completion/bash_completion ]; then
-#    . /usr/share/bash-completion/bash_completion
-#  elif [ -f /etc/bash_completion ]; then
-#    . /etc/bash_completion
-#  fi
-#fi
+if ! shopt -oq posix; then
+  if [ -f /usr/share/bash-completion/bash_completion ]; then
+    . /usr/share/bash-completion/bash_completion
+  elif [ -f /etc/bash_completion ]; then
+    . /etc/bash_completion
+  fi
+fi
 
 # if the command-not-found package is installed, use it
 if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
15:43:30
#System-wide .bashrc file for interactive bash(1) shells.
root@debian6:/home/user# exit
exit
15:43:34
#exit
exit
There are stopped jobs.
/dev/pts/2
15:43:39
#apt-get purge isc-dhcp-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  isc-dhcp-server*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 2,075 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 128764 files and directories currently installed.)
Removing isc-dhcp-server ...
[FAIL] Stopping ISC DHCP server: dhcpd failed!
Purging configuration files for isc-dhcp-server ...
Processing triggers for man-db ...
15:43:57
#apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  vim-runtime
Suggested packages:
  ctags vim-doc vim-scripts
The following NEW packages will be installed:
  vim vim-runtime
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
...
Setting up vim-runtime (2:7.3.547-7) ...
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.3.547-7) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
прошло 10 минут
15:54:20
#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 debian6 (pid = 6128)
Verbosity is at least 1
debian6*CLI> sip reload
...
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
debian6*CLI> sip reload
 Reloading SIP
debian6*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
2301/2301                  192.168.12.204                           D   N             5060     Unmonitored
2302                       (Unspecified)                            D   N             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
debian6*CLI> quit
Executing last minute cleanups
прошло 19 минут
16:13:45
#user
l3script: user: command not found
16:13:53
#nano /etc/asterisk/extensions.conf
--- /tmp/l3-saved-7871.21987.26411	2014-04-22 17:22:14.117645225 +0300
+++ /etc/asterisk/extensions.conf	2014-04-22 17:24:50.249643130 +0300
@@ -12,6 +12,8 @@
 ; The "General" category is for certain variables.
 ;
 [general]
+exten => 2301,1,Dial(SIP/2301)
+
 ;
 ; If static is set to no, or omitted, then the pbx_config will rewrite
 ; this file when extensions are modified.  Remember that all comments
прошло 18 минут
16:32:00
#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 debian6 (pid = 6128)
Verbosity is at least 3
debian6*CLI> dialplan show
...
[ Context 'dundi-e164-local' created by 'pbx_config' ]
  Include =>        'dundi-e164-canonical'                        [pbx_config]
  Include =>        'dundi-e164-customers'                        [pbx_config]
  Include =>        'dundi-e164-via-pstn'                         [pbx_config]
[ Context 'dundi-e164-via-pstn' created by 'pbx_config' ]
[ Context 'dundi-e164-customers' created by 'pbx_config' ]
[ Context 'dundi-e164-canonical' created by 'pbx_config' ]
-= 83 extensions (205 priorities) in 50 contexts. =-
debian6*CLI> quit
Executing last minute cleanups
16:32:42
#nano /etc/asterisk/extensions.conf
16:34:31
#nano /etc/asterisk/extensions.conf
16:36:42
#vim /etc/asterisk/extensions.conf
16:37:17
#mv /etc/asterisk/extensions.conf{,.default}

16:37:32
#vim /etc/asterisk/extensions.conf
16:46:26