/l3/users/2014-11-nt-voip/nt-voip/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 |
|
#all "asterisk -rx 'sip show peers'" | grep 02/.*192 | awk '{print $1}' | tr -d :
1 3 4 5 6 7 |
#_ +1 +4
+1 +4 |
#_ +5
+5 |
#vim /etc/asterisk/extensions.conf
--- /dev/null 2014-11-24 01:42:46.270560796 -0500 +++ /etc/asterisk/extensions.conf 2014-11-24 11:06:12.768871522 -0500 @@ -0,0 +1,5 @@ + +[general] + +exten => _11XX,1,Dial(${EXTEN}) + |
#cat /etc/asterisk/extensions.conf
[general] exten => _11XX,1,Dial(${EXTEN}) |
#grep default /etc/asterisk/sip.conf
context=default |
#asterisk -rvv
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 debian0 (pid = 17209) ... ael-trunklocal ael-trunktollfree app_dial_gosub_virtual_context app_queue_gosub_virtual_context chanvar demo globals local parkedcalls default debian0*CLI> dialplan show default [ Context 'default' created by 'pbx_config' ] '_11XX' => 1. Dial(SIP/${EXTEN}) [pbx_config] -= 1 extension (1 priority) in 1 context. =- debian0*CLI> quit Executing last minute cleanups |
#all "asterisk -rx 'sip show peers'" | grep 02/.*192 | awk '{print $1}' | tr -d :
1 3 4 5 6 7 |
#sterisk -rvv
|
#sterisk -rvv
|
#sterisk -rvv
|
#_ +6 +7 +8
|
#sterisk -rvv
|
#sterisk -rvv
: ll "asterisk -rx 'dialplan show default'" | grep SIP/ | awk '{print $1}' | tr -d 6 7 8 |
#ÑÐall cat /etc/default/extensions.conf
1: cat: /etc/default/extensions.conf: No such file or directory 2: cat: /etc/default/extensions.conf: No such file or directory 3: cat: /etc/default/extensions.conf: No such file or directory 4: cat: /etc/default/extensions.conf: No such file or directory 5: cat: /etc/default/extensions.conf: No such file or directory 6: cat: /etc/default/extensions.conf: No such file or directory 7: cat: /etc/default/extensions.conf: No such file or directory 8: cat: /etc/default/extensions.conf: No such file or directory |
#all cat /etc/asterisk/extensions.conf
1: cat: /etc/asterisk/extensions.conf: No such file or directory 2: cat: /etc/asterisk/extensions.conf: No such file or directory 3: aasd 4: cat: /etc/asterisk/extensions.conf: No such file or directory 5: cat: /etc/asterisk/extensions.conf: No such file or directory 6: [default] 6: 6: exten => _23XX,1,Dial(SIP/${EXTEN}) 7: [default] 7: 7: exten => _31XX,1,Dial(SIP/${EXTEN}) 8: [default] 8: 8: exten => _32XX,1,Dial(SIP/${EXTEN}) 8: |
#cat /etc/asterisk/extensions.conf
[default] exten => _11XX,1,Dial(SIP/${EXTEN}) |
#cat /etc/asterisk/extensions.conf
[default] exten => _11XX,1,Dial(SIP/${EXTEN}) |
#all cat /etc/asterisk/extensions.conf
1: [default] 1: 1: exten => _11XX,1,Dial(SIP/${EXTEN}) 2: cat: /etc/asterisk/extensions.conf: No such file or directory 3: exten => _13XX,1,Dial(SIP/${EXTEN}) 4: cat: /etc/asterisk/extensions.conf: No such file or directory 5: cat: /etc/asterisk/extensions.conf: No such file or directory 6: [default] 6: 6: exten => _23XX,1,Dial(SIP/${EXTEN}) 7: [default] 7: 7: exten => _31XX,1,Dial(SIP/${EXTEN}) 8: [default] 8: 8: exten => _32XX,1,Dial(SIP/${EXTEN}) 8: |
#all cat /etc/asterisk/extensions.conf
1: [default] 1: 1: exten => _11XX,1,Dial(SIP/${EXTEN}) 2: cat: /etc/asterisk/extensions.conf: No such file or directory 3: [default] 3: 3: 3: exten => _13XX,1,Dial(SIP/${EXTEN}) 4: cat: /etc/asterisk/extensions.conf: No such file or directory 5: cat: /etc/asterisk/extensions.conf: No such file or directory 6: [default] 6: 6: exten => _23XX,1,Dial(SIP/${EXTEN}) 7: [default] 7: 7: exten => _31XX,1,Dial(SIP/${EXTEN}) 8: [default] 8: 8: exten => _32XX,1,Dial(SIP/${EXTEN}) 8: |
#_ +1
+1 |
#cat /etc/asterisk/extensions.conf
|
#_ +1
|
#_ +1
2 +2 |
#_ +3
+3 |
#_ +5
+5 |
##cat /etc/default/isc-dhcp-server
|
#all cat /etc/asterisk/extensions.conf
1: [default] 1: 1: exten => _11XX,1,Dial(SIP/${EXTEN}) 2: [default] 2: 2: exten => _12XX,1,Dial(SIP/${EXTEN}) 3: [default] 3: 3: 3: exten => _13XX,1,Dial(SIP/${EXTEN}) ... 6: [default] 6: 6: exten => _23XX,1,Dial(SIP/${EXTEN}) 7: [default] 7: 7: exten => _31XX,1,Dial(SIP/${EXTEN}) 8: [default] 8: 8: exten => _32XX,1,Dial(SIP/${EXTEN}) 8: |
#cat /etc/asterisk/extensions.conf
|
#_ +5
4 +4 |
#_ done
|
#all init 0
3: ssh: connect to host m3 port 22: Connection timed out 5: ssh: connect to host m5 port 22: Connection timed out 6: ssh: connect to host m6 port 22: Connection timed out 7: ssh: connect to host m7 port 22: Connection timed out |
#ssh m1
l3-agent is already running: pid=4022; pidfile=/root/.lilalo/l3-agent.pid |
#cat /etc/asterisk/sip.conf
[general] context=default [1101] type=friend secret=1234 host=dynamic [1102] type=friend secret=1234 host=dynamic |
#asterisk -rv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian1 (pid = 2476) Verbosity was 0 and is now 1 debian1*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1101/1101 192.168.10.100 D N 5060 Unmonitored 1102/1102 192.168.10.101 D N 35840 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] debian1*CLI> quit Executing last minute cleanups |
#exit
exit Connection to m1 closed. |
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-9664.1390.10554 2014-11-25 02:51:44.750585825 -0500 +++ /etc/asterisk/sip.conf 2014-11-25 02:51:54.402586101 -0500 @@ -1,5 +1,6 @@ [general] context=default +qualify=yes [3301] type=friend |
#cat /etc/asterisk/sip.conf
[general] context=default qualify=yes [3301] type=friend secret=1234 host=dynamic [3302] type=friend secret=1234 host=dynamic |
#asterisk -rv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian0 (pid = 17209) Verbosity is at least 2 debian0*CLI> sip reload Reloading SIP == Parsing '/etc/asterisk/sip.conf': == Found == Parsing '/etc/asterisk/users.conf': == Found [Nov 25 02:52:24] ERROR[17246]: netsock2.c:263 ast_sockaddr_resolve: getaddrinfo("debian0", "(null)", ...): Name or service not known [Nov 25 02:52:24] WARNING[17246]: acl.c:582 resolve_first: Unable to lookup 'debian0' == Using SIP CoS mark 4 == Parsing '/etc/asterisk/sip_notify.conf': == Found debian0*CLI> quit Executing last minute cleanups |
#cat /etc/asterisk/extensions.conf
|
#_ +4
vim |
#_ +4
^C |
#cat /etc/asterisk/sip.conf
[general] context=default qualify=yes [3301] type=friend secret=1234 host=dynamic [3302] type=friend secret=1234 host=dynamic |
#all 'asterisk -rx "sip show peers"'
1: Name/username Host Dyn Forcerport ACL Port Status 1: 1101/1101 192.168.10.100 D N 5060 OK (15 ms) 1: 1102/1102 192.168.10.101 D N 35840 OK (6 ms) 1: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 2: Name/username Host Dyn Forcerport ACL Port Status 2: 1201/1201 192.168.20.100 D N 5060 OK (18 ms) 2: 1202/1202 192.168.20.102 D N 43458 UNREACHABLE 2: 2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline] 3: Name/username Host Dyn Forcerport ACL Port Status 3: 1301/1301 192.168.30.100 D N 5060 Unmonitored ... 6: 2302/2302 192.168.60.101 D N 53003 OK (103 ms) 6: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 7: Name/username Host Dyn Forcerport ACL Port Status 7: 3101/3101 192.168.70.100 D N 5060 OK (16 ms) 7: 3102/3102 192.168.70.101 D N 62674 OK (6 ms) 7: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 8: Name/username Host Dyn Forcerport ACL Port Status 8: 3201/3201 192.168.80.100 D N 5060 OK (15 ms) 8: 3202/3202 192.168.80.101 D N 38123 UNREACHABLE 8: 2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline] |
#asterisk -rvv
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 debian1 (pid = 2476) Verbosity was 1 and is now 2 debian1*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1101/1101 192.168.10.100 D N 5060 OK (17 ms) 1102/1102 192.168.10.101 D N 35840 OK (5 ms) 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] debian1*CLI> quit Executing last minute cleanups |
#ssh m1
l3-agent is already running: pid=4022; pidfile=/root/.lilalo/l3-agent.pid |
#exit
exit Connection to m1 closed. |
#all 'asterisk -rx "sip show peers"'
1: Name/username Host Dyn Forcerport ACL Port Status 1: 1101/1101 192.168.10.100 D N 5060 OK (17 ms) 1: 1102/1102 192.168.10.101 D N 35840 OK (7 ms) 1: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 2: Name/username Host Dyn Forcerport ACL Port Status 2: 1201/1201 192.168.20.100 D N 5060 OK (15 ms) 2: 1202/1202 192.168.20.102 D N 43458 UNREACHABLE 2: 2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline] 3: Name/username Host Dyn Forcerport ACL Port Status 3: 1301/1301 192.168.30.100 D N 5060 Unmonitored ... 6: 2302/2302 192.168.60.101 D N 53003 OK (106 ms) 6: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 7: Name/username Host Dyn Forcerport ACL Port Status 7: 3101/3101 192.168.70.100 D N 5060 OK (16 ms) 7: 3102/3102 192.168.70.101 D N 62674 OK (6 ms) 7: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 8: Name/username Host Dyn Forcerport ACL Port Status 8: 3201/3201 192.168.80.100 D N 5060 OK (16 ms) 8: 3202/3202 192.168.80.101 D N 38123 UNREACHABLE 8: 2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline] |
#cat /etc/asterisk/sip.conf
[general] context=default qualify=yes [3301] type=friend secret=1234 host=dynamic [3302] type=friend secret=1234 host=dynamic |
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-22932.22529.22641 2014-11-25 03:17:56.294633309 -0500 +++ /etc/asterisk/sip.conf 2014-11-25 03:27:05.250649902 -0500 @@ -2,13 +2,33 @@ context=default qualify=yes +[phone](!) +type=friend +host=dynamic +qualify=yes + +[softphone](!) +;... +qualify=no + +[smartphone](!,softphone) +qualify=yes + +[uplink](!) +;... + + [3301] type=friend secret=1234 host=dynamic +qualify=no [3302] type=friend secret=1234 host=dynamic +[3303](phone) +secret=1234 + |
#ls -l /etc/asterisk/extensions.*
-rw-r----- 1 asterisk asterisk 12776 Jan 3 2014 /etc/asterisk/extensions.ael -rw-r--r-- 1 root root 49 Nov 24 11:06 /etc/asterisk/extensions.conf -rw-r----- 1 asterisk asterisk 30823 Jan 3 2014 /etc/asterisk/extensions.conf.bak -rw-r----- 1 asterisk asterisk 5253 Jan 3 2014 /etc/asterisk/extensions.lua |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-22932.12267.6548 2014-11-25 03:41:45.074676490 -0500 +++ /etc/asterisk/extensions.conf 2014-11-25 04:51:29.174802910 -0500 @@ -1,5 +1,33 @@ [default] -exten => _11XX,1,Dial(SIP/${EXTEN}) +exten => _11XX,1,NoOp(Starting call processing) +exten => _11XX,n,NoOp(to extension ${EXTEN}) +exten => _11XX,n,Dial(SIP/${EXTEN}) + + +; Теперь задание +; Приложение Record +; записывает ваше голосовое сообщение + +exten => 8100,1,Record(/var/tmp/asterisk/record00:gsm) + +; Приложение Playback + +exten => 8100,1,Playback(/var/tmp/asterisk/record00) + +; создать каталог /var/tmp/asterisk +; сделать его принадлежащим asterisk + +; проигрывает сообщение + +; Необходимо сделать возможность записи 100 различных файлов +; на определённых номерах: 8100-8199 +; и прослушивания: 8200-8299 + +; using same + +exten => _11XX,1,NoOp(Starting call processing) + same => n,NoOp(to extension {EXTEN}) + same => n,Dial(SIP/${EXTEN}) |
#mkdir /var/tmp/asterisk
|
## создать каталог /var/tmp/asterisk
|
## сделать его принадлежащим asterisk:
|
#chown asterisk:asterisk /var/tmp/asterisk
|
#all grep Playback /etc/asterisk/extensions.conf
6: exten => _82XX,n,Playback(/var/tmp/asterisk/recordXX) 7: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 8: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) |
## 6 неправильно
|
## 7 8 правильно
|
## для того чтобы изменения вступили в силу
|
#â# dialplan reload в конÑоли РаÑÑеÑиÑка
|
#ifconfig eth0 | grep inet
inet addr:10.1.199.1 Bcast:10.1.255.255 Mask:255.255.0.0 inet6 addr: fe80::6e3b:e5ff:fe39:36f9/64 Scope:Link |
## Record(/var/tmp/asterisk/record${EXTEN:2},3)
|
## выключаться после 3х секунд молчания
|
#all grep Playback /etc/asterisk/extensions.conf¸Ñка
4: exten => _8200,1,Playback(/var/tmp/asterisk/record00) 4: exten => _82XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2}) 6: exten => _82XX,n,Playback(/var/tmp/asterisk/record${EXTEN}:2) 7: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 8: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) |
#vim /etc/asterisk/extensions.conf
|
#mkdir /var/tmp/asterisk
|
#all ls -l /var/tmp/asterisk
1: total 0 2: ls: cannot access /var/tmp/asterisk: No such file or directory 3: total 0 4: total 4 4: -rw-rw---- 1 asterisk asterisk 3432 Nov 25 12:09 record00.gsm 5: total 0 6: total 0 7: total 8 7: -rw-rw---- 1 asterisk asterisk 4422 Nov 25 12:08 record00.gsm 8: total 8 8: -rw-rw---- 1 asterisk asterisk 4290 Nov 25 12:07 record01.gsm |
#all grep Playback /etc/asterisk/extensions.conf
1: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 2: exten => _82xx,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 4: exten => _8200,1,Playback(/var/tmp/asterisk/record00) 4: exten => _82XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2}) 5: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 6: exten => _82XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2}) 7: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 8: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) |
#all grep Playback /etc/asterisk/extensions.conf
1: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 2: exten => _82xx,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 4: exten => _8200,1,Playback(/var/tmp/asterisk/record00) 4: exten => _82XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2}) 5: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 6: exten => _82XX,n,Playback(/var/tmp/asterisk/record${EXTEN:2}) 7: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) 8: exten => _82XX,1,Playback(/var/tmp/asterisk/record${EXTEN:2}) |
#all ls -l /var/tmp/asterisk
1: total 12 1: -rw-rw---- 1 asterisk asterisk 7458 Nov 25 12:21 record01.gsm 1: -rw-rw---- 1 asterisk asterisk 1485 Nov 25 12:24 record02.gsm 2: total 0 3: total 0 4: total 4 4: -rw-rw---- 1 asterisk asterisk 1122 Nov 25 12:24 record00.gsm 5: total 8 5: -rw-rw---- 1 asterisk asterisk 5049 Nov 25 12:19 record00.gsm 6: total 16 6: -rw-rw---- 1 asterisk asterisk 14322 Nov 25 12:24 record00.gsm 7: total 8 7: -rw-rw---- 1 asterisk asterisk 4422 Nov 25 12:08 record00.gsm 8: total 8 8: -rw-rw---- 1 asterisk asterisk 4290 Nov 25 12:07 record01.gsm |
#all ls -l /var/tmp/asterisk
1: total 12 1: -rw-rw---- 1 asterisk asterisk 7458 Nov 25 12:21 record01.gsm 1: -rw-rw---- 1 asterisk asterisk 1485 Nov 25 12:24 record02.gsm 2: total 0 3: total 0 4: total 4 4: -rw-rw---- 1 asterisk asterisk 1122 Nov 25 12:24 record00.gsm 5: total 8 5: -rw-rw---- 1 asterisk asterisk 5049 Nov 25 12:19 record00.gsm 6: total 16 6: -rw-rw---- 1 asterisk asterisk 14322 Nov 25 12:24 record00.gsm 7: total 8 7: -rw-rw---- 1 asterisk asterisk 4422 Nov 25 12:08 record00.gsm 8: total 8 8: -rw-rw---- 1 asterisk asterisk 4290 Nov 25 12:07 record01.gsm |
#all grep Record /etc/asterisk/extensions.conf / р| grep 3:
3: exten => 8100,1,Record(/var/tmp/asterisk/record00:gsm) 3: exten => _81XX,1,Record(/var/tmp/asterisk/record ${EXTEN:2}:gsm) |
## можно было первое убрать
|
## супер
|
#_ +3
+3 |
#_ done
|
#_ ЗвоSIP-пиринг: Звонки внутри страны
|
## всё делается в sip.conf
|
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-22932.23737.1811 2014-11-25 06:22:36.010968114 -0500 +++ /etc/asterisk/sip.conf 2014-11-25 06:34:04.906988924 -0500 @@ -2,6 +2,10 @@ context=default qualify=yes +; ещё вы должны добавить регистрацию: + +register => edinburgh:1234@192.168.80.1/london + [phone](!) type=friend host=dynamic @@ -16,3 +20,15 @@ [3303](phone) secret=1234 +; я нахожусь в Эдинбурге (Edinburgh) +; и соединияюсь с Лондоном (London) + +[london] +type=friend +host=dynamic +secret=1234 +; новая опция +directmedia=no +; запретили прямую передачу media-потока между пирами +username=edinburgh + |
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian0 (pid = 17209) ... == Parsing '/etc/asterisk/sip_notify.conf': == Found debian0*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 3301 (Unspecified) D N 0 UNKNOWN 3302 (Unspecified) D N 0 UNKNOWN 3303 (Unspecified) D N 0 UNKNOWN london/edinburgh (Unspecified) D N 0 UNKNOWN 4 sip peers [Monitored: 0 online, 4 offline Unmonitored: 0 online, 0 offline] debian0*CLI> quit Executing last minute cleanups |
#asterisk -rx 'sip show peers'
Name/username Host Dyn Forcerport ACL Port Status 3301 (Unspecified) D N 0 UNKNOWN 3302 (Unspecified) D N 0 UNKNOWN 3303 (Unspecified) D N 0 UNKNOWN london/edinburgh (Unspecified) D N 0 UNKNOWN 4 sip peers [Monitored: 0 online, 4 offline Unmonitored: 0 online, 0 offline] |
#ssh m7
Linux debian7 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u1 x86_64 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: Tue Nov 25 09:46:13 2014 from 192.168.12.254 Can't locate Term/VT102.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /usr/local/bin/l3-agent line 9. BEGIN failed--compilation aborted at /usr/local/bin/l3-agent line 9. |
#asterisk -rvvvv
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 debian7 (pid = 4658) Verbosity is at least 11 debian7*CLI> -- Remote UNIX connection -- Remote UNIX connection disconnected -- Remote UNIX connection debian7*CLI> quit Executing last minute cleanups |
#exit
exit Connection to m7 closed. |
#grep register /etc/asterisk/sip.conf
register => london:1234@192.168.12.254/liverpool register => london:1234@192.168.70.1/edinburgh |
#ssh m8
Linux debian8 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u1 x86_64 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: Tue Nov 25 09:46:16 2014 from 192.168.12.254 l3-agent is already running: pid=3809; pidfile=/root/.lilalo/l3-agent.pid |
#grep register /etc/asterisk/sip.conf
register => london:1234@192.168.12.254/edinburgh register => london:1234@192.168.70.1/liverpool |
#exit
exit Connection to m8 closed. |
#all "asterisk -rx 'sip show peers'"
1: Name/username Host Dyn Forcerport ACL Port Status 1: 1101/1101 192.168.10.100 D N 5060 OK (16 ms) 1: 1102/1102 192.168.10.101 D N 35840 OK (6 ms) 1: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 2: Name/username Host Dyn Forcerport ACL Port Status 2: 1201/1201 192.168.20.100 D N 5060 OK (18 ms) 2: 1202/1202 (Unspecified) D N 0 UNKNOWN 2: 2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline] 3: Name/username Host Dyn Forcerport ACL Port Status 3: 1301/1301 192.168.30.100 D N 5060 Unmonitored ... 7: 3101/3101 192.168.70.100 D N 5060 OK (16 ms) 7: 3102/3102 192.168.70.101 D N 62674 OK (7 ms) 7: london/liverpool (Unspecified) D N 0 UNKNOWN 7: 3 sip peers [Monitored: 2 online, 1 offline Unmonitored: 0 online, 0 offline] 8: Name/username Host Dyn Forcerport ACL Port Status 8: 3201/3201 192.168.80.100 D N 5060 OK (19 ms) 8: 3202/3202 192.168.80.101 D N 62975 OK (1 ms) 8: edinburgh/london 192.168.12.254 D N 5060 OK (1 ms) 8: liverpool/london 192.168.70.1 D N 5060 OK (1 ms) 8: 4 sip peers [Monitored: 4 online, 0 offline Unmonitored: 0 online, 0 offline] |
#asterisk -rvvvv
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 debian7 (pid = 4658) ... 3 sip peers [Monitored: 2 online, 1 offline Unmonitored: 0 online, 0 offline] -- Remote UNIX connection disconnected -- Remote UNIX connection Reloading SIP Reloading SIP -- Registered SIP 'london' at 192.168.80.1:5060 > Saved useragent "Asterisk PBX 1.8.13.1~dfsg1-3+deb7u3" for peer london [Nov 25 13:42:22] NOTICE[4696]: chan_sip.c:20886 handle_response_peerpoke: Peer 'london' is now Reachable. (1ms / 2000ms) debian7*CLI> quit Executing last minute cleanups |
#all "asterisk -rx 'sip show peers'"
1: Name/username Host Dyn Forcerport ACL Port Status 1: 1101/1101 192.168.10.100 D N 5060 OK (16 ms) 1: 1102/1102 192.168.10.101 D N 35840 OK (6 ms) 1: 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline] 2: Name/username Host Dyn Forcerport ACL Port Status 2: 1201/1201 192.168.20.100 D N 5060 OK (19 ms) 2: 1202/1202 (Unspecified) D N 0 UNKNOWN 2: kiev/komsomolsk (Unspecified) D N 0 UNKNOWN 2: 3 sip peers [Monitored: 1 online, 2 offline Unmonitored: 0 online, 0 offline] 3: Name/username Host Dyn Forcerport ACL Port Status ... 7: 3101/3101 192.168.70.100 D N 5060 OK (14 ms) 7: 3102/3102 192.168.70.101 D N 62674 OK (6 ms) 7: london/liverpool 192.168.80.1 D N 5060 OK (1 ms) 7: 3 sip peers [Monitored: 3 online, 0 offline Unmonitored: 0 online, 0 offline] 8: Name/username Host Dyn Forcerport ACL Port Status 8: 3201/3201 192.168.80.100 D N 5060 OK (20 ms) 8: 3202/3202 192.168.80.101 D N 62975 OK (1 ms) 8: edinburgh/london 192.168.12.254 D N 5060 OK (1 ms) 8: liverpool/london 192.168.70.1 D N 5060 OK (1 ms) 8: 4 sip peers [Monitored: 4 online, 0 offline Unmonitored: 0 online, 0 offline] |
#all grep register /etc/asterisk/sip.conf
1: register => kiev:1234@192.168.20.1/komsomolsk 2: register=> komsomolsk:1234@192.168.10.1/kiev 3: register => minsk:1234@192.168.60.1/brest 4: register => ny:1234@192.168.50.1/atlanta 5: register => atlanta:1234@192.168.40.1/ny 6: register => brest:1234@192.168.30.1/minsk 7: register => liverpool:1234@192.168.80.1/london 8: register => london:1234@192.168.12.254/edinburgh 8: register => london:1234@192.168.70.1/liverpool |
#all 'grep -A5 [[]an /etc/asterisk/sip.conf'
|
#all 'grep -A5 [[][an] /etc/asterisk/sip.conf'
4: [atlanta] 4: type=friend 4: host=dynamic 4: secret=1234 4: directmedia=no 4: 5: [ny](phone) 5: ; новая опция 5: directmedia=no 5: ; directmedia - запрет прямого соединения между пирами (телефон-телефон) 5: ; работать телефонам резрешено только через asterisk 5: secret=1234 |
#all 'grep -A10 [[][an] /etc/asterisk/sip.conf'
4: [atlanta] 4: type=friend 4: host=dynamic 4: secret=1234 4: directmedia=no 4: 5: [ny](phone) 5: ; новая опция 5: directmedia=no 5: ; directmedia - запрет прямого соединения между пирами (телефон-телефон) 5: ; работать телефонам резрешено только через asterisk 5: secret=1234 5: 5: 5: 5: ;#include "/etc/asterisk/sip.conf.kiev" 5: ;#include "/etc/asterisk/sip.conf.kharkov" |
#ssh m4
Linux debian4 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u1 x86_64 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: Tue Nov 25 09:46:04 2014 from 192.168.12.254 l3-agent is already running: pid=4047; pidfile=/root/.lilalo/l3-agent.pid |
#asterisk -rx 'sip reload'
|
#asterisk -rx 'sip reload'
|
#less /etc/asterisk/sip.conf
|
## все нормально зарегистрировались (ny, atlanta)
|
[general] context=default qualify=yes [3301] type=friend secret=1234 host=dynamic [3302] type=friend secret=1234 host=dynamic
Время первой команды журнала | 17:02:30 2014-11-24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 12:47:14 2014-11-25 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 1.98 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.81 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.60 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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