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

Содержание

Журнал

Четверг (12/10/09)

/dev/pts/1
14:07:13
#vi /usr/local/bin/jabblog
--- /tmp/l3-saved-9764.25970.32193	2009-12-10 03:07:35.000000000 -1000
+++ /usr/local/bin/jabblog	2009-12-10 03:07:44.000000000 -1000
@@ -1,4 +1,4 @@
 #!/bin/sh
 read line
 echo $line > /tmp/log2
-echo test | sendxmpp igor@kiev.unix.nt
+echo test | sendxmpp -f /var/lib/asterisk/.sendxmpprc igor@kiev.unix.nt
14:07:44
#cat /tmp/log2

14:07:53
#rm /tmp/log2

14:07:55
#cat /tmp/log2
cat: /tmp/log2: No such file or directory
14:08:02
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3, 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 currently running on kiev (pid = 15302)
Verbosity is at least 3
kiev*CLI>
kiev*CLI>
kiev*CLI> quit
Executing last minute cleanups
14:09:27
#vim ../asterisk/sip.conf
14:10:31
#vim ../asterisk/sip.conf
--- /tmp/l3-saved-9764.26918.19753	2009-12-10 03:10:32.000000000 -1000
+++ ../asterisk/sip.conf	2009-12-10 03:10:53.000000000 -1000
@@ -17,6 +17,7 @@
 host=dynamic
 secret=203
 callerid="Roman Sidorenko-softPhone"
+context=white
 
 [204]
 type=friend
14:12:53
#cat /tmp/log
Zvonochki v studiyu: - - SIP/201-084fc3f0
14:13:04
#secret=1234
[default]
[internal]
exten => _2XX,1,Set(CALLERID(number)=5${CALLERID(number)})
"/etc/asterisk/extensions.conf" 60 lines, 1516 characters
exten => _2XX,n,Dial(SIP/${EXTEN})
exten => 221,1,Dial(ZAP/G1)
exten => 222,1,Answer
exten => 222,n,Festival('Vim  is a text editor that is upwards compatible to Vi.  It can be used to edit all kinds of plain texx
t.  It is especially useful  for  editing programs.')
exten => 202,1,Answer
...
[outbound]
"/etc/asterisk/extensions.conf" 60 lines, 1471 characters written
exten => _380XXXXXXXXX,1,Dial(SIP/vkiev/${EXTEN})
[inbound]
include => internal
[white]
include => internal
include => outbound
[black]
include => internal
14:13:31
#asterisk -rx 'dialplan reload'
Dialplan reloaded.
14:13:59
#cat /tmp/log
Zvonochki v studiyu: - - SIP/201-084fc3f0
14:14:03
#cat /usr/local/bin/jabblog
#!/bin/sh
read line
echo $line > /tmp/log2
echo test | sendxmpp -f /var/lib/asterisk/.sendxmpprc igor@kiev.unix.nt
14:14:22
#vi /usr/local/bin/jabblog
--- /tmp/l3-saved-9764.19203.13738	2009-12-10 03:14:28.000000000 -1000
+++ /usr/local/bin/jabblog	2009-12-10 03:14:31.000000000 -1000
@@ -1,4 +1,3 @@
 #!/bin/sh
-read line
 echo $line > /tmp/log2
 echo test | sendxmpp -f /var/lib/asterisk/.sendxmpprc igor@kiev.unix.nt
14:17:28
#~
;exten => 202,n,Playback(demo-congrats)
exten => 202,n,Hangup
[transPoltava]
include => outbound
[outbound]
exten => 4000,1,Dial(SIP/vkiev/${EXTEN}), 1471 characters
exten => _380XXXXXXXXX,1,Dial(SIP/vkiev/${EXTEN})
[inbound]
include => internal
[white]
include => internal
include => outbound
[black]
include => internal
14:17:45
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-9764.18745.30806	2009-12-10 03:17:58.000000000 -1000
+++ /etc/asterisk/extensions.conf	2009-12-10 03:18:22.000000000 -1000
@@ -11,7 +11,7 @@
 exten => 202,1,Answer
 exten => 202,n,Wait(1)
 ;exten => 202,n,System('echo Zvonochki v studiyu: ${DATETIME} - ${CALLERID(all)} - ${CHANNEL} | sendxmpp igor@kiev.unix.nt')
-exten => 202,n,System(echo Zvonochki v studiyu | /usr/local/bin/jabblog)
+exten => 202,n,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog)
 exten => 202,n,Playback(alba)
 ;exten => 202,n,Playback(demo-congrats)
 exten => 202,n,Hangup
прошло 16 минут
14:34:06
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-9764.8254.9000	2009-12-10 03:36:39.000000000 -1000
+++ /etc/asterisk/extensions.conf	2009-12-10 03:36:50.000000000 -1000
@@ -18,6 +18,7 @@
 
 [transPoltava]
 include => outbound
+include => internal
 
 [outbound]
 exten => 4000,1,Dial(SIP/vkiev/${EXTEN})
14:36:50
#asterisk -rx 'dialplan reload'
Dialplan reloaded.
14:36:52
#vi /usr/local/bin/jabblog
--- /tmp/l3-saved-9764.31622.21692	2009-12-10 03:39:33.000000000 -1000
+++ /usr/local/bin/jabblog	2009-12-10 03:46:59.000000000 -1000
@@ -1,2 +1,4 @@
 #!/bin/sh
-sendxmpp -f /var/lib/asterisk/.sendxmpprc igor@kiev.unix.nt
+JABBTABLE=/etc/asterisk/jabbtable
+jid=`grep "$1" $JABBTABLE | awk '{print $2}'`
+sendxmpp -f /var/lib/asterisk/.sendxmpprc $jid
прошло 10 минут
14:47:00
#~

14:47:00
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt
203 romchiko@obukhov.unix.nt
14:47:10
#cat /usr/local/bin/jabblog
#!/bin/sh
JABBTABLE=/etc/asterisk/jabbtable
jid=`grep "$1" $JABBTABLE | awk '{print $2}'`
sendxmpp -f /var/lib/asterisk/.sendxmpprc $jid
14:47:18
#vi /usr/local/bin/jabblog
--- /tmp/l3-saved-9764.25383.7355	2009-12-10 03:47:29.000000000 -1000
+++ /usr/local/bin/jabblog	2009-12-10 03:48:10.000000000 -1000
@@ -1,4 +1,5 @@
 #!/bin/sh
 JABBTABLE=/etc/asterisk/jabbtable
-jid=`grep "$1" $JABBTABLE | awk '{print $2}'`
-sendxmpp -f /var/lib/asterisk/.sendxmpprc $jid
+
+jid="`grep "$1" $JABBTABLE | awk '{print $2}'`"
+[ -z "$jid" ] || sendxmpp -f /var/lib/asterisk/.sendxmpprc "$jid"
14:48:10
#su - asterisk
asterisk@kiev:~$ echo proverka | jabblog 201
asterisk@kiev:~$ exit
logout
14:49:24
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-9764.8943.27905	2009-12-10 03:49:26.000000000 -1000
+++ /etc/asterisk/extensions.conf	2009-12-10 03:49:42.000000000 -1000
@@ -1,5 +1,10 @@
 [default]
 
+[macro-jabblog]
+exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog $1)
+exten => s,n,Dial(SIP/$1)
+
+
 [internal]
 ;exten => _2XX,1,Set(CALLERID(number)=5${CALLERID(number)})
 ;exten => _2XX,n,Dial(SIP/${EXTEN})
@@ -18,9 +23,6 @@
 exten => 202,n,Hangup
 
 
-[jabblog]
-exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog $1)
-exten => s,n,Dial(SIP/$1)
 
 [transPoltava]
 include => outbound
14:49:45
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3, 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
=========================================================================
...
    -- Executing [201@transPoltava:1] Macro("SIP/kiev-082f8420", "jabblog|201") in new stack
    -- Executing [s@macro-jabblog:1] System("SIP/kiev-082f8420", "echo Zvonochki v studiyu ""gib-snom" <101>" | /usr/local/bin/jabblog $1") in new stack
    -- Executing [s@macro-jabblog:2] Dial("SIP/kiev-082f8420", "SIP/$1") in new stack
[Dec 10 03:49:50] WARNING[16258]: chan_sip.c:2921 create_addr: No such host: $1
[Dec 10 03:49:50] WARNING[16258]: app_dial.c:1202 dial_exec_full: Unable to create channel of type 'SIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1)
  == Auto fallthrough, channel 'SIP/kiev-082f8420' status is 'CHANUNAVAIL'
[Dec 10 03:49:52] NOTICE[15328]: chan_sip.c:14035 handle_request_invite: Call from '' to extension '201' rejected because extension not found.
kiev*CLI> quit
Executing last minute cleanups
14:51:22
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3, 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
=========================================================================
...
    -- Executing [221@transPoltava:1] Dial("SIP/kiev-082e6b18", "ZAP/G1") in new stack
    -- Called G1
    -- Zap/1-1 is ringing
    -- Zap/1-1 is ringing
    -- Zap/1-1 is ringing
    -- Hungup 'Zap/1-1'
  == Spawn extension (transPoltava, 221, 1) exited non-zero on 'SIP/kiev-082e6b18'
kiev*CLI>
kiev*CLI> quit
Executing last minute cleanups
14:52:18
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-9764.4944.22754	2009-12-10 03:52:19.000000000 -1000
+++ /etc/asterisk/extensions.conf	2009-12-10 03:53:22.000000000 -1000
@@ -4,13 +4,18 @@
 exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
 exten => s,n,Dial(SIP/${ARG1})
 
+[macro-jabblog-zap]
+exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
+exten => s,n,Dial(ZAP/G1)
+
 
 [internal]
 ;exten => _2XX,1,Set(CALLERID(number)=5${CALLERID(number)})
 ;exten => _2XX,n,Dial(SIP/${EXTEN})
 exten => _2XX,1,Macro(jabblog,${EXTEN})
 
-exten => 221,1,Dial(ZAP/G1)
+exten => 221,1,Macro(jabblog-zap,${EXTEN})
+
 exten => 222,1,Answer
 exten => 222,n,Festival('Vim  is a text editor that is upwards compatible to Vi.  It can be used to edit all kinds of plain text.  It is especially useful  for  editing programs.')
 
14:53:28
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3, 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 currently running on kiev (pid = 15302)
Verbosity is at least 3
    -- Zap/1-1 is ringing
    -- Zap/1-1 is ringing
    -- Hungup 'Zap/1-1'
  == Spawn extension (macro-jabblog-zap, s, 2) exited non-zero on 'SIP/kiev-082f3050' in macro 'jabblog-zap'
  == Spawn extension (macro-jabblog-zap, s, 2) exited non-zero on 'SIP/kiev-082f3050'
kiev*CLI>
kiev*CLI> quit
Executing last minute cleanups
14:53:52
#vi /etc/asterisk/extensions.conf
14:53:55
#include => internal
221 romchiko@obukhov.unix.nt
~
203 romchiko@obukhov.unix.nt
~
~
~
~
~
~
~
...
~
~
~
~
~
~
~
~
~
"/etc/asterisk/jabbtable" 3 lines, 80 characters written
14:57:45
#cat /usr/local/bin/jabblog
#!/bin/sh
JABBTABLE=/etc/asterisk/jabbtable
jid="`grep "$1" $JABBTABLE | awk '{print $2}'`"
[ -z "$jid" ] || sendxmpp -f /var/lib/asterisk/.sendxmpprc "$jid"
14:57:51
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt
203 romchiko@obukhov.unix.nt
221 romchiko@obukhov.unix.nt
15:03:36
#vi /etc/asterisk/extensions.conf
/dev/pts/12
15:04:13
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt
203 romchiko@obukhov.unix.nt
221 gib@poltava.unix.nt
15:04:27
#cat /usr/local/bin/jabblog
#!/bin/sh
JABBTABLE=/etc/asterisk/jabbtable
jid="`grep "$1" $JABBTABLE | awk '{print $2}'`"
[ -z "$jid" ] || sendxmpp -f /var/lib/asterisk/.sendxmpprc "$jid"
15:04:36
#cd /etc/asterisk/

15:07:04
#vim extensions.conf
прошло 11 минут
15:18:33
#exten => 222,n,Festival('Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text.
#!/bin/sh
JABBTABLE=/etc/asterisk/jabbtable
jid="`grep "$1" $JABBTABLE | awk '{print $2}'`"
[ -z "$jid" ] || sendxmpp -f /var/lib/asterisk/.sendxmpprc "$jid"
/dev/pts/1
15:22:52
#{CALLERID(all)
#!/bin/sh
JABBTABLE=/etc/asterisk/jabbtable
jid="`grep "$1" $JABBTABLE | awk '{print $2}'`"
[ -z "$jid" ] || sendxmpp -f /var/lib/asterisk/.sendxmpprc "$jid"
15:22:59
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt
203 romchiko@obukhov.unix.nt
221 gib@poltava.unix.nt
15:28:06
#cat /etc/asterisk/extensions.conf
[default]
[macro-jabblog]
exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
exten => s,n,Dial(SIP/${ARG1})
[macro-jabblog-zap]
exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
exten => s,n,Dial(ZAP/G1)
[internal]
;exten => _2XX,1,Set(CALLERID(number)=5${CALLERID(number)})
;exten => _2XX,n,Dial(SIP/${EXTEN})
...
exten => _3XX,1,Dial(SIP/poltava/${EXTEN})
exten => 999,1,Answer
exten => 999,n,Echo
exten => 999,n,Hangup
exten => 291,1,Dial(SIP/201,10)
exten => 291,n,Dial(SIP/vkiev/380674074085,10)
exten => 291,n,Hangup
;exten => 291,n,Wait(1)
;exten => 291,n,Playback(alba)
;exten => 291,n,Playback(demo-congrats)
15:30:11
#cat /etc/asterisk/extensions.conf | less
15:34:36
#su - asterisk
asterisk@kiev:~$ exit
logout
15:34:40
#su - user
l3-agent is already running: pid=12797; pidfile=/home/user/.lilalo/l3-agent.pid
user@kiev:~$
user@kiev:~$
user@kiev:~$ mail
No mail for user
user@kiev:~$ quit
-su: quit: command not found
user@kiev:~$ exit
logout
15:34:48
#mail
No mail for root
15:41:56
#mail
No mail for root
15:41:56
#su - user
l3-agent is already running: pid=12797; pidfile=/home/user/.lilalo/l3-agent.pid
user@kiev:~$ mail
No mail for user
user@kiev:~$ й
-su: й: command not found
user@kiev:~$ q
-su: q: command not found
user@kiev:~$ logout
15:42:03
#su - user
l3-agent is already running: pid=12797; pidfile=/home/user/.lilalo/l3-agent.pid
user@kiev:~$ Ðmail
No mail for user
user@kiev:~$ exit
logout
15:42:50
#mail
No mail for root
15:42:52
#vi /etc/asterisk/extensions.conf
15:45:52
#include => internal

15:46:00
#mail
No mail for root
15:46:33
#mail
No mail for root
15:46:34
#su - user
l3-agent is already running: pid=12797; pidfile=/home/user/.lilalo/l3-agent.pid
user@kiev:~$ mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/user": 1 message 1 new
>N  1 root@poltava.unix  Thu Dec 10 04:46   19/775   test
& q
Held 1 message in /var/mail/user
user@kiev:~$ exit
logout
15:46:42
#su - user
l3-agent is already running: pid=12797; pidfile=/home/user/.lilalo/l3-agent.pid
user@kiev:~$ mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/user": 2 messages 1 new 2 unread
 U  1 root@poltava.unix  Thu Dec 10 04:46   20/785   test
>N  2 root@poltava.unix  Thu Dec 10 04:47   19/768
& t 2
Message 2:
From root@poltava.unix.nt  Thu Dec 10 04:47:03 2009
Date: Thu, 10 Dec 2009 04:46:44 -1000
...
Subject: test
test
& q
Saved 1 message in /home/user/mbox
user@kiev:~$
user@kiev:~$
user@kiev:~$ mail
No mail for user
user@kiev:~$ exit
logout
прошло 37 минут
16:24:30
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-9764.10339.3984	2009-12-10 05:24:33.000000000 -1000
+++ /etc/asterisk/extensions.conf	2009-12-10 05:24:56.000000000 -1000
@@ -28,6 +28,7 @@
 ;exten => 202,n,Playback(demo-congrats)
 exten => 202,n,Hangup
 
+exten => 300,1,MeetMe()
 
 
 [transPoltava]
16:25:11
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3, 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 currently running on kiev (pid = 15302)
Verbosity is at least 3
[Dec 10 05:25:15] NOTICE[15328]: chan_sip.c:14035 handle_request_invite: Call from '201' to extension '301' rejected because extension not found.
    -- Executing [300@black:1] MeetMe("SIP/201-082f1ac0", "") in new stack
    -- <SIP/201-082f1ac0> Playing 'conf-getconfno' (language 'en')
  == Spawn extension (black, 300, 1) exited non-zero on 'SIP/201-082f1ac0'
kiev*CLI> quit
Executing last minute cleanups
/dev/pts/12
16:26:54
#cat

прошло 15 минут
/dev/pts/1
16:42:38
#vi /etc/asterisk/musiconhold.conf
16:42:55
#:q!
; sound adjustments are available. If the file is available in
; the same format as the channel's codec, then it will be played
; without transcoding (same as Playback would do in the dialplan).
; Files can be present in as many formats as you wish, and the
; 'best' format will be chosen at playback time.
;
; NOTE:
; If you are not using "autoload" in modules.conf, then you
; must ensure that the format modules for any formats you wish
; to use are loaded _before_ res_musiconhold. If you do not do
...
; must ensure that the format modules for any formats you wish
;[manual]
;mode=custom
; Note that with mode=custom, a directory is not required, such as when reading
; from a stream.
;directory=/var/lib/asterisk/mohmp3
;application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s
;[ulawstream]
;mode=custom
;application=/usr/bin/streamplayer 192.168.100.52 888
прошло 15 минут
/dev/pts/5
16:58:33
#cd /etc/asterisk/

16:58:40
#vim extensions.conf
--- /tmp/l3-saved-17310.6616.11824	2009-12-10 05:58:49.000000000 -1000
+++ extensions.conf	2009-12-10 06:02:05.000000000 -1000
@@ -29,6 +29,7 @@
 exten => 202,n,Hangup
 
 exten => 300,1,MeetMe(1)
+exten => _3XX,1,Dial(SIP/obukhov/${EXTEN})
 
 
 [transPoltava]

Пятница (12/11/09)

/dev/pts/7
08:56:43
#screen -x
/dev/pts/3
08:59:03
#screen -x
/dev/pts/7
08:59:03
#screen -x
/dev/pts/1
08:59:17
#screen -x
08:59:26
#screen -x
09:08:50
#screen -x
/dev/pts/3
09:09:08
#screen -x
/dev/pts/3
09:09:33
#screen -x
09:09:35
#screen
/dev/pts/9
09:09:38
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-19226.18261.9890	2009-12-10 22:10:10.000000000 -1000
+++ /etc/asterisk/extensions.conf	2009-12-10 22:11:07.000000000 -1000
@@ -2,7 +2,8 @@
 
 [macro-jabblog]
 exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
-exten => s,n,Dial(SIP/${ARG1})
+exten => s,n,Dial(SIP/${ARG1},10)
+exten => s,n,VoiceMail(${ARG1}@default)
 
 [macro-jabblog-zap]
 exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
09:11:07
#vi /etc/asterisk/voicemail.conf
--- /tmp/l3-saved-19226.17807.10290	2009-12-10 22:11:21.000000000 -1000
+++ /etc/asterisk/voicemail.conf	2009-12-10 22:13:27.000000000 -1000
@@ -229,7 +229,7 @@
 ; Define maximum number of messages per folder for a particular context.
 ;maxmsg=50
 
-1234 => 4242,Example Mailbox,root@localhost
+201 => 4242,Example Mailbox,root@localhost
 ;4200 => 9855,Mark Spencer,markster@linux-support.net,mypager@digium.com,attach=no|serveremail=myaddy@digium.com|tz=central|maxmsg=10
 ;4300 => 3456,Ben Rigas,ben@american-computer.net
 ;4310 => -5432,Sales,sales@marko.net
09:13:27
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
09:14:32
#su - user
l3-agent is already running: pid=12797; pidfile=/home/user/.lilalo/l3-agent.pid
user@kiev:~$ mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/user": 1 message 1 new
>N  1 asterisk@kiev.uni  Thu Dec 10 22:14  621/43723 [PBX]: New message 1 in mailbox 201
& t 1
Message 1:
From asterisk@kiev.unix.nt  Thu Dec 10 22:14:23 2009
Date: Thu, 10 Dec 2009 22:14:23 -1000
From: Asterisk PBX <asterisk@kiev.unix.nt>
...
Content-Disposition: attachment; filename="msg0001.WAV"
UklGRhR6AABXQVZFZm10IBQAAAAxAAEAQB8AAFkGAABBAAAAAgBAAWZhY3QEAAAAAFgCAGRh
dGHgeQAAoesaKokCQeUopl5yU+FSLKtbGaxg4R6a6a7NgI5FcgwJupGlkswaSI1k0XWqFCZS
ZAmKxRLycromS7wU1nKkykhiG1XmKM3gywzFVkyroOwmdqoOT4HRTEpN9cuguDOcYSuiUqWy
MRU4Umu2drcI1BbssjixDM5BXUdd9RCqmcNcbSErU+46leCESRYkOy5BVCvMpcYuoWurWIxl
rYBypVOEObp24Yq/DNZVDS0OTyH4TVNJVu0ItHXrJjbcGKauVXgqoUpV7hiLwVO7rBaobKEa
& q
Saved 1 message in /home/user/mbox
user@kiev:~$ exit
logout
09:17:59
#asterisk -rvvv
Asterisk 1.4.21.2~dfsg-3, 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 currently running on kiev (pid = 19464)
Verbosity was 0 and is now 3
kiev*CLI>
kiev*CLI>
    -- Starting simple switch on 'Zap/1-1'
kiev*CLI> quit
Executing last minute cleanups
09:19:09
#vi /etc/asterisk/voicemail.conf
прошло 109 минут
/dev/pts/3
11:08:56
#screen -x
/dev/pts/9
11:09:01
## http://www.youtube.com/verify_age?&next_url=/watch%3Fv%3DTkjrKfiBdmg%26fmt%3D18

прошло >2 часов
13:22:18
#vi /etc/asterisk/sip.conf
прошло 16 минут
13:39:06
#ssh root@192.168.102.2
The authenticity of host '192.168.102.2 (192.168.102.2)' can't be established.
RSA key fingerprint is 0b:40:eb:0f:f1:0c:12:1d:16:16:68:c6:5f:3b:49:73.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.102.2' (RSA) to the list of known hosts.
root@192.168.102.2's password:
Linux debian2 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Dec 10 16:24:13 2009 from 192.168.7.101
l3-agent is already running: pid=2561; pidfile=/root/.lilalo/l3-agent.pid
13:40:18
#asterisk -rvv
Asterisk 1.4.21.2~dfsg-3, 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
=========================================================================
...
Overlap Dial: 0
T200 Timer: 1000
T203 Timer: 10000
T305 Timer: 30000
T308 Timer: 4000
T309 Timer: -1
T313 Timer: 4000
N200 Counter: 3
obukhov*CLI> quit
Executing last minute cleanups
13:41:21
#vi /etc/asterisk/zapata.conf
13:41:41
#; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
span=1,0,0,ccs,hdb3,crc4
bchan=1-15
dchan=16
bchan=17-31
13:42:27
#ssh root@192.168.102.2
root@192.168.102.2's password:
Linux obukhov.unix.nt 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Dec 11 14:39:10 2009 from 192.168.102.1
Removing stale pidfile
13:44:37
#asterisk -rv
Asterisk 1.4.21.2~dfsg-3, 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
=========================================================================
...
    -- Hungup 'Zap/1-1'
  == Everyone is busy/congested at this time (1:0/0/1)
  == Auto fallthrough, channel 'SIP/301-08c75dd8' status is 'CHANUNAVAIL'
[Dec 11 14:48:36] NOTICE[2376]: chan_zap.c:9024 pri_dchannel: PRI got event: HDLC Abort (6) on Primary D-channel of span 1
  == Primary D-Channel on span 1 up
obukhov*CLI>
obukhov*CLI>
obukhov*CLI>
obukhov*CLI> quit
Executing last minute cleanups
13:48:41
#vi /etc/asterisk/extensions.conf
13:54:59
#asterisk -rv
Asterisk 1.4.21.2~dfsg-3, 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
=========================================================================
...
[Dec 11 14:58:55] WARNING[2376]: chan_zap.c:2498 pri_find_dchan: No D-channels available!  Using Primary channel 16 as D-channel anyway!
[Dec 11 14:59:00] WARNING[2376]: chan_zap.c:2498 pri_find_dchan: No D-channels available!  Using Primary channel 16 as D-channel anyway!
[Dec 11 14:59:05] WARNING[2376]: chan_zap.c:2498 pri_find_dchan: No D-channels available!  Using Primary channel 16 as D-channel anyway!
obukhov*CLI>
obukhov*CLI>
[Dec 11 14:59:10] WARNING[2376]: chan_zap.c:2498 pri_find_dchan: No D-channels available!  Using Primary channel 16 as D-channel anyway!
obukhov*CLI> quir
No such command 'quir' (type 'help quir' for other possible commands)
obukhov*CLI> quit
Executing last minute cleanups
13:58:59
#vi /etc/asterisk/extensions.conf
13:59:13
#exit
exit
Connection to 192.168.102.2 closed.
13:59:16
#ssh root@192.168.101.3
root@192.168.101.3's password:
Linux poltava.unix.nt 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Dec 11 02:42:55 2009
l3-agent is already running: pid=2466; pidfile=/root/.lilalo/l3-agent.pid
13:59:55
#vi /etc/zaptel.conf
14:01:18
#/etc/init.d/asterisk stop
Stopping Asterisk PBX: asterisk.
14:01:23
#/etc/init.d/zaptel restart
Zaptel telephony kernel driver: zaptel.
14:01:27
#/etc/init.d/asterisk start
Starting Asterisk PBX: asterisk.
14:03:54
#exit
exit
Connection to 192.168.101.3 closed.
14:04:20
#ssh root@192.168.102.2
root@192.168.102.2's password:
Linux obukhov.unix.nt 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Dec 11 14:44:07 2009
l3-agent is already running: pid=2529; pidfile=/root/.lilalo/l3-agent.pid
14:04:21
#tail /var/log/messages
Dec 11 14:43:26 obukhov kernel: [   13.656210] loop: module loaded
Dec 11 14:43:26 obukhov kernel: [   14.318105] atl1 0000:02:00.0: eth0 link is up 100 Mbps full duplex
Dec 11 14:43:26 obukhov kernel: [   14.743643] NET: Registered protocol family 10
Dec 11 14:43:26 obukhov kernel: [   14.743643] lo: Disabled Privacy Extensions
Dec 11 14:43:27 obukhov kernel: [   16.944578] wcte12xp: Span configured for CCS/HDB3/CRC4
Dec 11 14:43:29 obukhov lpd[2303]: restarted
Dec 11 14:44:18 obukhov kernel: [   79.199072] [drm] Initialized drm 1.1.0 20060810
Dec 11 14:44:18 obukhov kernel: [   79.203072] ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
Dec 11 14:44:18 obukhov kernel: [   79.203072] [drm] Initialized i915 1.6.0 20060119 on minor 0
Dec 11 14:56:56 obukhov kernel: [ 1001.454735] wcte12xp: Setting yellow alarm
14:04:25
#tail /var/log/messages
Dec 11 14:43:26 obukhov kernel: [   13.656210] loop: module loaded
Dec 11 14:43:26 obukhov kernel: [   14.318105] atl1 0000:02:00.0: eth0 link is up 100 Mbps full duplex
Dec 11 14:43:26 obukhov kernel: [   14.743643] NET: Registered protocol family 10
Dec 11 14:43:26 obukhov kernel: [   14.743643] lo: Disabled Privacy Extensions
Dec 11 14:43:27 obukhov kernel: [   16.944578] wcte12xp: Span configured for CCS/HDB3/CRC4
Dec 11 14:43:29 obukhov lpd[2303]: restarted
Dec 11 14:44:18 obukhov kernel: [   79.199072] [drm] Initialized drm 1.1.0 20060810
Dec 11 14:44:18 obukhov kernel: [   79.203072] ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
Dec 11 14:44:18 obukhov kernel: [   79.203072] [drm] Initialized i915 1.6.0 20060119 on minor 0
Dec 11 14:56:56 obukhov kernel: [ 1001.454735] wcte12xp: Setting yellow alarm
14:04:31
#less /var/log/asterisk/
14:04:31
#less /var/log/asterisk/messages

Файлы

  • /etc/asterisk/extensions.conf
  • /etc/asterisk/jabbtable
  • /tmp/log
  • /tmp/log2
  • /usr/local/bin/jabblog
  • /etc/asterisk/extensions.conf
    >
    [default]
    [macro-jabblog]
    exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
    exten => s,n,Dial(SIP/${ARG1})
    [macro-jabblog-zap]
    exten => s,1,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${ARG1})
    exten => s,n,Dial(ZAP/G1)
    [internal]
    ;exten => _2XX,1,Set(CALLERID(number)=5${CALLERID(number)})
    ;exten => _2XX,n,Dial(SIP/${EXTEN})
    exten => _2XX,1,Macro(jabblog,${EXTEN})
    exten => 221,1,Macro(jabblog-zap,${EXTEN})
    exten => 222,1,Answer
    exten => 222,n,Festival('Vim  is a text editor that is upwards compatible to Vi.  It can be used to edit all kinds of plain text.  It is especially useful  for  editing programs.')
    exten => 202,1,Answer
    exten => 202,n,Wait(1)
    ;exten => 202,n,System(echo Zvonochki v studiyu: " ${STRFTIME(${EPOCH},,%d/\%m/\%Y-%H:%M:%S)} - ${CALLERID(all)} - ${CHANNEL} "| sendxmpp -f /var/lib/asterisk/.sendxmpprc igor@kiev.unix.nt)
    exten => 202,n,System(echo Zvonochki v studiyu "${CALLERID(all)}" | /usr/local/bin/jabblog ${EXTEN})
    exten => 202,n,Playback(alba)
    ;exten => 202,n,Playback(demo-congrats)
    exten => 202,n,Hangup
    [transPoltava]
    include => outbound
    include => internal
    [outbound]
    exten => 4000,1,Dial(SIP/vkiev/${EXTEN})
    exten => _380XXXXXXXXX,1,Dial(SIP/vkiev/${EXTEN})
    [inbound]
    include => internal
    [white]
    include => internal
    include => outbound
    [black]
    include => internal
    [nechto]
    exten => s,1,Answer
    exten => s,n,Wait(1)
    exten => s,n,Background(alba)
    exten => _1XX,1,Dial(SIP/poltava/${EXTEN})
    ;exten => _1XX,1,Dial(IAX2/poltava/${EXTEN})
    ;exten => _3XX,1,Set(CALLERID(number)=${CALLERID(number)})
    exten => _3XX,1,Dial(SIP/poltava/${EXTEN})
    exten => 999,1,Answer
    exten => 999,n,Echo
    exten => 999,n,Hangup
    exten => 291,1,Dial(SIP/201,10)
    exten => 291,n,Dial(SIP/vkiev/380674074085,10)
    exten => 291,n,Hangup
    ;exten => 291,n,Wait(1)
    ;exten => 291,n,Playback(alba)
    ;exten => 291,n,Playback(demo-congrats)
    
    /etc/asterisk/jabbtable
    >
    201 igor@kiev.unix.nt
    203 romchiko@obukhov.unix.nt
    221 gib@poltava.unix.nt
    
    /tmp/log
    >
    Zvonochki v studiyu: - - SIP/201-084fc3f0
    
    /tmp/log2
    >
    /usr/local/bin/jabblog
    >
    #!/bin/sh
    JABBTABLE=/etc/asterisk/jabbtable
    jid="`grep "$1" $JABBTABLE | awk '{print $2}'`"
    [ -z "$jid" ] || sendxmpp -f /var/lib/asterisk/.sendxmpprc "$jid"
    

    Статистика

    Время первой команды журнала14:07:13 2009-12-10
    Время последней команды журнала14:04:31 2009-12-11
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %13.86
    Процент синтаксически неверно набранных команд, % 1.98
    Суммарное время работы с терминалом *, час 3.31
    Количество командных строк в единицу времени, команда/мин 0.51
    Частота использования команд
    vi21|===================| 19.63%
    cat15|==============| 14.02%
    asterisk11|==========| 10.28%
    screen10|=========| 9.35%
    su8|=======| 7.48%
    mail5|====| 4.67%
    vim4|===| 3.74%
    ssh4|===| 3.74%
    /etc/init.d/asterisk3|==| 2.80%
    less3|==| 2.80%
    cd2|=| 1.87%
    internal2|=| 1.87%
    tail2|=| 1.87%
    ~2|=| 1.87%
    exit2|=| 1.87%
    include2|=| 1.87%
    /etc/init.d/zaptel1|| 0.93%
    #1|| 0.93%
    :q!1|| 0.93%
    secret=12341|| 0.93%
    222,n,Festival('Vim1|| 0.93%
    rm1|| 0.93%
    {CALLERID(all)1|| 0.93%
    Max1|| 0.93%
    watch%3Fv%3DTkjrKfiBdmg%26fmt%3D181|| 0.93%
    exten1|| 0.93%
    jbmaxsize1|| 0.93%
    ____
    *) Интервалы неактивности длительностью 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$