/l3/users/Andrey/nt-voip/linux12.unix.nt.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 |
|
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3961.21773.23764 2010-10-26 10:44:46.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 10:46:40.000000000 +0300 @@ -554,7 +554,17 @@ exten =>2299,n,Playback(demo-thanks) exten =>2299,n,Hangup +exten => _22XX,1,Dial(SIP/${EXTEN}) +exten => _22XXX,1,Dial(SIP/1${EXTEN:1:4}) + +exten => _68XX,1,Wait(2) +exten => _68XX,n,Playback(/tmp/warning1) +exten => _68XX,n,Dial(SIP/22${EXTEN:2}) + + exten =>2201,1,Dial(SIP/2201) exten =>2202,2,DIal(SIP/2202) ;exten =>2201,1,Dial(SIP/2201) exten =>2298,1,Record(/tmp/warning1:gsm,,3) + + |
#ping 192.168.110.1
PING 192.168.110.1 (192.168.110.1) 56(84) bytes of data. 64 bytes from 192.168.110.1: icmp_seq=1 ttl=63 time=0.191 ms 64 bytes from 192.168.110.1: icmp_seq=2 ttl=63 time=0.220 ms ^C --- 192.168.110.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.191/0.205/0.220/0.020 ms |
#ping 192.168.109.1
PING 192.168.109.1 (192.168.109.1) 56(84) bytes of data. 64 bytes from 192.168.109.1: icmp_seq=1 ttl=63 time=0.434 ms ^C --- 192.168.109.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.434/0.434/0.434/0.000 ms |
#namp 192.168.109.1
bash: namp: command not found |
#nmap 192.168.109.1
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-26 11:10 EEST Interesting ports on 192.168.109.1: Not shown: 1712 closed ports PORT STATE SERVICE 22/tcp open ssh 111/tcp open rpcbind 2000/tcp open callbook Nmap done: 1 IP address (1 host up) scanned in 0.077 seconds |
#nmap 192.168.110.1
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-26 11:10 EEST Interesting ports on 192.168.110.1: Not shown: 1713 closed ports PORT STATE SERVICE 111/tcp open rpcbind 2000/tcp open callbook Nmap done: 1 IP address (1 host up) scanned in 0.087 seconds |
#nmap 192.168.112.1
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-26 11:10 EEST Interesting ports on 192.168.112.1: Not shown: 1712 closed ports PORT STATE SERVICE 22/tcp open ssh 111/tcp open rpcbind 2000/tcp open callbook Nmap done: 1 IP address (1 host up) scanned in 0.197 seconds |
#cat /etc/asterisk/sip.conf
[general] context=default ; Default context for incoming calls allowoverlap=no ; Disable overlap dialing support. (Default is yes) bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) srvlookup=yes ; Enable DNS SRV lookups on outbound calls register=>mn:1234@192.168.111.1/bb register=>mn:1234@192.168.110.1/br register=>mn:1234@192.168.109.1/gm [authentication] ... [br] type=friend secret=1234 host=dynamic username=mn [gm] type=friend secret=1234 host=dynamic username=mn |
#vi /etc/asterisk/sip.conf
|
#asterisk -rx "sip reload"
|
#asterisk -rcvvvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Executing [2202@default:2] Dial("SIP/2203-095c0140", "SIP/2202") in new stack -- Called 2202 -- SIP/2202-095c8030 is ringing -- Got SIP response 486 "Busy Here" back from 192.168.112.2 -- SIP/2202-095c8030 is busy == Everyone is busy/congested at this time (1:1/0/0) == Auto fallthrough, channel 'SIP/2203-095c0140' status is 'BUSY' linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-4784.12021.31995 2010-10-26 11:24:23.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-10-26 11:25:45.000000000 +0300 @@ -26,6 +26,10 @@ secret=1234 host=dynamic +[2204] +type=friend +secret=1234 +host=dynamic [bb] type=friend |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Added extension '_68XX' priority 3 to default -- Added extension '2201' priority 1 to default -- Added extension '2202' priority 2 to default -- Added extension '2203' priority 3 to default -- Added extension '2204' priority 4 to default -- Added extension '2298' priority 1 to default == Parsing '/etc/asterisk/users.conf': Found linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... [Oct 26 11:34:36] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #3) [Oct 26 11:34:56] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #4) [Oct 26 11:35:16] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #5) [Oct 26 11:35:36] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #6) [Oct 26 11:35:56] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #7) [Oct 26 11:36:16] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #8) [Oct 26 11:36:36] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #9) linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:37 inet addr:192.168.112.1 Bcast:192.168.112.255 Mask:255.255.255.0 inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:18668 errors:0 dropped:0 overruns:0 frame:0 TX packets:14422 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:3574640 (3.4 MiB) TX bytes:2151137 (2.0 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3488 errors:0 dropped:0 overruns:0 frame:0 TX packets:3488 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:166174 (162.2 KiB) TX bytes:166174 (162.2 KiB) |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... [Oct 26 11:38:15] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #1) [Oct 26 11:38:35] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #2) [Oct 26 11:38:55] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #3) [Oct 26 11:39:09] NOTICE[2616]: chan_sip.c:15642 handle_request_register: Registration from 'sip:test@192.168.112.1' failed for '192.168.112.11' - No matching peer found [Oct 26 11:39:15] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #4) [Oct 26 11:39:35] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #5) [Oct 26 11:39:55] NOTICE[2616]: chan_sip.c:7515 sip_reg_timeout: -- Registration for 'mn@192.168.110.1' timed out, trying again (Attempt #6) linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#ping 192.168.110.254
PING 192.168.110.254 (192.168.110.254) 56(84) bytes of data. 64 bytes from 192.168.110.254: icmp_seq=1 ttl=64 time=0.609 ms 64 bytes from 192.168.110.254: icmp_seq=2 ttl=64 time=0.591 ms ^C --- 192.168.110.254 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1004ms rtt min/avg/max/mdev = 0.591/0.600/0.609/0.009 ms |
#cat /etc/asterisk/sip.conf
[general] context=default ; Default context for incoming calls allowoverlap=no ; Disable overlap dialing support. (Default is yes) bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) srvlookup=yes ; Enable DNS SRV lookups on outbound calls register=>mn:1234@192.168.111.1/bb register=>mn:1234@192.168.110.1/br register=>mn:1234@192.168.109.1/gm [authentication] ... [br] type=friend secret=1234 host=dynamic username=mn [gm] type=friend secret=1234 host=dynamic username=mn |
#asterisk -rcvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... br/mn (Unspecified) D 0 Unmonitored bb/mn 192.168.111.1 D 5060 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 5 online, 2 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 5 online, 2 offline] -- Executing [2204@default:1] Dial("SIP/2202-095b1150", "SIP/2204") in new stack -- Called 2204 -- SIP/2204-095b52c0 is ringing -- SIP/2204-095b52c0 answered SIP/2202-095b1150 -- Native bridging SIP/2202-095b1150 and SIP/2204-095b52c0 == Spawn extension (default, 2204, 1) exited non-zero on 'SIP/2202-095b1150' linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5131.9892.22288 2010-10-26 11:48:03.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 11:50:53.000000000 +0300 @@ -569,4 +569,7 @@ ;exten =>2201,1,Dial(SIP/2201) exten =>2298,1,Record(/tmp/warning1:gsm,,3) +exten =>_19XX,1,Dial,(SIP/ptr/${EXTEN}) +exten =>_20XX,1,Dial,(SIP/ptr/${EXTEN}) +exten =>_21XX,1,Dial,(SIP/ptr/${EXTEN}) |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... br/mn 192.168.110.1 D 5060 Unmonitored bb/mn 192.168.111.1 D 5060 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 6 online, 1 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5131.2986.9744 2010-10-26 11:52:13.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 11:56:49.000000000 +0300 @@ -568,8 +568,12 @@ exten =>2204,4,DIal(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) exten =>2298,1,Record(/tmp/warning1:gsm,,3) +;in Belorussia +exten =>_19XX,1,Dial(SIP/ptr/${EXTEN}) +exten =>_20XX,1,Dial(SIP/ptr/${EXTEN}) +exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) +;in other locations +exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) +exten =>_XXXX,1,Dial(SIP/ptr/${EXTEN}) -exten =>_19XX,1,Dial,(SIP/ptr/${EXTEN}) -exten =>_20XX,1,Dial,(SIP/ptr/${EXTEN}) -exten =>_21XX,1,Dial,(SIP/ptr/${EXTEN}) |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... == Everyone is busy/congested at this time (1:0/0/1) == Auto fallthrough, channel 'SIP/2202-095b1150' status is 'CHANUNAVAIL' -- Executing [2102@default:1] Dial("SIP/2202-095ba3c8", "SIP/ptr/2102") in new stack [Oct 26 11:57:45] WARNING[5264]: chan_sip.c:2921 create_addr: No such host: ptr [Oct 26 11:57:45] WARNING[5264]: 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/2202-095ba3c8' status is 'CHANUNAVAIL' linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5131.15118.16460 2010-10-26 11:57:54.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 11:59:13.000000000 +0300 @@ -569,11 +569,11 @@ ;exten =>2201,1,Dial(SIP/2201) exten =>2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia -exten =>_19XX,1,Dial(SIP/ptr/${EXTEN}) -exten =>_20XX,1,Dial(SIP/ptr/${EXTEN}) -exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) +exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) +exten =>_20XX,1,Dial(SIP/br/${EXTEN}) +exten =>_21XX,1,Dial(SIP/bb/${EXTEN}) ;in other locations -exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) -exten =>_XXXX,1,Dial(SIP/ptr/${EXTEN}) +;exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) +exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Executing [2204@default:1] Dial("SIP/mn-095b52c0", "SIP/2204") in new stack -- Called 2204 -- SIP/2204-095c0a38 is ringing -- SIP/2204-095c0a38 answered SIP/mn-095b52c0 -- Native bridging SIP/mn-095b52c0 and SIP/2204-095c0a38 == Spawn extension (default, 2204, 1) exited non-zero on 'SIP/mn-095b52c0' [Oct 26 12:00:09] NOTICE[2616]: chan_sip.c:14668 handle_request_invite: Unable to create/find SIP channel for this INVITE linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-5131.12803.5907 2010-10-26 12:00:45.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-10-26 12:02:55.000000000 +0300 @@ -15,21 +15,25 @@ type=friend secret=1234 host=dynamic +callerid="Minsk 2201" [2202] type=friend secret=1234 host=dynamic +callerid="Minsk Softphone 2202" [2203] type=friend secret=1234 host=dynamic +callerid="Minsk Softphone 2203" [2204] type=friend secret=1234 host=dynamic +callerid="Minsk 2204" [bb] type=friend |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Executing [2203@default:1] Dial("SIP/2202-095bcee8", "SIP/2203") in new stack -- Called 2203 -- SIP/2203-095be478 is ringing -- Got SIP response 486 "Busy Here" back from 192.168.112.2 -- SIP/2203-095be478 is busy == Everyone is busy/congested at this time (1:1/0/0) == Auto fallthrough, channel 'SIP/2202-095bcee8' status is 'BUSY' linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/sip.conf
|
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... == Spawn extension (default, 2204, 1) exited non-zero on 'SIP/2203-095ba3c8' -- Executing [2203@default:1] Dial("SIP/2204-095b6cc8", "SIP/2203") in new stack -- Called 2203 -- SIP/2203-095b52c0 is ringing -- SIP/2203-095b52c0 answered SIP/2204-095b6cc8 -- Native bridging SIP/2204-095b6cc8 and SIP/2203-095b52c0 == Spawn extension (default, 2203, 1) exited non-zero on 'SIP/2204-095b6cc8' linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#less
|
#less /etc/asterisk/extensions.conf
|
#asterisk -rsv
asterisk: invalid option -- s |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... br/mn 192.168.110.1 D 5060 Unmonitored bb/mn 192.168.111.1 D 5060 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 6 online, 1 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:37 inet addr:192.168.112.1 Bcast:192.168.112.255 Mask:255.255.255.0 inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:26364 errors:0 dropped:0 overruns:0 frame:0 TX packets:20975 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:5018772 (4.7 MiB) TX bytes:3613270 (3.4 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3503 errors:0 dropped:0 overruns:0 frame:0 TX packets:3503 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:172334 (168.2 KiB) TX bytes:172334 (168.2 KiB) |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... br/mn 192.168.110.1 D 5060 Unmonitored bb/mn 192.168.111.1 D 5060 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 6 online, 1 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... br/mn 192.168.110.1 D 5060 Unmonitored bb/mn 192.168.111.1 D 5060 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 6 online, 1 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5131.2799.17595 2010-10-26 12:32:52.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 12:36:59.000000000 +0300 @@ -565,9 +565,9 @@ exten =>2201,1,Dial(SIP/2201,1) exten =>2201,n,Dial(SIP/2204) -exten =>2202,1,DIal(SIP/2202) -exten =>2203,1,DIal(SIP/2203) -exten =>2204,1,DIal(SIP/2204) +;exten =>2202,1,Dial(SIP/2202) +exten =>2203,1,Dial(SIP/2203) +exten =>2204,1,Dial(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) exten =>2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia @@ -578,4 +578,6 @@ ;exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) +[group1] +exten =>2202,1,Dial(SIP/2202) |
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-5705.18323.18026 2010-10-26 12:37:55.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-10-26 12:38:42.000000000 +0300 @@ -22,6 +22,7 @@ secret=1234 host=dynamic callerid="Minsk Softphone 2202" +context=group1 ; group1 context for incoming calls [2203] type=friend |
#vi /etc/asterisk/extensions.conf
|
#exten =>2202,1,Dial(SIP/2202)
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Executing [2202@default:1] Dial("SIP/2204-095b52c0", "SIP/2202") in new stack -- Called 2202 -- SIP/2202-095be090 is ringing -- Got SIP response 486 "Busy Here" back from 192.168.112.2 -- SIP/2202-095be090 is busy == Everyone is busy/congested at this time (1:1/0/0) == Auto fallthrough, channel 'SIP/2204-095b52c0' status is 'BUSY' linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/sip.conf
|
#vi /etc/asterisk/sip.conf
|
#[2202]
;exten =>2202,1,Dial(SIP/2202) exten =>2203,1,Dial(SIP/2203) exten =>2204,1,Dial(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) exten =>2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia ;exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) ;exten =>_20XX,1,Dial(SIP/br/${EXTEN}) ;exten =>_21XX,1,Dial(SIP/bb/${EXTEN}) ;in other locations ;exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) ;exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [local] exten =>_22XX,1,Dial(SIP/mn/${EXTEN}) [national] exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) exten =>_20XX,1,Dial(SIP/br/${EXTEN}) exten =>_21XX,1,Dial(SIP/bb/${EXTEN}) [international] |
#{EXTEN})
E325: ATTENTION Found a swap file by the name "/etc/asterisk/.sip.conf.swp" owned by: root dated: Tue Oct 26 12:37:23 2010 file name: /etc/asterisk/sip.conf modified: YES user name: root host name: linux12.unix.nt process ID: 5639 While opening file "/etc/asterisk/sip.conf" dated: Tue Oct 26 12:38:42 2010 NEWER than swap file! ... [2204]ynamic [2204] secret=1234i host=dynamic callerid="Minsk 2204" context=group1 [bb] [bb]=friend secret=1234 "/etc/asterisk/sip.conf" 61L, 1141C written |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5980.12795.17794 2010-10-26 12:53:36.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 12:58:43.000000000 +0300 @@ -588,3 +588,15 @@ [international] exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) + +[group1] +include => local +include => national +include => international + +[group2] +include => local +include => national + +[group3] +include =>local |
#vi /etc/asterisk/extensions.conf
|
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... br/mn 192.168.110.1 D 5060 Unmonitored bb/mn 192.168.111.1 D 5060 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 6 online, 1 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#cat /etc/asterisk/extensions.conf
; extensions.conf - the Asterisk dial plan ; ; Static extension configuration file, used by ; the pbx_config module. This is where you configure all your ; inbound and outbound calls in Asterisk. ; ; This configuration file is reloaded ; - With the "dialplan reload" command in the CLI ; - With the "reload" command (that reloads everything) in the CLI ; ... exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [group1] include => local include => national include => international [group2] include => local include => national [group3] include =>local |
#cat /etc/asterisk/sip.conf
[general] context=default ; Default context for incoming calls allowoverlap=no ; Disable overlap dialing support. (Default is yes) bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) srvlookup=yes ; Enable DNS SRV lookups on outbound calls register=>mn:1234@192.168.111.1/bb register=>mn:1234@192.168.110.1/br register=>mn:1234@192.168.109.1/gm [authentication] ... [br] type=friend secret=1234 host=dynamic username=mn [gm] type=friend secret=1234 host=dynamic username=mn |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... br/mn 192.168.110.1 D 5060 Unmonitored bb/mn 192.168.111.1 D 5060 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1695 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 6 online, 1 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-6274.580.5719 2010-10-26 13:53:09.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 13:57:43.000000000 +0300 @@ -579,7 +579,7 @@ ;exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [local] -exten =>_22XX,1,Dial(SIP/mn/${EXTEN}) +exten =>_22XX,1,Dial(SIP/${EXTEN}) [national] exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) @@ -599,4 +599,4 @@ include => national [group3] -include =>local +include => local |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Executing [2001@group1:1] Dial("SIP/2204-095ba3c8", "SIP/br/2001") in new stack -- Called br/2001 -- SIP/br-095c1e88 is ringing -- SIP/br-095c1e88 answered SIP/2204-095ba3c8 -- Native bridging SIP/2204-095ba3c8 and SIP/br-095c1e88 == Spawn extension (group1, 2001, 1) exited non-zero on 'SIP/2204-095ba3c8' [Oct 26 14:01:35] NOTICE[2616]: chan_sip.c:14668 handle_request_invite: Unable to create/find SIP channel for this INVITE linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#less /etc/asterisk/extensions.conf
|
#[2202]
dbus-1/ default/ dhcp3/ debconf.conf defoma/ dictionaries-common/ debian_version deluser.conf dpkg/ |
#ls /etc/dhcp3/dhc
dhclient.conf dhclient-exit-hooks.d/ dhclient-enter-hooks.d/ dhcpd.conf |
#ls /etc/dhcp3/dhc
dhclient.conf dhclient-exit-hooks.d/ dhclient-enter-hooks.d/ dhcpd.conf |
#less /etc/dhcp3/dhcpd.conf
|
#less /etc/asterisk/extensions.conf
|
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-6274.20962.17902 2010-10-26 14:22:16.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 14:22:58.000000000 +0300 @@ -569,7 +569,7 @@ exten =>2203,1,Dial(SIP/2203) exten =>2204,1,Dial(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) -exten =>2298,1,Record(/tmp/warning1:gsm,,3) +;exten =>2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia ;exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) ;exten =>_20XX,1,Dial(SIP/br/${EXTEN}) @@ -580,6 +580,7 @@ [local] exten =>_22XX,1,Dial(SIP/${EXTEN}) +exten =>2298,1,Record(/tmp/warning1:gsm,,3) [national] exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-6274.27689.14722 2010-10-26 14:24:37.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 14:25:25.000000000 +0300 @@ -580,7 +580,7 @@ [local] exten =>_22XX,1,Dial(SIP/${EXTEN}) -exten =>2298,1,Record(/tmp/warning1:gsm,,3) +;exten =>2298,1,Record(/tmp/warning1:gsm,,3) [national] exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-6274.26118.31391 2010-10-26 14:26:15.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 14:27:08.000000000 +0300 @@ -569,7 +569,7 @@ exten =>2203,1,Dial(SIP/2203) exten =>2204,1,Dial(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) -;exten =>2298,1,Record(/tmp/warning1:gsm,,3) +exten =>2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia ;exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) ;exten =>_20XX,1,Dial(SIP/br/${EXTEN}) |
#vi /etc/asterisk/extensions.conf
|
#include => local
SoX(1) Sound eXchange SoX(1) NAME SoX - Sound eXchange, the Swiss Army knife of audio manipulation SYNOPSIS sox [global-options] [format-options] infile1 [[format-options] infile2] ... [format-options] outfile [effect [effect-options]] ... play [global-options] [format-options] infile1 [[format-options] infile2] ... [format-options] [effect [effect-options]] ... ... rec -M take1.aiff take1-dub.aiff records a new track in a multi-track recording. Further examples are included throughout this manual; more-detailed examples can be found in soxexam(7). File Formats There are two types of audio file format that SoX can work with. The first is ‘self-describing’; these formats include a header that completely describes the characteristics of the audio data that follows. The second type is ‘headerless’ (or ‘raw data’); here, the audio data characteristics must be described using the SoX command line. The following four characteristics are sufficient to describe the format of audio data such that it can be processed with SoX: sample rate The sample rate in samples per second (‘Hertz’ or ‘Hz’). For example, digital telephony traditionally uses a sample rate of 8000 Hz |
#man play
|
#ls /tmp/
.ICE-unix/ l3-saved-2913.28927.9583 lost+found/ .X11-unix/ l3-saved-2758.1533.12585 l3-saved-5131.5837.12387 warning1.gsm |
#play /tmp/warning1.gsm
play soxio: Can't open input file `/tmp/warning1.gsm': unknown file type `gsm' |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-6274.31999.15031 2010-10-26 14:31:42.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 14:32:21.000000000 +0300 @@ -569,7 +569,7 @@ exten =>2203,1,Dial(SIP/2203) exten =>2204,1,Dial(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) -exten =>2298,1,Record(/tmp/warning1:gsm,,3) +exten => 2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia ;exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) ;exten =>_20XX,1,Dial(SIP/br/${EXTEN}) @@ -580,7 +580,7 @@ [local] exten =>_22XX,1,Dial(SIP/${EXTEN}) -;exten =>2298,1,Record(/tmp/warning1:gsm,,3) +;exten => 2298,1,Record(/tmp/warning1:gsm,,3) [national] exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) |
#asterisk -rcx "dialplan reload"
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= [ Booting... [ Reading Master Configuration ] [ Initializing Custom Configuration Options ] Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Dialplan reloaded. |
#asterisk -rcx "dialplan reload"
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= [ Booting... [ Reading Master Configuration ] [ Initializing Custom Configuration Options ] Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Dialplan reloaded. |
#uptime
14:39:00 up 5:00, 2 users, load average: 0.01, 0.01, 0.00 |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-7213.24362.11361 2010-10-26 14:50:37.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 14:54:41.000000000 +0300 @@ -581,7 +581,7 @@ ;exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [local] -exten =>_22XX,1,Dial(SIP/${EXTEN}) +;exten =>_22XX,1,Dial(SIP/${EXTEN}) exten => 2298,1,Record(/tmp/warning1:gsm,,3) exten => 2297,1,Playback(/tmp/warning1) |
#asterisk -rx "dialplan reload"
Dialplan reloaded. |
#include => local
; ; The "General" category is for certain variables. ; [general] ; ; If static is set to no, or omitted, then the pbx_config will rewrite ; this file when extensions are modified. Remember that all comments ; made in the file will be lost when that happens. ; ; XXX Not yet implemented XXX ... [international] exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [group1] include => local include => national include => international [group2] include => local include => national [group3] |
#include => local
[general] Found a swap file by the name "/etc/asterisk/.sip.conf.swp" context=default ; Default context for incoming calls owned by: root dated: Tue Oct 26 12:37:23 2010 allowoverlap=no ; Disable overlap dialing support. (Default is yes) file name: /etc/asterisk/sip.conf bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) modified: YES bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) user name: root host name: linux12.unix.nt ... callerid="Minsk Softphone 2203" cont [2204] [2204]riend secret=1234 callerid="Minsk 2204" context=group1 [bb] type=friend secret=1234 42,0-1 Top |
#[bb]
exten => 2298,1,Record(/tmp/warning1:gsm,,3) exten => 2297,1,Playback(/tmp/warning1) [national] exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) exten =>_20XX,1,Dial(SIP/br/${EXTEN}) exten =>_21XX,1,Dial(SIP/bb/${EXTEN}) [international] exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [group1] include => local ... ;exten =>2299,n,Playback(demo-thanks) exten =>2299,n,Hangup ;exten => 2297,1,Playback(/tmp/warning1) exten => _22XX,1,Dial(SIP/${EXTEN}) exten => _22XXX,1,Dial(SIP/1${EXTEN:1:4}) exten => _68XX,1,Wait(2) include => local [local] [ ] "/etc/asterisk/extensions.conf" 607L, 20983C written |
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Executing [2001@group1:1] Dial("SIP/2204-095c07d0", "SIP/br/2001") in new stack -- Called br/2001 -- SIP/br-095c8920 is circuit-busy == Everyone is busy/congested at this time (1:0/1/0) == Auto fallthrough, channel 'SIP/2204-095c07d0' status is 'CONGESTION' linux12*CLI> linux12*CLI> linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-7470.11739.18461 2010-10-26 15:03:22.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 15:03:41.000000000 +0300 @@ -581,7 +581,7 @@ ;exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [local] -;exten =>_22XX,1,Dial(SIP/${EXTEN}) +exten =>_22XX,1,Dial(SIP/${EXTEN}) exten => 2298,1,Record(/tmp/warning1:gsm,,3) exten => 2297,1,Playback(/tmp/warning1) |
#[group2]
exten =>2201,1,Dial(SIP/2201,1) exten =>2201,n,Dial(SIP/2204) ;exten =>2202,1,Dial(SIP/2202) exten =>2203,1,Dial(SIP/2203) exten =>2204,1,Dial(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) ;exten => 2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia ;exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) ;exten =>_20XX,1,Dial(SIP/br/${EXTEN}) ... [ ] exten =>_20XX,1,Dial(SIP/br/${EXTEN}) exten =>_21XX,1,Dial(SIP/bb/${EXTEN}) [international] [ ] [group1] [group1] include => national include => international include => localDial(SIP/bb/${EXTEN}) 601,0-1 98% |
#apt-get install tcpdump
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: tcpdump 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 306kB of archives. After this operation, 631kB of additional disk space will be used. Get:1 http://ftp.ua.debian.org lenny/main tcpdump 3.9.8-4 [306kB] Fetched 306kB in 2s (115kB/s) Selecting previously deselected package tcpdump. (Reading database ... 44806 files and directories currently installed.) Unpacking tcpdump (from .../tcpdump_3.9.8-4_i386.deb) ... Processing triggers for man-db ... Setting up tcpdump (3.9.8-4) ... |
#vi /etc/asterisk/extensions.conf
|
#[ ]
file name: /etc/asterisk/sip.conf bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) modified: YES bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) user name: root host name: linux12.unix.nt srvlookup=yes ; Enable DNS SRV lookups on outbound calls [ process]ID: 5639 [ ] [2201]opening file "/etc/asterisk/sip.conf" [2201]er=>mn:1234@192.168.111.1/bb ... -- INSERT -- 54,1 56% [gm] type=friend- 55,5 62% secret=1234 -- INSERT -- 56,12 68% host=dynamic -- INSERT -- 57,12 75% username=mn -- INSERT -- 58,13 81% "/etc/asterisk/sip.conf" 61L, 1149C written |
#asterisk -rx "sip reload"
|
#asterisk -rx "dialplan reload"
Dialplan reloaded. |
#asterisk -rx "sip reload"
|
#asterisk -rcv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... -- Called 2203 -- SIP/2203-095cb530 is ringing == Spawn extension (default, 2203, 1) exited non-zero on 'SIP/mn-095c07d0' -- Executing [2204@default:1] Dial("SIP/mn-095c07d0", "SIP/2204") in new stack -- Called 2204 -- SIP/2204-095cb530 is ringing == Spawn extension (default, 2204, 1) exited non-zero on 'SIP/mn-095c07d0' linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:37 inet addr:192.168.112.1 Bcast:192.168.112.255 Mask:255.255.255.0 inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:53537 errors:0 dropped:0 overruns:0 frame:0 TX packets:44252 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:10377859 (9.8 MiB) TX bytes:9210247 (8.7 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3527 errors:0 dropped:0 overruns:0 frame:0 TX packets:3527 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:179798 (175.5 KiB) TX bytes:179798 (175.5 KiB) |
#fg
register=>mn:1234@192.168.111.1/bb register=>mn:1234@192.168.110.1/br register=>mn:1234@192.168.109.1/gm [authentication] [2201] type=friend secret=1234 host=dynamic callerid="Andrey_2201" context=group1 ; group1 context for incoming calls ... host=dynamic callerid="Andrey_2201" context=group1 [2005] type=friend secret=1234 host=dynamic callerid="Andrey_2201" context=group1 [bb] |
#type=friend
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... 2005 (Unspecified) D 0 Unmonitored 2204/2204 192.168.112.11 D 5060 Unmonitored 2203/2203 192.168.112.2 D 5060 Unmonitored 2202/2202 192.168.112.2 D 1695 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 8 sip peers [Monitored: 0 online, 0 offline Unmonitored: 6 online, 2 offline] [Oct 26 16:03:03] NOTICE[2616]: chan_sip.c:15642 handle_request_register: Registration from 'sip:2205@192.168.112.1' failed for '192.168.112.11' - No matching peer found linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/sip.conf
|
#vi /etc/asterisk/sip.conf
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:37 inet addr:192.168.112.1 Bcast:192.168.112.255 Mask:255.255.255.0 inet6 addr: fe80::21b:fcff:fe7d:bb37/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:56677 errors:0 dropped:0 overruns:0 frame:0 TX packets:46966 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:10957145 (10.4 MiB) TX bytes:9871922 (9.4 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3529 errors:0 dropped:0 overruns:0 frame:0 TX packets:3529 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:180510 (176.2 KiB) TX bytes:180510 (176.2 KiB) |
#vi /etc/asterisk/sip.conf
|
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-7213.14836.28204 2010-10-26 16:19:18.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 16:20:20.000000000 +0300 @@ -564,8 +564,10 @@ exten => _68XX,n,Dial(SIP/22${EXTEN:2}) -exten =>2201,1,Dial(SIP/2201,1) -exten =>2201,n,Dial(SIP/2204) +exten =>2201,1,Dial(SIP/2201,5) +exten =>2204,n,Dial(SIP/2204,5) +exten =>2205,n,Dial(SIP/2205) + ;exten =>2202,1,Dial(SIP/2202) exten =>2203,1,Dial(SIP/2203) |
#vi /etc/asterisk/sip.conf
|
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-7213.12068.19896 2010-10-26 16:23:01.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 16:23:30.000000000 +0300 @@ -564,8 +564,8 @@ exten => _68XX,n,Dial(SIP/22${EXTEN:2}) -exten =>2201,1,Dial(SIP/2201,5) -exten =>2204,n,Dial(SIP/2204,5) +exten =>2201,1,Dial(SIP/2201,1) +exten =>2204,n,Dial(SIP/2204,1) exten =>2205,n,Dial(SIP/2205) |
#vi /etc/asterisk/extensions.conf
|
#[ ]
Reading package lists... Done Building dependency tree Reading state information... Done Package bind is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: manpages dnsutils bind9 E: Package bind has no installation candidate |
; extensions.conf - the Asterisk dial plan ; ; Static extension configuration file, used by ; the pbx_config module. This is where you configure all your ; inbound and outbound calls in Asterisk. ; ; This configuration file is reloaded ; - With the "dialplan reload" command in the CLI ; - With the "reload" command (that reloads everything) in the CLI ; ; The "General" category is for certain variables. ; [general] ; ; If static is set to no, or omitted, then the pbx_config will rewrite ; this file when extensions are modified. Remember that all comments ; made in the file will be lost when that happens. ; ; XXX Not yet implemented XXX ; static=yes ; ; if static=yes and writeprotect=no, you can save dialplan by ; CLI command "dialplan save" too ; writeprotect=no ; ; If autofallthrough is set, then if an extension runs out of ; things to do, it will terminate the call with BUSY, CONGESTION ; or HANGUP depending on Asterisk's best guess. This is the default. ; ; If autofallthrough is not set, then if an extension runs out of ; things to do, Asterisk will wait for a new extension to be dialed ; (this is the original behavior of Asterisk 1.0 and earlier). ; ;autofallthrough=no ; ; If clearglobalvars is set, global variables will be cleared ; and reparsed on an extensions reload, or Asterisk reload. ; ; If clearglobalvars is not set, then global variables will persist ; through reloads, and even if deleted from the extensions.conf or ; one of its included files, will remain set to the previous value. ; ; NOTE: A complication sets in, if you put your global variables into ; the AEL file, instead of the extensions.conf file. With clearglobalvars ; set, a "reload" will often leave the globals vars cleared, because it ; is not unusual to have extensions.conf (which will have no globals) ; load after the extensions.ael file (where the global vars are stored). ; So, with "reload" in this particular situation, first the AEL file will ; clear and then set all the global vars, then, later, when the extensions.conf ; file is loaded, the global vars are all cleared, and then not set, because ; they are not stored in the extensions.conf file. ; clearglobalvars=no ; ; If priorityjumping is set to 'yes', then applications that support ; 'jumping' to a different priority based on the result of their operations ; will do so (this is backwards compatible behavior with pre-1.2 releases ; of Asterisk). Individual applications can also be requested to do this ; by passing a 'j' option in their arguments. ; ;priorityjumping=yes ; ; User context is where entries from users.conf are registered. The ; default value is 'default' ; ;userscontext=default ; ; You can include other config files, use the #include command ; (without the ';'). Note that this is different from the "include" command ; that includes contexts within other contexts. The #include command works ; in all asterisk configuration files. ;#include "filename.conf" ; The "Globals" category contains global variables that can be referenced ; in the dialplan with the GLOBAL dialplan function: ; ${GLOBAL(VARIABLE)} ; ${${GLOBAL(VARIABLE)}} or ${text${GLOBAL(VARIABLE)}} or any hybrid ; Unix/Linux environmental variables can be reached with the ENV dialplan ; function: ${ENV(VARIABLE)} ; [globals] CONSOLE=Console/dsp ; Console interface for demo ;CONSOLE=Zap/1 ;CONSOLE=Phone/phone0 IAXINFO=guest ; IAXtel username/password ;IAXINFO=myuser:mypass TRUNK=Zap/G2 ; Trunk interface ; ; Note the 'G2' in the TRUNK variable above. It specifies which group (defined ; in zapata.conf) to dial, i.e. group 2, and how to choose a channel to use in ; the specified group. The four possible options are: ; ; g: select the lowest-numbered non-busy Zap channel ; (aka. ascending sequential hunt group). ; G: select the highest-numbered non-busy Zap channel ; (aka. descending sequential hunt group). ; r: use a round-robin search, starting at the next highest channel than last ; time (aka. ascending rotary hunt group). ; R: use a round-robin search, starting at the next lowest channel than last ; time (aka. descending rotary hunt group). ; TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0) ;TRUNK=IAX2/user:pass@provider ; ; Any category other than "General" and "Globals" represent ; extension contexts, which are collections of extensions. ; ; Extension names may be numbers, letters, or combinations ; thereof. If an extension name is prefixed by a '_' ; character, it is interpreted as a pattern rather than a ; literal. In patterns, some characters have special meanings: ; ; X - any digit from 0-9 ; Z - any digit from 1-9 ; N - any digit from 2-9 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9) ; . - wildcard, matches anything remaining (e.g. _9011. matches ; anything starting with 9011 excluding 9011 itself) ; ! - wildcard, causes the matching process to complete as soon as ; it can unambiguously determine that no other matches are possible ; ; For example the extension _NXXXXXX would match normal 7 digit dialings, ; while _1NXXNXXXXXX would represent an area code plus phone number ; preceded by a one. ; ; Each step of an extension is ordered by priority, which must ; always start with 1 to be considered a valid extension. The priority ; "next" or "n" means the previous priority plus one, regardless of whether ; the previous priority was associated with the current extension or not. ; The priority "same" or "s" means the same as the previously specified ; priority, again regardless of whether the previous entry was for the ; same extension. Priorities may be immediately followed by a plus sign ; and another integer to add that amount (most useful with 's' or 'n'). ; Priorities may then also have an alias, or label, in ; parenthesis after their name which can be used in goto situations ; ; Contexts contain several lines, one for each step of each ; extension, which can take one of two forms as listed below, ; with the first form being preferred. ; ;[context] ;exten => someexten,{priority|label{+|-}offset}[(alias)],application(arg1,arg2,...) ;exten => someexten,{priority|label{+|-}offset}[(alias)],application,arg1|arg2... ; ; Included Contexts ; ; One may include another context in the current one as well, optionally with a ; date and time. Included contexts are included in the order ; they are listed. ; The reason a context would include other contexts is for their ; extensions. ; The algorithm to find an extension is recursive, and works in this ; fashion: ; first, given a stack on which to store context references, ; push the context to find the extension onto the stack... ; a) Try to find a matching extension in the context at the top of ; the stack, and, if found, begin executing the priorities ; there in sequence. ; b) If not found, Search the switches, if any declared, in ; sequence. ; c) If still not found, for each include, push that context onto ; the top of the context stack, and recurse to a). ; d) If still not found, pop the entry from the top of the stack; ; if the stack is empty, the search has failed. If it's not, ; continue with the next context in c). ; This is a depth-first traversal, and stops with the first context ; that provides a matching extension. As usual, if more than one ; pattern in a context will match, the 'best' match will win. ; Please note that that extensions found in an included context are ; treated as if they were in the context from which the search began. ; The PBX's notion of the "current context" is not changed. ; Please note that in a context, it does not matter where an include ; directive occurs. Whether at the top, or near the bottom, the effect ; will be the same. The only thing that matters is that if there is ; more than one include directive, they will be searched for extensions ; in order, first to last. ; Also please note that pattern matches (like _9XX) are not treated ; any differently than exact matches (like 987). Also note that the ; order of extensions in a context have no affect on the outcome. ; ; Timing list for includes is ; ; <time range>|<days of week>|<days of month>|<months> ; ; Note that ranges may be specified to wrap around the ends. Also, minutes are ; fine-grained only down to the closest even minute. ; ;include => daytime|9:00-17:00|mon-fri|*|* ;include => weekend|*|sat-sun|*|* ;include => weeknights|17:02-8:58|mon-fri|*|* ; ; ignorepat can be used to instruct drivers to not cancel dialtone upon ; receipt of a particular pattern. The most commonly used example is ; of course '9' like this: ; ;ignorepat => 9 ; ; so that dialtone remains even after dialing a 9. ; ; ; Sample entries for extensions.conf ; ; [dundi-e164-canonical] ; ; List canonical entries here ; ;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo) ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7}) [dundi-e164-customers] ; ; If you are an ITSP or Reseller, list your customers here. ; ;exten => _12564286000,1,Dial(SIP/customer1) ;exten => _12564286001,1,Dial(IAX2/customer2) [dundi-e164-via-pstn] ; ; If you are freely delivering calls to the PSTN, list them here ; ;exten => _1256428XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Expose all of 256-428 ;exten => _1256325XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Ditto for 256-325 [dundi-e164-local] ; ; Context to put your dundi IAX2 or SIP user in for ; full access ; include => dundi-e164-canonical include => dundi-e164-customers include => dundi-e164-via-pstn [dundi-e164-switch] ; ; Just a wrapper for the switch ; switch => DUNDi/e164 [dundi-e164-lookup] ; ; Locally to lookup, try looking for a local E.164 solution ; then try DUNDi if we don't have one. ; include => dundi-e164-local include => dundi-e164-switch ; ; DUNDi can also be implemented as a Macro instead of using ; the Local channel driver. ; [macro-dundi-e164] ; ; ARG1 is the extension to Dial ; ; Extension "s" is not a wildcard extension that matches "anything". ; In macros, it is the start extension. In most other cases, ; you have to goto "s" to execute that extension. ; ; For wildcard matches, see above - all pattern matches start with ; an underscore. exten => s,1,Goto(${ARG1},1) include => dundi-e164-lookup ; ; Here are the entries you need to participate in the IAXTEL ; call routing system. Most IAXTEL numbers begin with 1-700, but ; there are exceptions. For more information, and to sign ; up, please go to www.gnophone.com or www.iaxtel.com ; [iaxtel700] exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel) ; ; The SWITCH statement permits a server to share the dialplan with ; another server. Use with care: Reciprocal switch statements are not ; allowed (e.g. both A -> B and B -> A), and the switched server needs ; to be on-line or else dialing can be severly delayed. ; [iaxprovider] ;switch => IAX2/user:[key]@myserver/mycontext [trunkint] ; ; International long distance through trunk ; exten => _9011.,1,Macro(dundi-e164,${EXTEN:4}) exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) [trunkld] ; ; Long distance context accessed through trunk ; exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1}) exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) [trunklocal] ; ; Local seven-digit dialing accessed through trunk interface ; exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) [trunktollfree] ; ; Long distance context accessed through trunk interface ; exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) [international] ; ; Master context for international long distance ; ignorepat => 9 include => longdistance include => trunkint [longdistance] ; ; Master context for long distance ; ignorepat => 9 include => local include => trunkld [local] ; ; Master context for local, toll-free, and iaxtel calls only ; ignorepat => 9 include => default include => trunklocal include => iaxtel700 include => trunktollfree include => iaxprovider ;Include parkedcalls (or the context you define in features conf) ;to enable call parking. include => parkedcalls ; ; You can use an alternative switch type as well, to resolve ; extensions that are not known here, for example with remote ; IAX switching you transparently get access to the remote ; Asterisk PBX ; ; switch => IAX2/user:password@bigserver/local ; ; An "lswitch" is like a switch but is literal, in that ; variable substitution is not performed at load time ; but is passed to the switch directly (presumably to ; be substituted in the switch routine itself) ; ; lswitch => Loopback/12${EXTEN}@othercontext ; ; An "eswitch" is like a switch but the evaluation of ; variable substitution is performed at runtime before ; being passed to the switch routine. ; ; eswitch => IAX2/context@${CURSERVER} [macro-trunkdial] ; ; Standard trunk dial macro (hangs up on a dialstatus that should ; terminate call) ; ${ARG1} - What to dial ; exten => s,1,Dial(${ARG1}) exten => s,n,Goto(s-${DIALSTATUS},1) exten => s-NOANSWER,1,Hangup exten => s-BUSY,1,Hangup exten => _s-.,1,NoOp [macro-stdexten]; ; ; Standard extension macro: ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well ; ${ARG2} - Device(s) to ring ; exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain [macro-stdPrivacyexten]; ; ; Standard extension macro: ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well ; ${ARG2} - Device(s) to ring ; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority) ; ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)` ; exten => s,1,Dial(${ARG2},20|p) ; Ring the interface, 20 seconds maximum, call screening ; option (or use P for databased call screening) exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start exten => s-DONTCALL,1,Goto(${ARG3},s,1) ; Callee chose to send this call to a polite "Don't call again" script. exten => s-TORTURE,1,Goto(${ARG4},s,1) ; Callee chose to send this call to a telemarketer torture script. exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain [macro-page]; ; ; Paging macro: ; ; Check to see if SIP device is in use and DO NOT PAGE if they are ; ; ${ARG1} - Device to page exten => s,1,ChanIsAvail(${ARG1}|js) ; j is for Jump and s is for ANY call exten => s,n,GoToIf([${AVAILSTATUS} = "1"]?autoanswer:fail) exten => s,n(autoanswer),Set(_ALERT_INFO="RA") ; This is for the PolyComs exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!! exten => s,n,Dial(${ARG1}||) exten => s,n(fail),Hangup [demo] ; ; We start with what to do when a call first comes in. ; exten => s,1,Wait(1) ; Wait a second, just for fun exten => s,n,Answer ; Answer the line exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions exten => s,n,WaitExten ; Wait for an extension to be dialed. exten => 2,1,BackGround(demo-moreinfo) ; Give some more information. exten => 2,n,Goto(s,instruct) exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french exten => 3,n,Goto(s,restart) ; Start with the congratulations exten => 1000,1,Goto(default,s,1) ; ; We also create an example user, 1234, who is on the console and has ; voicemail, etc. ; exten => 1234,1,Playback(transfer,skip) ; "Please hold while..." ; (but skip if channel is not up) exten => 1234,n,Macro(stdexten,1234,${GLOBAL(CONSOLE)}) exten => 1235,1,Voicemail(1234,u) ; Right to voicemail exten => 1236,1,Dial(Console/dsp) ; Ring forever exten => 1236,n,Voicemail(1234,b) ; Unless busy ; ; # for when they're done with the demo ; exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo" exten => #,n,Hangup ; Hang them up. ; ; A timeout and "invalid extension rule" ; exten => t,1,Goto(#,1) ; If they take too long, give up exten => i,1,Playback(invalid) ; "That's not valid, try again" ; ; Create an extension, 500, for dialing the ; Asterisk demo. ; exten => 500,1,Playback(demo-abouttotry); Let them know what's going on exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site exten => 500,n,Goto(s,6) ; Return to the start over message. ; ; Create an extension, 600, for evaluating echo latency. ; exten => 600,1,Playback(demo-echotest) ; Let them know what's going on exten => 600,n,Echo ; Do the echo test exten => 600,n,Playback(demo-echodone) ; Let them know it's over exten => 600,n,Goto(s,6) ; Start over ; ; You can use the Macro Page to intercom a individual user exten => 76245,1,Macro(page,SIP/Grandstream1) ; or if your peernames are the same as extensions exten => _7XXX,1,Macro(page,SIP/${EXTEN}) ; ; ; System Wide Page at extension 7999 ; exten => 7999,1,Set(TIMEOUT(absolute)=60) exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n|d) ; Give voicemail at extension 8500 ; exten => 8500,1,VoicemailMain exten => 8500,n,Goto(s,6) ; ; Here's what a phone entry would look like (IXJ for example) ; ;exten => 1265,1,Dial(Phone/phone0,15) ;exten => 1265,n,Goto(s,5) ; ; The page context calls up the page macro that sets variables needed for auto-answer ; It is in is own context to make calling it from the Page() application as simple as ; Local/{peername}@page ; [page] exten => _X.,1,Macro(page,SIP/${EXTEN}) ;[mainmenu] ; ; Example "main menu" context with submenu ; ;exten => s,1,Answer ;exten => s,n,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..." ;exten => s,n,WaitExten ;exten => 1,1,Goto(submenu,s,1) ;exten => 2,1,Hangup ;include => default ; ;[submenu] ;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback ;exten => s,n,Wait,2 ;exten => s,n,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..." ;exten => s,n,WaitExten ;exten => 1,1,Goto(default,steve,1) ;exten => 2,1,Goto(default,mark,2) [default] exten =>2299,1,Answer exten =>2299,n,Wait(1) exten =>2299,n,Playback(demo-thanks) exten =>2299,n,Hangup exten => _22XX,1,Dial(SIP/${EXTEN}) exten => _22XXX,1,Dial(SIP/1${EXTEN:1:4}) exten => _68XX,1,Wait(2) exten => _68XX,n,Playback(/tmp/warning1) exten => _68XX,n,Dial(SIP/22${EXTEN:2}) exten =>2201,1,Dial(SIP/2201,1) exten =>2201,n,Dial(SIP/2204) ;exten =>2202,1,Dial(SIP/2202) exten =>2203,1,Dial(SIP/2203) exten =>2204,1,Dial(SIP/2204) ;exten =>2201,1,Dial(SIP/2201) exten =>2298,1,Record(/tmp/warning1:gsm,,3) ;in Belorussia ;exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) ;exten =>_20XX,1,Dial(SIP/br/${EXTEN}) ;exten =>_21XX,1,Dial(SIP/bb/${EXTEN}) ;in other locations ;exten =>_21XX,1,Dial(SIP/ptr/${EXTEN}) ;exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [local] exten =>_22XX,1,Dial(SIP/mn/${EXTEN}) [national] exten =>_19XX,1,Dial(SIP/gm/${EXTEN}) exten =>_20XX,1,Dial(SIP/br/${EXTEN}) exten =>_21XX,1,Dial(SIP/bb/${EXTEN}) [international] exten =>_XXXX,1,Dial(SIP/bb/${EXTEN}) [group1] include => local include => national include => international [group2] include => local include => national [group3] include =>local
[general] context=default ; Default context for incoming calls allowoverlap=no ; Disable overlap dialing support. (Default is yes) bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) srvlookup=yes ; Enable DNS SRV lookups on outbound calls register=>mn:1234@192.168.111.1/bb register=>mn:1234@192.168.110.1/br register=>mn:1234@192.168.109.1/gm [authentication] [2201] type=friend secret=1234 host=dynamic callerid="Minsk 2201" context=group1 ; group1 context for incoming calls [2202] type=friend secret=1234 host=dynamic callerid="Minsk Softphone 2202" context=group3 ; group1 context for incoming calls [2203] type=friend secret=1234 host=dynamic callerid="Minsk Softphone 2203" context=group2 [2204] type=friend secret=1234 host=dynamic callerid="Minsk 2204" context=group1 [bb] type=friend secret=1234 host=dynamic username=mn [br] type=friend secret=1234 host=dynamic username=mn [gm] type=friend secret=1234 host=dynamic username=mn
Время первой команды журнала | 09:36:54 2010-10-26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:26:09 2010-10-26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 4.95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 5.18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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