/l3/users/Andrey/nt-voip/linux12.unix.nt.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 |
|
#ls -lah
total 64K drwxr-xr-x 4 andrey andrey 4.0K 2010-10-25 14:21 . drwxr-xr-x 4 root root 4.0K 2010-10-25 11:40 .. -rw------- 1 andrey andrey 121 2010-10-25 13:04 .bash_history -rw-r--r-- 1 andrey andrey 220 2010-10-25 11:40 .bash_logout -rw-r--r-- 1 andrey root 10 2010-10-25 14:21 .bash_profile -rw-r--r-- 1 andrey andrey 3.2K 2010-10-25 14:21 .bashrc drwx------ 3 root root 4.0K 2010-10-25 12:58 .dbus -rw------- 1 root root 179 2010-10-25 12:58 .ICEauthority -rw-r--r-- 1 root root 5.2K 2010-10-25 14:19 install -rw-r--r-- 1 andrey root 58 2010-10-25 14:21 .l3rc drwxr-xr-x 2 andrey root 4.0K 2010-10-25 14:21 .lilalo -rw-r--r-- 1 andrey andrey 675 2010-10-25 11:40 .profile -rw-r--r-- 1 root root 503 2010-10-25 12:03 q -rw------- 1 root root 61 2010-10-25 12:58 .Xauthority -rw------- 2 andrey andrey 0 2010-10-25 13:50 .Xauthority-c -rw------- 2 andrey andrey 0 2010-10-25 13:50 .Xauthority-l -rw------- 1 root root 995 2010-10-25 12:58 .xsession-errors |
#cat .l3rc
l3cd=/users/Andrey/nt-voip/linux12.unix.nt.unix.nt/andrey |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.0 U 0 0 0 eth0 default 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.0 U 0 0 0 eth0 default 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.0 U 0 0 0 eth0 default 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.0 U 0 0 0 eth0 default 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#host 192.168.1522
Host 192.168.1522 not found: 3(NXDOMAIN) |
#host 192.168.15.22
22.15.168.192.in-addr.arpa domain name pointer linux2.unix.nt. 22.15.168.192.in-addr.arpa domain name pointer esx2.unix.nt. |
#host 192.168.15.254
254.15.168.192.in-addr.arpa domain name pointer gw.unix.nt. |
#vi /etc/network/interfaces
|
#~
# and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface loaddress 192.168.112.1 netmask 255.255.255.0 network 192.168.112.0 broadcast 192.168.112.255 # The prgateway 192.168.15.254e # dns-* options are implemented by the resolvconf package, if installed allow-hodns-nameservers 10.0.35.1 ... ~ ~ ~ ~ ~ ~ ~ ~ ~ "/etc/network/interfaces" 18L, 519C written |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:37 inet addr:192.168.15.32 Bcast:192.168.15.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:24222 errors:0 dropped:0 overruns:0 frame:0 TX packets:8716 errors:0 dropped:0 overruns:0 carrier:3 collisions:0 txqueuelen:1000 RX bytes:17939533 (17.1 MiB) TX bytes:998400 (975.0 KiB) 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:31 errors:0 dropped:0 overruns:0 frame:0 TX packets:31 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1926 (1.8 KiB) TX bytes:1926 (1.8 KiB) |
#ls
install q |
#pwd
/home/andrey |
#ls -lah
.bash_history .bash_profile .dbus/ install .lilalo/ q .Xauthority-c .xsession-errors .bash_logout .bashrc .ICEauthority .l3rc .profile .Xauthority .Xauthority-l |
#find -name vim.rc /
find: paths must precede expression: / Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression] |
#find / -name vim.rc
|
#locate vim
locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory |
#whereis vim
vim: /usr/bin/vim /usr/bin/vim.tiny /usr/bin/vim.basic /etc/vim /usr/share/vim /usr/share/man/man1/vim.1.gz |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:37 inet addr:192.168.15.32 Bcast:192.168.15.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:26193 errors:0 dropped:0 overruns:0 frame:0 TX packets:9043 errors:0 dropped:0 overruns:0 carrier:7 collisions:0 txqueuelen:1000 RX bytes:18146041 (17.3 MiB) TX bytes:1044127 (1019.6 KiB) 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:31 errors:0 dropped:0 overruns:0 frame:0 TX packets:31 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1926 (1.8 KiB) TX bytes:1926 (1.8 KiB) |
#cat /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.112.1 netmask 255.255.255.0 network 192.168.112.0 broadcast 192.168.112.255 gateway 192.168.15.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 10.0.35.1 dns-search unix.nt |
#/etc/init.d/networking stop
Deconfiguring network interfaces...done. |
#apt-get install dhcp3-server
│ │ └───────────────────────────────────────────────────────────────────────────┘ Selecting previously deselected package dhcp3-server. (Reading database ... 40094 files and directories currently installed.) Unpacking dhcp3-server (from .../dhcp3-server_3.1.1-6+lenny4_i386.deb) ... Processing triggers for man-db ... Setting up dhcp3-server (3.1.1-6+lenny4) ... Generating /etc/default/dhcp3-server... Starting DHCP server: dhcpd3check syslog for diagnostics. failed! failed! invoke-rc.d: initscript dhcp3-server, action "start" failed. |
#vi /etc/dhcp3/dhcpd.conf
|
#: 8
|
#vi /etc/de
|
#vi /etc/def
|
#vi /etc/default/d
|
#vi /etc/default/dhcp3-server
--- /tmp/l3-saved-4675.1563.21928 2010-10-25 16:15:31.000000000 +0300 +++ /etc/default/dhcp3-server 2010-10-25 16:15:54.000000000 +0300 @@ -8,4 +8,4 @@ # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. "eth0 eth1". -INTERFACES="" +INTERFACES="eth0" |
#/etc/init.d/dhcp3-server start
Starting DHCP server: dhcpd3. |
#ps awwx | grep dhcp
4975 ? Ss 0:00 /usr/sbin/dhcpd3 -q eth0 |
#tail /var/lib/dhcp3/dhcpd.leases
lease 192.168.112.11 { starts 1 2010/10/25 13:45:10; ends 1 2010/10/25 13:55:10; cltt 1 2010/10/25 13:45:10; binding state active; next binding state free; hardware ethernet 00:13:80:78:1c:a2; uid "\001\000\023\200x\034\242"; client-hostname "SIP001380781CA2"; } |
#apt-get install nmap
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libpcap0.8 The following NEW packages will be installed: libpcap0.8 nmap 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 1143kB of archives. After this operation, 3936kB of additional disk space will be used. ... Get:2 http://ftp.ua.debian.org lenny/main nmap 4.62-1 [1049kB] Fetched 1143kB in 4s (265kB/s) Selecting previously deselected package libpcap0.8. (Reading database ... 40107 files and directories currently installed.) Unpacking libpcap0.8 (from .../libpcap0.8_0.9.8-5_i386.deb) ... Selecting previously deselected package nmap. Unpacking nmap (from .../archives/nmap_4.62-1_i386.deb) ... Processing triggers for man-db ... Setting up libpcap0.8 (0.9.8-5) ... Setting up nmap (4.62-1) ... |
#nmap 192.168.112.11
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 16:50 EEST All 1715 scanned ports on 192.168.112.11 are filtered MAC Address: 00:13:80:78:1C:A2 (Cisco Systems) Nmap done: 1 IP address (1 host up) scanned in 36.879 seconds |
#apt-get install asterisk
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: asterisk-config asterisk-sounds-main ca-certificates debhelper gettext html2text intltool-debian libc-client2007b libcompress-raw-zlib-perl libcompress-zlib-perl libcurl3 libdigest-hmac-perl libdigest-sha1-perl libfile-remove-perl libgsm1 libiksemel3 libio-compress-base-perl libio-compress-zlib-perl libio-stringy-perl libltdl3 libmail-box-perl libmail-sendmail-perl libmailtools-perl libmime-types-perl ... Setting up libio-stringy-perl (2.110-4) ... Setting up libmime-types-perl (1.24-1) ... Setting up libmailtools-perl (2.03-1) ... Setting up libobject-realize-later-perl (0.18-1) ... Setting up libuser-identity-perl (0.92-2) ... Setting up libmail-box-perl (2.082-2) ... Setting up libsys-hostname-long-perl (1.4-2) ... Setting up libmail-sendmail-perl (0.79-5) ... Setting up module-assistant (0.10.11.0) ... Setting up vpb-driver-source (4.2.38.1-1) ... |
#asterisk-sounds-extra asterisk-config
bash: asterisk-sounds-extra: command not found |
#apt-get install asterisk-sounds-extra asterisk-config
Reading package lists... Done Building dependency tree Reading state information... Done asterisk-config is already the newest version. asterisk-config set to manually installed. The following NEW packages will be installed: asterisk-sounds-extra 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 3224kB of archives. After this operation, 6291kB of additional disk space will be used. Get:1 http://ftp.ua.debian.org lenny/main asterisk-sounds-extra 1.4.7-1 [3224kB] Fetched 3224kB in 10s (317kB/s) Selecting previously deselected package asterisk-sounds-extra. (Reading database ... 43359 files and directories currently installed.) Unpacking asterisk-sounds-extra (from .../asterisk-sounds-extra_1.4.7-1_all.deb) ... Setting up asterisk-sounds-extra (1.4.7-1) ... |
#netstat -tnlp
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:5038 0.0.0.0:* LISTEN 9425/asterisk tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1990/portmap tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 9425/asterisk tcp 0 0 0.0.0.0:58578 0.0.0.0:* LISTEN 2005/rpc.statd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 4554/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2511/exim4 tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 2683/0 tcp6 0 0 :::22 :::* LISTEN 4554/sshd tcp6 0 0 ::1:6010 :::* LISTEN 2683/0 |
#dpkg -L asterisk
/. /etc /etc/asterisk /etc/logrotate.d /etc/logrotate.d/asterisk /etc/default /etc/default/asterisk /etc/init.d /etc/init.d/asterisk /usr ... /var/lib/asterisk /var/lib/asterisk/moh /var/lib/asterisk/sounds /var/lib/asterisk/sounds/custom /var/run /var/run/asterisk /usr/share/asterisk/sounds/recordings /usr/share/asterisk/sounds/custom /usr/share/man/man8/rasterisk.8.gz /usr/sbin/rasterisk |
#/etc/init.d/asterisk status
Asterisk PBX is running: 9425 |
#asterisk -rvv
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 ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': Found == Parsing '/etc/asterisk/extconfig.conf': Found Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 9425) Verbosity was 0 and is now 2 linux12*CLI> sip show pee peers peer linux12*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] linux12*CLI> quit Executing last minute cleanups |
#less /etc/asterisk/m
|
#less /var/log/asterisk/messages
|
#vi /etc/asterisk/sip.conf
|
#669 ; then UDPTL will flow to the remote device.
grep: /tmp/sip.conf: No such file or directory |
#grep -v "^\s*;" /etc/asterisk/sip.conf | grep -vx '' | less
|
#mv /etc/asterisk/sip.conf{,.orig}
|
#grep -v "^\s*;" /etc/asterisk/sip.conf | grep -vx '' > /etc/asterisk/sip.conf
|
#ls /etc/asterisk/sip.conf
/etc/asterisk/sip.conf |
#ls /etc/asterisk/sip.conf.orig
/etc/asterisk/sip.conf.orig |
#~
|
#grep -v "^\s*;" /etc/asterisk/sip.conf.orig | grep -vx '' | less
|
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-5286.2471.9554 2010-10-25 17:29:45.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-10-25 17:34:45.000000000 +0300 @@ -0,0 +1,14 @@ +[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 + + +[authentication] + +[1801] +type=friend +secret=1234 +host=dynamic |
#nmap 192.168.111.201
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 17:36 EEST Stats: 0:00:02 elapsed; 0 hosts completed (0 up), 0 undergoing Ping Scan Ping Scan Timing: About 50.00% done; ETC: 17:36 (0:00:02 remaining) |
#nmap 192.168.111.151
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 17:36 EEST Interesting ports on 192.168.111.151: Not shown: 1714 closed ports PORT STATE SERVICE 80/tcp open http Nmap done: 1 IP address (1 host up) scanned in 2.195 seconds |
#nmap 192.168.112.11
Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-25 17:36 EEST All 1715 scanned ports on 192.168.112.11 are filtered MAC Address: 00:13:80:78:1C:A2 (Cisco Systems) Nmap done: 1 IP address (1 host up) scanned in 36.859 seconds |
#tail /var/lib/dhcp3/dhcpd.leases
lease 192.168.112.11 { starts 1 2010/10/25 14:35:09; ends 1 2010/10/25 14:45:09; cltt 1 2010/10/25 14:35:09; binding state active; next binding state free; hardware ethernet 00:13:80:78:1c:a2; uid "\001\000\023\200x\034\242"; client-hostname "SIP001380781CA2"; } |
#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:51123 errors:0 dropped:0 overruns:0 frame:0 TX packets:36699 errors:0 dropped:0 overruns:0 carrier:9 collisions:0 txqueuelen:1000 RX bytes:43441568 (41.4 MiB) TX bytes:3338442 (3.1 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:470 errors:0 dropped:0 overruns:0 frame:0 TX packets:470 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:40833 (39.8 KiB) TX bytes:40833 (39.8 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 ========================================================================= ... linux12*CLI> sip show peer peers peer linux12*CLI> sip show peer peers peer linux12*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/extensions.conf
|
#vi /etc/asterisk/extensions.conf
--- /tmp/l3-saved-10112.10003.5433 2010-10-25 17:57:03.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-25 17:57:47.000000000 +0300 @@ -549,6 +549,10 @@ ;exten => 2,1,Goto(default,mark,2) [default] +exten =>1899,1,Answer +exten =>1899,n,Wait(1) +exten =>1899,n,Playback(demo-thanks) +exten =>1899,n,Hangup ; ; By default we include the demo. In a production system, you ; probably don't want to have the demo there. |
#vi /etc/asterisk/extensions.conf
|
#man scp
|
#scp root@192.168.108.1:/etc/asterisk/sip.conf.orig .
The authenticity of host '192.168.108.1 (192.168.108.1)' can't be established. RSA key fingerprint is da:4a:92:81:55:fc:a8:1b:fd:c8:e4:7a:2e:68:f0:fa. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.108.1' (RSA) to the list of known hosts. root@192.168.108.1's password: sip.conf.orig 100% 31KB 31.1KB/s 00:00 |
#cat sip.conf.orig
; ; SIP Configuration example for Asterisk ; ; Syntax for specifying a SIP device in extensions.conf is ; SIP/devicename where devicename is defined in a section below. ; ; You may also use ; SIP/username@domain to call any SIP user on the Internet ; (Don't forget to enable DNS SRV records if you want to use this) ; ... ;[pre14-asterisk] ;type=friend ;secret=digium ;host=dynamic ;rfc2833compensate=yes ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine. ; You must have this turned on or DTMF reception will work improperly. ;t38pt_usertpsource=yes ; Use the source IP address of RTP as the destination IP address for UDPTL packets ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the ; external IP address of the remote device. If port forwarding is done at the client side ; then UDPTL will flow to the remote device. |
#cat /etc/asterisk/sip.conf.orig
|
#rm /etc/asterisk/sip.conf.orig
|
#cp sip.conf.orig /etc/asterisk/
|
#less /etc/asterisk/sip.conf.orig
|
#asterisk -rcx "sip show peers"
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 = 9425) Name/username Host Dyn Nat ACL Port Status 1801/1801 192.168.112.2 D 5060 Unmonitored 1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline] |
#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 [authentication] [1801] type=friend secret=1234 host=dynamic |
#less /etc/asterisk/extensions.conf
|
#vi /etc/asterisk/sip.conf
--- /tmp/l3-saved-3040.9189.3119 2010-10-26 09:46:13.000000000 +0300 +++ /etc/asterisk/sip.conf 2010-10-26 09:46:52.000000000 +0300 @@ -8,7 +8,12 @@ [authentication] -[1801] +[2201] +type=friend +secret=1234 +host=dynamic + +[2202] type=friend secret=1234 host=dynamic |
#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 ========================================================================= Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Verbosity was 0 and is now 1 linux12*CLI> sip reload Reloading SIP linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#vi /etc/asterisk/sip.conf
|
#vi /etc/asterisk/ext
--- /tmp/l3-saved-3040.13874.18550 2010-10-26 09:50:35.000000000 +0300 +++ /etc/asterisk/extensions.conf 2010-10-26 09:53:13.000000000 +0300 @@ -549,10 +549,13 @@ ;exten => 2,1,Goto(default,mark,2) [default] -exten =>1899,1,Answer -exten =>1899,n,Wait(1) -exten =>1899,n,Playback(demo-thanks) -exten =>1899,n,Hangup +exten =>2299,1,Answer +exten =>2299,n,Wait(1) +exten =>2299,n,Playback(demo-thanks) +exten =>2299,n,Hangup + +exten =>2201,1,Dial(SIP/2201) +exten =>2202,2,DIal(SIP/2202) ; ; By default we include the demo. In a production system, you ; probably don't want to have the demo there. |
#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 ========================================================================= Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Verbosity is at least 1 linux12*CLI> extensions reload Dialplan reloaded. The 'extensions reload' command is deprecated and will be removed in a future release. Please use 'dialplan reload' instead. 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:2374 errors:0 dropped:0 overruns:0 frame:0 TX packets:1445 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:231331 (225.9 KiB) TX bytes:254639 (248.6 KiB) 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:11 errors:0 dropped:0 overruns:0 frame:0 TX packets:11 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1106 (1.0 KiB) TX bytes:1106 (1.0 KiB) |
#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 = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg)) ; ; For more information on applications, just type "core show applications" at your ; friendly Asterisk CLI prompt. ; ; "core show application <command>" will show details of how you ; use that particular application in this file, the dial plan. ; "core show functions" will list all dialplan functions ; "core show function <COMMAND>" will show you more information about ; one function. Remember that function names are UPPER CASE. |
#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 [authentication] [2201] type=friend secret=1234 host=dynamic [2202] type=friend secret=1234 host=dynamic |
#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 ========================================================================= Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Verbosity is at least 1 linux12*CLI> extensions reload Dialplan reloaded. linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#ls /tmp/warning1.gsm
/tmp/warning1.gsm |
#ls -lah /tmp/warning1.gsm
-rw-r----- 1 asterisk asterisk 0 2010-10-26 10:13 /tmp/warning1.gsm |
#less /etc/asterisk/extensions.conf
|
#asterisk -rcvvv
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 ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': Found == Parsing '/etc/asterisk/extconfig.conf': Found Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Verbosity was 1 and is now 3 linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#apt-get install sox
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libsamplerate0 libsox-fmt-alsa libsox-fmt-base libsox0 Suggested packages: libsox-fmt-all The following NEW packages will be installed: libsamplerate0 libsox-fmt-alsa libsox-fmt-base libsox0 sox 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. ... Selecting previously deselected package libsox-fmt-base. Unpacking libsox-fmt-base (from .../libsox-fmt-base_14.0.1-2+b1_i386.deb) ... Selecting previously deselected package sox. Unpacking sox (from .../sox_14.0.1-2+b1_i386.deb) ... Processing triggers for man-db ... Setting up libsamplerate0 (0.1.4-1) ... Setting up libsox0 (14.0.1-2+b1) ... Setting up libsox-fmt-alsa (14.0.1-2+b1) ... Setting up libsox-fmt-base (14.0.1-2+b1) ... Setting up sox (14.0.1-2+b1) ... |
#man sox
|
#sox /tmp/
.ICE-unix/ l3-saved-2758.1533.12585 l3-saved-2913.28927.9583 lost+found/ warning1.gsm .X11-unix/ |
#sox /tmp/warning1.gsm
sox: SoX v14.0.1 Failed: Not enough input filenames specified Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopts]]... SPECIAL FILENAMES: - stdin (infile) or stdout (outfile) -n use the null file handler; for use with e.g. synth & stat GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect): --buffer BYTES set the buffer size (default 8192) --combine concatenate concatenate multiple input files (default for sox, rec) --combine sequence sequence multiple input files (default for play) ... -N, --reverse-nibbles nibble-order -X, --reverse-bits bit-order of data -B/-L force endianness to big/little -s/-u/-U/-A/ sample encoding: signed/unsigned/u-law/A-law -a/-i/-g/-f ADPCM/IMA ADPCM/GSM/floating point -1/-2/-3/-4/-8 sample size in bytes -v, --volume FACTOR volume input file volume adjustment factor (real number) SUPPORTED FILE FORMATS: 8svx aif aifc aiff aiffc al alsa au auto avr cdda cdr cvs cvsd dat dvms fssd hcom ima ircam la lpc lpc10 lu m3u maud nist nul null pls prc raw s1 s2 s3 s4 sb sf sl smp snd sndt sou sph sw txw u1 u2 u3 u4 ub ul uw vms voc vox wav wavpcm wve xa SUPPORTED EFFECTS: allpass band bandpass bandreject bass chorus compand dcshift deemph dither earwax echo echos equalizer fade filter flanger highpass key ladspa lowpass mcompand mixer noiseprof noisered oops pad pan phaser polyphase rabbit repeat resample reverb reverse silence speed stat swap synth tempo treble tremolo trim vol effopts: depends on effect |
#vi /etc/asterisk/extensions.conf
|
#exten =>2298,1,Record(/tmp/warning1:gsm,,3)
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, 2299, 4) exited non-zero on 'SIP/2202-095b1160' peers Name/username Host Dyn Nat ACL Port Status 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 192.168.112.2 D 5060 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] -- Unregistered SIP '2201' 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 ========================================================================= Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Verbosity is at least 3 linux12*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 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 ========================================================================= Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux12 (pid = 2552) Verbosity is at least 3 linux12*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 2202/2202 192.168.112.2 D 1193 Unmonitored 2201/2201 (Unspecified) D 0 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline] linux12*CLI> quit Executing last minute cleanups Asterisk cleanly ending (0). |
#ping 192.168.122.11
PING 192.168.122.11 (192.168.122.11) 56(84) bytes of data. ^C --- 192.168.122.11 ping statistics --- 6 packets transmitted, 0 received, 100% packet loss, time 4999ms |
#ping 192.168.112.11
PING 192.168.112.11 (192.168.112.11) 56(84) bytes of data. 64 bytes from 192.168.112.11: icmp_seq=1 ttl=64 time=10.4 ms 64 bytes from 192.168.112.11: icmp_seq=2 ttl=64 time=0.802 ms 64 bytes from 192.168.112.11: icmp_seq=3 ttl=64 time=0.906 ms 64 bytes from 192.168.112.11: icmp_seq=4 ttl=64 time=0.800 ms 64 bytes from 192.168.112.11: icmp_seq=5 ttl=64 time=0.790 ms 64 bytes from 192.168.112.11: icmp_seq=6 ttl=64 time=0.799 ms 64 bytes from 192.168.112.11: icmp_seq=7 ttl=64 time=0.824 ms 64 bytes from 192.168.112.11: icmp_seq=8 ttl=64 time=0.790 ms 64 bytes from 192.168.112.11: icmp_seq=9 ttl=64 time=0.797 ms ... 64 bytes from 192.168.112.11: icmp_seq=13 ttl=64 time=0.791 ms 64 bytes from 192.168.112.11: icmp_seq=14 ttl=64 time=0.798 ms 64 bytes from 192.168.112.11: icmp_seq=15 ttl=64 time=0.790 ms 64 bytes from 192.168.112.11: icmp_seq=16 ttl=64 time=0.825 ms 64 bytes from 192.168.112.11: icmp_seq=17 ttl=64 time=0.791 ms 64 bytes from 192.168.112.11: icmp_seq=18 ttl=64 time=0.791 ms ^C --- 192.168.112.11 ping statistics --- 18 packets transmitted, 18 received, 0% packet loss, time 17006ms rtt min/avg/max/mdev = 0.790/1.346/10.447/2.207 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 [authentication] [2201] type=friend secret=1234 host=dynamic [2202] type=friend secret=1234 host=dynamic |
#vim /etc/asterisk/sip.conf
|
#rm /etc/asterisk/.sip.conf.sw
rm: cannot remove `/etc/asterisk/.sip.conf.sw': No such file or directory |
#rm /etc/asterisk/.sip.conf.sw*
|
l3cd=/users/Andrey/nt-voip/linux12.unix.nt.unix.nt/andrey
; 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 =>2201,1,Dial(SIP/2201) exten =>2202,2,DIal(SIP/2202) ; ; By default we include the demo. In a production system, you ; probably don't want to have the demo there. ; include => demo ; ; An extension like the one below can be used for FWD, Nikotel, sipgate etc. ; Note that you must have a [sipprovider] section in sip.conf ; ;exten => _41X.,1,Dial(SIP/${EXTEN:2}@sipprovider,,r) ; Real extensions would go here. Generally you want real extensions to be ; 4 or 5 digits long (although there is no such requirement) and start with a ; single digit that is fairly large (like 6 or 7) so that you have plenty of ; room to overlap extensions and menu options without conflict. You can alias ; them with names, too, and use global variables ;exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1,Joe Schmoe ; Channel hints for presence ;exten => 6245,1,Dial(SIP/Grandstream1,20,rt) ; permit transfer ;exten => 6245,n(dial),Dial(${HINT},20,rtT) ; Use hint as listed ;exten => 6245,n,Voicemail(6245,u) ; Voicemail (unavailable) ;exten => 6245,s+1,Hangup ; s+1, same as n ;exten => 6245,dial+101,Voicemail(6245,b) ; Voicemail (busy) ;exten => 6361,1,Dial(IAX2/JaneDoe,,rm) ; ring without time limit ;exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14) ;exten => 6390,1,Dial(JINGLE/caller/callee) ; Dial via jingle using labels ;exten => 6391,1,Dial(JINGLE/asterisk@digium.com/mogorman@astjab.org) ;Dial via jingle using asterisk as the transport and calling mogorman. ;exten => 6394,1,Dial(Local/6275/n) ; this will dial ${MARK} ;exten => 6275,1,Macro(stdexten,6275,${MARK}) ; assuming ${MARK} is something like Zap/2 ;exten => mark,1,Goto(6275|1) ; alias mark to 6275 ;exten => 6536,1,Macro(stdexten,6236,${WIL}) ; Ditto for wil ;exten => wil,1,Goto(6236|1) ;If you want to subscribe to the status of a parking space, this is ;how you do it. Subscribe to extension 6600 in sip, and you will see ;the status of the first parking lot with this extensions' help ;exten => 6600,hint,park:701@parkedcalls ;exten => 6600,1,noop ; ; Some other handy things are an extension for checking voicemail via ; voicemailmain ; ;exten => 8500,1,VoicemailMain ;exten => 8500,n,Hangup ; ; Or a conference room (you'll need to edit meetme.conf to enable this room) ; ;exten => 8600,1,Meetme(1234) ; ; Or playing an announcement to the called party, as soon it answers ; ;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg)) ; ; For more information on applications, just type "core show applications" at your ; friendly Asterisk CLI prompt. ; ; "core show application <command>" will show details of how you ; use that particular application in this file, the dial plan. ; "core show functions" will list all dialplan functions ; "core show function <COMMAND>" will show you more information about ; one function. Remember that function names are UPPER CASE.
[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 [authentication] [2201] type=friend secret=1234 host=dynamic [2202] type=friend secret=1234 host=dynamic
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.112.1 netmask 255.255.255.0 network 192.168.112.0 broadcast 192.168.112.255 gateway 192.168.15.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 10.0.35.1 dns-search unix.nt
; ; SIP Configuration example for Asterisk ; ; Syntax for specifying a SIP device in extensions.conf is ; SIP/devicename where devicename is defined in a section below. ; ; You may also use ; SIP/username@domain to call any SIP user on the Internet ; (Don't forget to enable DNS SRV records if you want to use this) ; ; If you define a SIP proxy as a peer below, you may call ; SIP/proxyhostname/user or SIP/user@proxyhostname ; where the proxyhostname is defined in a section below ; ; Useful CLI commands to check peers/users: ; sip show peers Show all SIP peers (including friends) ; sip show users Show all SIP users (including friends) ; sip show registry Show status of hosts we register with ; ; sip debug Show all SIP messages ; ; reload chan_sip.so Reload configuration file ; Active SIP peers will not be reconfigured ; [general] context=default ; Default context for incoming calls ;allowguest=no ; Allow or reject guest calls (default is yes) allowoverlap=no ; Disable overlap dialing support. (Default is yes) ;allowtransfer=no ; Disable all transfers (unless enabled in peers or users) ; Default is enabled ;realm=mydomain.tld ; Realm for digest authentication ; defaults to "asterisk". If you set a system name in ; asterisk.conf, it defaults to that system name ; Realms MUST be globally unique according to RFC 3261 ; Set this to your host name or domain name bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) ; bindport is the local UDP port that Asterisk will listen on 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 ; Note: Asterisk only uses the first host ; in SRV records ; Disabling DNS SRV lookups disables the ; ability to place SIP calls based on domain ; names to some other SIP users on the Internet ;domain=mydomain.tld ; Set default domain for this host ; If configured, Asterisk will only allow ; INVITE and REFER to non-local domains ; Use "sip show domains" to list local domains ;pedantic=yes ; Enable checking of tags in headers, ; international character conversions in URIs ; and multiline formatted headers for strict ; SIP compatibility (defaults to "no") ; See doc/ip-tos.txt for a description of these parameters. ;tos_sip=cs3 ; Sets TOS for SIP packets. ;tos_audio=ef ; Sets TOS for RTP audio packets. ;tos_video=af41 ; Sets TOS for RTP video packets. ;maxexpiry=3600 ; Maximum allowed time of incoming registrations ; and subscriptions (seconds) ;minexpiry=60 ; Minimum length of registrations/subscriptions (default 60) ;defaultexpiry=120 ; Default length of incoming/outgoing registration ;t1min=100 ; Minimum roundtrip time for messages to monitored hosts ; Defaults to 100 ms ;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY ;checkmwi=10 ; Default time between mailbox checks for peers ;buggymwi=no ; Cisco SIP firmware doesn't support the MWI RFC ; fully. Enable this option to not get error messages ; when sending MWI to phones with this bug. ;vmexten=voicemail ; dialplan extension to reach mailbox sets the ; Message-Account in the MWI notify message ; defaults to "asterisk" ;disallow=all ; First disallow all codecs ;allow=ulaw ; Allow codecs in order of preference ;allow=ilbc ; see doc/rtp-packetization for framing options ; ; This option specifies a preference for which music on hold class this channel ; should listen to when put on hold if the music class has not been set on the ; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer ; channel putting this one on hold did not suggest a music class. ; ; This option may be specified globally, or on a per-user or per-peer basis. ; ;mohinterpret=default ; ; This option specifies which music on hold class to suggest to the peer channel ; when this channel places the peer on hold. It may be specified globally or on ; a per-user or per-peer basis. ; ;mohsuggest=default ; ;language=en ; Default language setting for all users/peers ; This may also be set for individual users/peers ;relaxdtmf=yes ; Relax dtmf handling ;trustrpid = no ; If Remote-Party-ID should be trusted ;sendrpid = yes ; If Remote-Party-ID should be sent ;progressinband=never ; If we should generate in-band ringing always ; use 'never' to never use in-band signalling, even in cases ; where some buggy devices might not render it ; Valid values: yes, no, never Default: never ;useragent=Asterisk PBX ; Allows you to change the user agent string ;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address ; Note that promiscredir when redirects are made to the ; local system will cause loops since Asterisk is incapable ; of performing a "hairpin" call. ;usereqphone = no ; If yes, ";user=phone" is added to uri that contains ; a valid phone number ;dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833 ; Other options: ; info : SIP INFO messages ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw) ; auto : Use rfc2833 if offered, inband otherwise ;compactheaders = yes ; send compact sip headers. ; ;videosupport=yes ; Turn on support for SIP video. You need to turn this on ; in the this section to get any video support at all. ; You can turn it off on a per peer basis if the general ; video support is enabled, but you can't enable it for ; one peer only without enabling in the general section. ;maxcallbitrate=384 ; Maximum bitrate for video calls (default 384 kb/s) ; Videosupport and maxcallbitrate is settable ; for peers and users as well ;callevents=no ; generate manager events when sip ua ; performs events (e.g. hold) ;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected, ; for any reason, always reject with '401 Unauthorized' ; instead of letting the requester know whether there was ; a matching user or peer for their request ;g726nonstandard = yes ; If the peer negotiates G726-32 audio, use AAL2 packing ; order instead of RFC3551 packing order (this is required ; for Sipura and Grandstream ATAs, among others). This is ; contrary to the RFC3551 specification, the peer _should_ ; be negotiating AAL2-G726-32 instead :-( ;matchexterniplocally = yes ; Only substitute the externip or externhost setting if it matches ; your localnet setting. Unless you have some sort of strange network ; setup you will not need to enable this. ; ; If regcontext is specified, Asterisk will dynamically create and destroy a ; NoOp priority 1 extension for a given peer who registers or unregisters with ; us and have a "regexten=" configuration item. ; Multiple contexts may be specified by separating them with '&'. The ; actual extension is the 'regexten' parameter of the registering peer or its ; name if 'regexten' is not provided. If more than one context is provided, ; the context must be specified within regexten by appending the desired ; context after '@'. More than one regexten may be supplied if they are ; separated by '&'. Patterns may be used in regexten. ; ;regcontext=sipregistrations ; ;--------------------------- RTP timers ---------------------------------------------------- ; These timers are currently used for both audio and video streams. The RTP timeouts ; are only applied to the audio channel. ; The settings are settable in the global section as well as per device ; ;rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity ; on the audio channel ; when we're not on hold. This is to be able to hangup ; a call in the case of a phone disappearing from the net, ; like a powerloss or grandma tripping over a cable. ;rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity ; on the audio channel ; when we're on hold (must be > rtptimeout) ;rtpkeepalive=<secs> ; Send keepalives in the RTP stream to keep NAT open ; (default is off - zero) ;--------------------------- SIP DEBUGGING --------------------------------------------------- ;sipdebug = yes ; Turn on SIP debugging by default, from ; the moment the channel loads this configuration ;recordhistory=yes ; Record SIP history by default ; (see sip history / sip no history) ;dumphistory=yes ; Dump SIP history at end of SIP dialogue ; SIP history is output to the DEBUG logging channel ;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ---------------------------- ; You can subscribe to the status of extensions with a "hint" priority ; (See extensions.conf.sample for examples) ; chan_sip support two major formats for notifications: dialog-info and SIMPLE ; ; You will get more detailed reports (busy etc) if you have a call limit set ; for a device. When the call limit is filled, we will indicate busy. Note that ; you need at least 2 in order to be able to do attended transfers. ; ; For queues, you will need this level of detail in status reporting, regardless ; if you use SIP subscriptions. Queues and manager use the same internal interface ; for reading status information. ; ; Note: Subscriptions does not work if you have a realtime dialplan and use the ; realtime switch. ; ;allowsubscribe=no ; Disable support for subscriptions. (Default is yes) ;subscribecontext = default ; Set a specific context for SUBSCRIBE requests ; Useful to limit subscriptions to local extensions ; Settable per peer/user also ;notifyringing = yes ; Notify subscriptions on RINGING state (default: no) ;notifyhold = yes ; Notify subscriptions on HOLD state (default: no) ; Turning on notifyringing and notifyhold will add a lot ; more database transactions if you are using realtime. ;limitonpeers = yes ; Apply call limits on peers only. This will improve ; status notification when you are using type=friend ; Inbound calls, that really apply to the user part ; of a friend will now be added to and compared with ; the peer limit instead of applying two call limits, ; one for the peer and one for the user. ; "sip show inuse" will only show active calls on ; the peer side of a "type=friend" object if this ; setting is turned on. ;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT ----------------------- ; ; This setting is available in the [general] section as well as in device configurations. ; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided ; both parties have T38 support enabled in their Asterisk configuration ; This has to be enabled in the general section for all devices to work. You can then ; disable it on a per device basis. ; ; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used. ; ; t38pt_udptl = yes ; Default false ; ;----------------------------------------- OUTBOUND SIP REGISTRATIONS ------------------------ ; Asterisk can register as a SIP user agent to a SIP proxy (provider) ; Format for the register statement is: ; register => user[:secret[:authuser]]@host[:port][/extension] ; ; If no extension is given, the 's' extension is used. The extension needs to ; be defined in extensions.conf to be able to accept calls from this SIP proxy ; (provider). ; ; host is either a host name defined in DNS or the name of a section defined ; below. ; ; Examples: ; ;register => 1234:password@mysipprovider.com ; ; This will pass incoming calls to the 's' extension ; ; ;register => 2345:password@sip_proxy/1234 ; ; Register 2345 at sip provider 'sip_proxy'. Calls from this provider ; connect to local extension 1234 in extensions.conf, default context, ; unless you configure a [sip_proxy] section below, and configure a ; context. ; Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com] ; Tip 2: Use separate type=peer and type=user sections for SIP providers ; (instead of type=friend) if you have calls in both directions ;registertimeout=20 ; retry registration calls every 20 seconds (default) ;registerattempts=10 ; Number of registration attempts before we give up ; 0 = continue forever, hammering the other server ; until it accepts the registration ; Default is 0 tries, continue forever ;----------------------------------------- NAT SUPPORT ------------------------ ; The externip, externhost and localnet settings are used if you use Asterisk ; behind a NAT device to communicate with services on the outside. ;externip = 200.201.202.203 ; Address that we're going to put in outbound SIP ; messages if we're behind a NAT ; The externip and localnet is used ; when registering and communicating with other proxies ; that we're registered with ;externhost=foo.dyndns.net ; Alternatively you can specify an ; external host, and Asterisk will ; perform DNS queries periodically. Not ; recommended for production ; environments! Use externip instead ;externrefresh=10 ; How often to refresh externhost if ; used ; You may add multiple local networks. A reasonable ; set of defaults are: ;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks ;localnet=10.0.0.0/255.0.0.0 ; Also RFC1918 ;localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation ;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network ; The nat= setting is used when Asterisk is on a public IP, communicating with ; devices hidden behind a NAT device (broadband router). If you have one-way ; audio problems, you usually have problems with your NAT configuration or your ; firewall's support of SIP+RTP ports. You configure Asterisk choice of RTP ; ports for incoming audio in rtp.conf ; ;nat=no ; Global NAT settings (Affects all peers and users) ; yes = Always ignore info and assume NAT ; no = Use NAT mode only according to RFC3581 (;rport) ; never = Never attempt NAT mode or RFC3581 support ; route = Assume NAT, don't send rport ; (work around more UNIDEN bugs) ;----------------------------------- MEDIA HANDLING -------------------------------- ; By default, Asterisk tries to re-invite the audio to an optimal path. If there's ; no reason for Asterisk to stay in the media path, the media will be redirected. ; This does not really work with in the case where Asterisk is outside and have ; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat ; ;canreinvite=yes ; Asterisk by default tries to redirect the ; RTP media stream (audio) to go directly from ; the caller to the callee. Some devices do not ; support this (especially if one of them is behind a NAT). ; The default setting is YES. If you have all clients ; behind a NAT, or for some other reason wants Asterisk to ; stay in the audio path, you may want to turn this off. ; In Asterisk 1.4 this setting also affect direct RTP ; at call setup (a new feature in 1.4 - setting up the ; call directly between the endpoints instead of sending ; a re-INVITE). ;directrtpsetup=yes ; Enable the new experimental direct RTP setup. This sets up ; the call directly with media peer-2-peer without re-invites. ; Will not work for video and cases where the callee sends ; RTP payloads and fmtp headers in the 200 OK that does not match the ; callers INVITE. This will also fail if canreinvite is enabled when ; the device is actually behind NAT. ;canreinvite=nonat ; An additional option is to allow media path redirection ; (reinvite) but only when the peer where the media is being ; sent is known to not be behind a NAT (as the RTP core can ; determine it based on the apparent IP address the media ; arrives from). ;canreinvite=update ; Yet a third option... use UPDATE for media path redirection, ; instead of INVITE. This can be combined with 'nonat', as ; 'canreinvite=update,nonat'. It implies 'yes'. ;----------------------------------------- REALTIME SUPPORT ------------------------ ; For additional information on ARA, the Asterisk Realtime Architecture, ; please read realtime.txt and extconfig.txt in the /doc directory of the ; source code. ; ;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list ; just like friends added from the config file only on a ; as-needed basis? (yes|no) ;rtsavesysname=yes ; Save systemname in realtime database at registration ; Default= no ;rtupdate=yes ; Send registry updates to database using realtime? (yes|no) ; If set to yes, when a SIP UA registers successfully, the ip address, ; the origination port, the registration period, and the username of ; the UA will be set to database via realtime. ; If not present, defaults to 'yes'. ;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule ; as if it had just registered? (yes|no|<seconds>) ; If set to yes, when the registration expires, the friend will ; vanish from the configuration until requested again. If set ; to an integer, friends expire within this number of seconds ; instead of the registration interval. ;ignoreregexpire=yes ; Enabling this setting has two functions: ; ; For non-realtime peers, when their registration expires, the ; information will _not_ be removed from memory or the Asterisk database ; if you attempt to place a call to the peer, the existing information ; will be used in spite of it having expired ; ; For realtime peers, when the peer is retrieved from realtime storage, ; the registration information will be used regardless of whether ; it has expired or not; if it expires while the realtime peer ; is still in memory (due to caching or other reasons), the ; information will not be removed from realtime storage ;----------------------------------------- SIP DOMAIN SUPPORT ------------------------ ; Incoming INVITE and REFER messages can be matched against a list of 'allowed' ; domains, each of which can direct the call to a specific context if desired. ; By default, all domains are accepted and sent to the default context or the ; context associated with the user/peer placing the call. ; Domains can be specified using: ; domain=<domain>[,<context>] ; Examples: ; domain=myasterisk.dom ; domain=customer.com,customer-context ; ; In addition, all the 'default' domains associated with a server should be ; added if incoming request filtering is desired. ; autodomain=yes ; ; To disallow requests for domains not serviced by this server: ; allowexternaldomains=no ;domain=mydomain.tld,mydomain-incoming ; Add domain and configure incoming context ; for external calls to this domain ;domain=1.2.3.4 ; Add IP address as local domain ; You can have several "domain" settings ;allowexternaldomains=no ; Disable INVITE and REFER to non-local domains ; Default is yes ;autodomain=yes ; Turn this on to have Asterisk add local host ; name and local IP to domain list. ; fromdomain=mydomain.tld ; When making outbound SIP INVITEs to ; non-peers, use your primary domain "identity" ; for From: headers instead of just your IP ; address. This is to be polite and ; it may be a mandatory requirement for some ; destinations which do not have a prior ; account relationship with your server. ;------------------------------ JITTER BUFFER CONFIGURATION -------------------------- ; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a ; SIP channel. Defaults to "no". An enabled jitterbuffer will ; be used only if the sending side can create and the receiving ; side can not accept jitter. The SIP channel can accept jitter, ; thus a jitterbuffer on the receive SIP side will be used only ; if it is forced and enabled. ; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a SIP ; channel. Defaults to "no". ; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds. ; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is ; resynchronized. Useful to improve the quality of the voice, with ; big jumps in/broken timestamps, usually sent from exotic devices ; and programs. Defaults to 1000. ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP ; channel. Two implementations are currently available - "fixed" ; (with size always equals to jbmaxsize) and "adaptive" (with ; variable size, actually the new jb of IAX2). Defaults to fixed. ; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no". ;----------------------------------------------------------------------------------- [authentication] ; Global credentials for outbound calls, i.e. when a proxy challenges your ; Asterisk server for authentication. These credentials override ; any credentials in peer/register definition if realm is matched. ; ; This way, Asterisk can authenticate for outbound calls to other ; realms. We match realm on the proxy challenge and pick an set of ; credentials from this list ; Syntax: ; auth = <user>:<secret>@<realm> ; auth = <user>#<md5secret>@<realm> ; Example: ;auth=mark:topsecret@digium.com ; ; You may also add auth= statements to [peer] definitions ; Peer auth= override all other authentication settings if we match on realm ;------------------------------------------------------------------------------ ; Users and peers have different settings available. Friends have all settings, ; since a friend is both a peer and a user ; ; User config options: Peer configuration: ; -------------------- ------------------- ; context context ; callingpres callingpres ; permit permit ; deny deny ; secret secret ; md5secret md5secret ; dtmfmode dtmfmode ; canreinvite canreinvite ; nat nat ; callgroup callgroup ; pickupgroup pickupgroup ; language language ; allow allow ; disallow disallow ; insecure insecure ; trustrpid trustrpid ; progressinband progressinband ; promiscredir promiscredir ; useclientcode useclientcode ; accountcode accountcode ; setvar setvar ; callerid callerid ; amaflags amaflags ; call-limit call-limit ; allowoverlap allowoverlap ; allowsubscribe allowsubscribe ; allowtransfer allowtransfer ; subscribecontext subscribecontext ; videosupport videosupport ; maxcallbitrate maxcallbitrate ; rfc2833compensate mailbox ; t38pt_usertpsource username ; template ; fromdomain ; regexten ; fromuser ; host ; port ; qualify ; defaultip ; rtptimeout ; rtpholdtimeout ; sendrpid ; outboundproxy ; rfc2833compensate ; t38pt_usertpsource ;[sip_proxy] ; For incoming calls only. Example: FWD (Free World Dialup) ; We match on IP address of the proxy for incoming calls ; since we can not match on username (caller id) ;type=peer ;context=from-fwd ;host=fwd.pulver.com ;[sip_proxy-out] ;type=peer ; we only want to call out, not be called ;secret=guessit ;username=yourusername ; Authentication user for outbound proxies ;fromuser=yourusername ; Many SIP providers require this! ;fromdomain=provider.sip.domain ;host=box.provider.com ;usereqphone=yes ; This provider requires ";user=phone" on URI ;call-limit=5 ; permit only 5 simultaneous outgoing calls to this peer ;outboundproxy=proxy.provider.domain ; send outbound signaling to this proxy, not directly to the peer ; Call-limits will not be enforced on real-time peers, ; since they are not stored in-memory ;port=80 ; The port number we want to connect to on the remote side ; Also used as "defaultport" in combination with "defaultip" settings ;------------------------------------------------------------------------------ ; Definitions of locally connected SIP devices ; ; type = user a device that authenticates to us by "from" field to place calls ; type = peer a device we place calls to or that calls us and we match by host ; type = friend two configurations (peer+user) in one ; ; For device names, we recommend using only a-z, numerics (0-9) and underscore ; ; For local phones, type=friend works most of the time ; ; If you have one-way audio, you probably have NAT problems. ; If Asterisk is on a public IP, and the phone is inside of a NAT device ; you will need to configure nat option for those phones. ; Also, turn on qualify=yes to keep the nat session open ;[grandstream1] ;type=friend ;context=from-sip ; Where to start in the dialplan when this phone calls ;callerid=John Doe <1234> ; Full caller ID, to override the phones config ; on incoming calls to Asterisk ;host=192.168.0.23 ; we have a static but private IP address ; No registration allowed ;nat=no ; there is not NAT between phone and Asterisk ;canreinvite=yes ; allow RTP voice traffic to bypass Asterisk ;dtmfmode=info ; either RFC2833 or INFO for the BudgeTone ;call-limit=1 ; permit only 1 outgoing call and 1 incoming call at a time ; from the phone to asterisk ; 1 for the explicit peer, 1 for the explicit user, ; remember that a friend equals 1 peer and 1 user in ; memory ; This will affect your subscriptions as well. ; There is no combined call counter for a "friend" ; so there's currently no way in sip.conf to limit ; to one inbound or outbound call per phone. Use ; the group counters in the dial plan for that. ; ;mailbox=1234@default ; mailbox 1234 in voicemail context "default" ;disallow=all ; need to disallow=all before we can use allow= ;allow=ulaw ; Note: In user sections the order of codecs ; listed with allow= does NOT matter! ;allow=alaw ;allow=g723.1 ; Asterisk only supports g723.1 pass-thru! ;allow=g729 ; Pass-thru only unless g729 license obtained ;callingpres=allowed_passed_screen ; Set caller ID presentation ; See doc/callingpres.txt for more information ;[xlite1] ; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)! ; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed ;type=friend ;regexten=1234 ; When they register, create extension 1234 ;callerid="Jane Smith" <5678> ;host=dynamic ; This device needs to register ;nat=yes ; X-Lite is behind a NAT router ;canreinvite=no ; Typically set to NO if behind NAT ;disallow=all ;allow=gsm ; GSM consumes far less bandwidth than ulaw ;allow=ulaw ;allow=alaw ;mailbox=1234@default,1233@default ; Subscribe to status of multiple mailboxes ;[snom] ;type=friend ; Friends place calls and receive calls ;context=from-sip ; Context for incoming calls from this user ;secret=blah ;subscribecontext=localextensions ; Only allow SUBSCRIBE for local extensions ;language=de ; Use German prompts for this user ;host=dynamic ; This peer register with us ;dtmfmode=inband ; Choices are inband, rfc2833, or info ;defaultip=192.168.0.59 ; IP used until peer registers ;mailbox=1234@context,2345 ; Mailbox(-es) for message waiting indicator ;subscribemwi=yes ; Only send notifications if this phone ; subscribes for mailbox notification ;vmexten=voicemail ; dialplan extension to reach mailbox ; sets the Message-Account in the MWI notify message ; defaults to global vmexten which defaults to "asterisk" ;disallow=all ;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw! ;[polycom] ;type=friend ; Friends place calls and receive calls ;context=from-sip ; Context for incoming calls from this user ;secret=blahpoly ;host=dynamic ; This peer register with us ;dtmfmode=rfc2833 ; Choices are inband, rfc2833, or info ;username=polly ; Username to use in INVITE until peer registers ; Normally you do NOT need to set this parameter ;disallow=all ;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw! ;progressinband=no ; Polycom phones don't work properly with "never" ;[pingtel] ;type=friend ;secret=blah ;host=dynamic ;insecure=port ; Allow matching of peer by IP address without ; matching port number ;insecure=invite ; Do not require authentication of incoming INVITEs ;insecure=port,invite ; (both) ;qualify=1000 ; Consider it down if it's 1 second to reply ; Helps with NAT session ; qualify=yes uses default value ; ; Call group and Pickup group should be in the range from 0 to 63 ; ;callgroup=1,3-4 ; We are in caller groups 1,3,4 ;pickupgroup=1,3-5 ; We can do call pick-p for call group 1,3,4,5 ;defaultip=192.168.0.60 ; IP address to use if peer has not registered ;deny=0.0.0.0/0.0.0.0 ; ACL: Control access to this account based on IP address ;permit=192.168.0.60/255.255.255.0 ;[cisco1] ;type=friend ;secret=blah ;qualify=200 ; Qualify peer is no more than 200ms away ;nat=yes ; This phone may be natted ; Send SIP and RTP to the IP address that packet is ; received from instead of trusting SIP headers ;host=dynamic ; This device registers with us ;canreinvite=no ; Asterisk by default tries to redirect the ; RTP media stream (audio) to go directly from ; the caller to the callee. Some devices do not ; support this (especially if one of them is ; behind a NAT). ;defaultip=192.168.0.4 ; IP address to use until registration ;username=goran ; Username to use when calling this device before registration ; Normally you do NOT need to set this parameter ;setvar=CUSTID=5678 ; Channel variable to be set for all calls from this device ;[pre14-asterisk] ;type=friend ;secret=digium ;host=dynamic ;rfc2833compensate=yes ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine. ; You must have this turned on or DTMF reception will work improperly. ;t38pt_usertpsource=yes ; Use the source IP address of RTP as the destination IP address for UDPTL packets ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the ; external IP address of the remote device. If port forwarding is done at the client side ; then UDPTL will flow to the remote device.
Время первой команды журнала | 13:27:39 2010-10-25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 09:36:54 2010-10-26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 7.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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