/l3/users/roman-sidorenko/asterisk/debian4/root :1 :2 :3 :4 :5 :6 :7 |
|
#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 |
#cat /tmp/log2
|
#rm /tmp/log2
|
#cat /tmp/log2
cat: /tmp/log2: No such file or directory |
#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 |
#vim ../asterisk/sip.conf
|
#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 |
#cat /tmp/log
Zvonochki v studiyu: - - SIP/201-084fc3f0 |
#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 |
#asterisk -rx 'dialplan reload'
Dialplan reloaded. |
#cat /tmp/log
Zvonochki v studiyu: - - SIP/201-084fc3f0 |
#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 |
#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 |
#~
;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 |
#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 |
#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}) |
#asterisk -rx 'dialplan reload'
Dialplan reloaded. |
#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 |
#~
|
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt 203 romchiko@obukhov.unix.nt |
#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 |
#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" |
#su - asterisk
asterisk@kiev:~$ echo proverka | jabblog 201 asterisk@kiev:~$ exit logout |
#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 |
#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 |
#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 |
#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.') |
#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 |
#vi /etc/asterisk/extensions.conf
|
#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" |
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt 203 romchiko@obukhov.unix.nt 221 romchiko@obukhov.unix.nt |
#vi /etc/asterisk/extensions.conf
|
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt 203 romchiko@obukhov.unix.nt 221 gib@poltava.unix.nt |
#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" |
#cd /etc/asterisk/
|
#vim extensions.conf
|
#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" |
#{CALLERID(all)
#!/bin/sh JABBTABLE=/etc/asterisk/jabbtable jid="`grep "$1" $JABBTABLE | awk '{print $2}'`" [ -z "$jid" ] || sendxmpp -f /var/lib/asterisk/.sendxmpprc "$jid" |
#cat /etc/asterisk/jabbtable
201 igor@kiev.unix.nt 203 romchiko@obukhov.unix.nt 221 gib@poltava.unix.nt |
#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) |
#cat /etc/asterisk/extensions.conf | less
|
#su - asterisk
asterisk@kiev:~$ exit logout |
#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 |
#mail
No mail for root |
#mail
No mail for root |
#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 |
#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 |
#mail
No mail for root |
#vi /etc/asterisk/extensions.conf
|
#include => internal
|
#mail
No mail for root |
#mail
No mail for root |
#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 |
#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 |
#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] |
#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 |
#: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 |
#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] |
#screen -x
|
#screen -x
|
#screen
|
#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}) |
#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 |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#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 |
#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 |
#vi /etc/asterisk/voicemail.conf
|
## http://www.youtube.com/verify_age?&next_url=/watch%3Fv%3DTkjrKfiBdmg%26fmt%3D18
|
#vi /etc/asterisk/sip.conf
|
#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 |
#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 |
#vi /etc/asterisk/zapata.conf
|
#; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
span=1,0,0,ccs,hdb3,crc4 bchan=1-15 dchan=16 bchan=17-31 |
#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 |
#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 |
#vi /etc/asterisk/extensions.conf
|
#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 |
#vi /etc/asterisk/extensions.conf
|
#exit
exit Connection to 192.168.102.2 closed. |
#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 |
#vi /etc/zaptel.conf
|
#/etc/init.d/asterisk stop
Stopping Asterisk PBX: asterisk. |
#/etc/init.d/zaptel restart
Zaptel telephony kernel driver: zaptel. |
#/etc/init.d/asterisk start
Starting Asterisk PBX: asterisk. |
#exit
exit Connection to 192.168.101.3 closed. |
#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 |
#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 |
#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 |
#less /var/log/asterisk/
|
#less /var/log/asterisk/messages
|
[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)
201 igor@kiev.unix.nt 203 romchiko@obukhov.unix.nt 221 gib@poltava.unix.nt
Zvonochki v studiyu: - - SIP/201-084fc3f0
#!/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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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