/l3/users/DAVID/nt-VOIP/linux5.unix.nt/user :1 :2 :3 :4 :5 :6 |
|
$su -
Password: l3-agent is already running: pid=3298; pidfile=/root/.lilalo/l3-agent.pid |
##otlichno
|
#apt-
apt-cache apt-config apt-ftparchive apt-key apt-mark apt-cdrom apt-extracttemplates apt-get apt-listchanges apt-sortpkgs |
#apt-cache search asterisk
asterisk-mobile - bluetooth mobile devices support for Asterisk asterisk-mp3 - MP3 format support (format_mp3) for the Asterisk PBX asterisk-mysql - MySQL support for the Asterisk PBX (cdr mainly) asterisk-ooh323c - H.323 protocol support for Asterisk (ooh323c stack) asterisk-chan-capi - Common ISDN API 2.0 implementation for Asterisk asterisk-core-sounds-en-g722 - asterisk PBX sound files - English/g722 asterisk-core-sounds-en-gsm - asterisk PBX sound files - English/gsm asterisk-core-sounds-en-wav - asterisk PBX sound files - English/wav asterisk-core-sounds-es-g722 - asterisk PBX sound files - Spanish/g722 asterisk-core-sounds-es-gsm - asterisk PBX sound files - Spanish/gsm ... asterisk - Open Source Private Branch Exchange (PBX) dahdi-linux - DAHDI telephony interface - Linux userspace parts dahdi-source - DAHDI telephony interface - source code for kernel driver dahdi - utilities for using the DAHDI kernel modules iaxmodem - software modem with IAX2 connectivity libasterisk-agi-perl - Collections of Perl modules to be used with Asterisk PBX AGI libnetsds-perl - Service Delivery Suite framework op-panel - switchboard type application for the Asterisk PBX libopenr2-3 - MFC/R2 (telephony) call setup library python-asterisk - Asterisk Manager API interface module for Python |
#apt-get install asterisk asterisk-config asterisk-sounds-main asterisk-sounds-extra
Package configuration âââââââââââââââââââââââââââââââââââââââââââââââââââ⤠Configuring libvpb0 ââââââââââââââââââââââââââââââââââââââââââââââââââââ â This is the numeric code for the region your phone system will be operating in (eg. 61 for Australia or 33 for France). â â It is used to configure the default regional standards that Voicetronix telephony hardware should comply with. â â â â ITU-T telephone code: â â â â3801_______________________________________________________________________________________________________________________ â â â â <Ok>k> â ... Setting up unixodbc (2.2.14p2-1) ... Setting up asterisk (1:1.6.2.9-2+squeeze3) ... Adding system user for Asterisk Adding user `asterisk' to group `dialout' ... Adding user asterisk to group dialout Done. Adding user `asterisk' to group `audio' ... Adding user asterisk to group audio Done. Starting Asterisk PBX: asterisk. |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#ps aux | grep ast
asterisk 7811 1.2 0.2 48484 18208 ? Ssl 14:43 0:00 /usr/sbin/asterisk -p -U asterisk asterisk 7812 0.0 0.0 2936 564 ? S 14:43 0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 7811 root 7861 0.0 0.0 3908 724 pts/4 S+ 14:44 0:00 grep ast |
#asterisk -rvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) ... group gtalk hangup help http iax2 indication jabber jingle keys local logger manager meetme mfcr2 mgcp minivm mixmonitor module moh no odbc originate parkedcalls phoneprov pri queue realtime reload rtcp rtp say sip skinny sla sqlite ss7 stun timing transcoder udptl ulimit unistim voicemail linux5*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] linux5*CLI> quit Executing last minute cleanups |
#vim /etc/network/interfaces
|
#~
# and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface l address 192.168.50.1 netmask 255.255.255.0 network 192.168.50.0 broadcast 192.168.50.255 # The p gateway 192.168.50.254 # dns-* options are implemented by the resolvconf package, if installed allow-h dns-nameservers 10.0.35.1 ... ~ ~ ~ ~ ~ ~ ~ ~ ~ "/etc/network/interfaces" 18L, 516C written |
#vim /etc/network/interfaces
|
#~
SIOCDELRT: No such process |
#ifconfig
eth0 Link encap:Ethernet HWaddr 2c:27:d7:29:6d:0d inet addr:192.168.50.1 Bcast:192.168.50.255 Mask:255.255.255.0 inet6 addr: fe80::2e27:d7ff:fe29:6d0d/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:564022 errors:0 dropped:0 overruns:0 frame:0 TX packets:278491 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:784187912 (747.8 MiB) TX bytes:20622600 (19.6 MiB) Interrupt:20 Memory:fe400000-fe420000 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:25 errors:0 dropped:0 overruns:0 frame:0 TX packets:25 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1938 (1.8 KiB) TX bytes:1938 (1.8 KiB) |
#ifdonw
bash: ifdonw: command not found |
#ifdonw eth0
bash: ifdonw: command not found |
#ifdown eth0
|
#ifup eth0
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 2c:27:d7:29:6d:0d inet addr:192.168.50.1 Bcast:192.168.50.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:564022 errors:0 dropped:0 overruns:0 frame:0 TX packets:278491 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:784187912 (747.8 MiB) TX bytes:20622600 (19.6 MiB) Interrupt:20 Memory:fe400000-fe420000 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:42 errors:0 dropped:0 overruns:0 frame:0 TX packets:42 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3508 (3.4 KiB) TX bytes:3508 (3.4 KiB) |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 * 255.255.255.0 U 0 0 0 eth0 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface ^[[Adefault 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 * 255.255.255.0 U 0 0 0 eth0 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface ^C |
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data. ^C --- 10.0.35.1 ping statistics --- 6 packets transmitted, 0 received, 100% packet loss, time 5039ms |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 * 255.255.255.0 U 0 0 0 eth0 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 |
#ping 192.168.50.1
PING 192.168.50.1 (192.168.50.1) 56(84) bytes of data. 64 bytes from 192.168.50.1: icmp_req=1 ttl=64 time=0.021 ms 64 bytes from 192.168.50.1: icmp_req=2 ttl=64 time=0.014 ms ^C --- 192.168.50.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.014/0.017/0.021/0.005 ms |
#ping 192.168.50.254
PING 192.168.50.254 (192.168.50.254) 56(84) bytes of data. 64 bytes from 192.168.50.254: icmp_req=1 ttl=64 time=0.984 ms 64 bytes from 192.168.50.254: icmp_req=2 ttl=64 time=0.639 ms ^C --- 192.168.50.254 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.639/0.811/0.984/0.174 ms |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface ^C |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 * 255.255.255.0 U 0 0 0 eth0 |
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_req=1 ttl=54 time=53.8 ms 64 bytes from 8.8.8.8: icmp_req=2 ttl=54 time=39.3 ms 64 bytes from 8.8.8.8: icmp_req=3 ttl=54 time=39.0 ms 64 bytes from 8.8.8.8: icmp_req=4 ttl=54 time=39.1 ms 64 bytes from 8.8.8.8: icmp_req=5 ttl=54 time=39.2 ms ^C --- 8.8.8.8 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4005ms rtt min/avg/max/mdev = 39.023/42.133/53.898/5.888 ms |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 * 255.255.255.0 U 0 0 0 eth0 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.50.254 0.0.0.0 UG 0 0 0 eth0 192.168.50.0 * 255.255.255.0 U 0 0 0 eth0 |
#apt-cache
.aptitude/ .bash_history .bashrc l3prompt .lilalo/ .ssh/ .asterisk_history .bash_profile l3bashrc .l3rc .profile .viminfo |
#apt-cache
apt 0.8.10.3 for i386 compiled on Apr 15 2011 21:02:14 Usage: apt-cache [options] command apt-cache [options] add file1 [file2 ...] apt-cache [options] showpkg pkg1 [pkg2 ...] apt-cache [options] showsrc pkg1 [pkg2 ...] apt-cache is a low-level tool used to manipulate APT's binary cache files, and query information from them Commands: add - Add a package file to the source cache gencaches - Build both the package and source cache ... policy - Show policy settings Options: -h This help text. -p=? The package cache. -s=? The source cache. -q Disable progress indicator. -i Show only important deps for the unmet command. -c=? Read this configuration file -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp See the apt-cache(8) and apt.conf(5) manual pages for more information. |
#apt-cache dhcp
E: Invalid operation dhcp |
#apt-cache dshow hcp
E: Invalid operation dshow |
#apt-cache show dhcp
N: Can't select versions from package 'dhcp' as it purely virtual N: No packages found |
#apt-cache show
E: No packages found |
#apt-get install dhcp3
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package dhcp3 |
#apt-get install dhcp3-server
Reading package lists... Done Building dependency tree Reading state information... Done dhcp3-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
#apt-get install dhcp3-server
Reading package lists... Done Building dependency tree Reading state information... Done dhcp3-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
#vim /etc/dhcp/dhcp.conf
|
#~
#authoritative; # Use this to send dhcp log messages to a different log file (you also # have to hack syslog.conf to complete the redirection). "/etc/dhcp/dhcpd.conf" 107L, 3491C log-facility local7; # No service will be given on this subnet, but declaring it helps the # DHCP server to understand the network topology. #subnet 10.152.187.0 netmask 255.255.255.0 { #} # This is a very basic subnet declaration. ... # allocated dynamically (if possible), but the host-specific information # will still come from the host declarati{n. #host passacaglia { # hardware ethernet 0:0:c0:5d:bd:95; #} filename "vmuni{.passacaglia"; { # server-name "toccata.fugue.com"; #} } "/etc/dhcp/dhcpd.conf" 107L, 3460C written |
#less /etc/dhcp/dhcpd.conf
|
#/etc/init.d/isc-dhcp-server
.aptitude/ .bash_history .bashrc l3prompt .lilalo/ .ssh/ .asterisk_history .bash_profile l3bashrc .l3rc .profile .viminfo |
#/etc/init.d/isc-dhcp-server restart
Stopping ISC DHCP server: dhcpd failed! Starting ISC DHCP server: dhcpd. |
#tail -f /var/lib/d
dbus/ defoma/ dhcp/ dictionaries-common/ dpkg/ |
#tail -f /var/lib/d
dbus/ defoma/ dhcp/ dictionaries-common/ dpkg/ |
#tail -f /var/lib/dhcp/dhcpd.leases
lease 192.168.50.200 { starts 1 2011/10/17 13:12:27; ends 1 2011/10/17 13:22:27; cltt 1 2011/10/17 13:12:27; binding state active; next binding state free; hardware ethernet c8:0a:a9:dc:73:aa; uid "\001\310\012\251\334s\252"; client-hostname "Tech-notebook"; } ^[[A^[[A: :q ^C |
#ping 192.168.50.1
PING 192.168.50.1 (192.168.50.1) 56(84) bytes of data. 64 bytes from 192.168.50.1: icmp_req=1 ttl=64 time=0.028 ms 64 bytes from 192.168.50.1: icmp_req=2 ttl=64 time=0.017 ms ^C --- 192.168.50.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.017/0.022/0.028/0.007 ms |
#ping 192.168.50.200
PING 192.168.50.200 (192.168.50.200) 56(84) bytes of data. 64 bytes from 192.168.50.200: icmp_req=1 ttl=128 time=0.856 ms 64 bytes from 192.168.50.200: icmp_req=2 ttl=128 time=0.484 ms ^C --- 192.168.50.200 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.484/0.670/0.856/0.186 ms |
#ping 192.168.50.201
PING 192.168.50.201 (192.168.50.201) 56(84) bytes of data. 64 bytes from 192.168.50.201: icmp_req=2 ttl=64 time=0.955 ms 64 bytes from 192.168.50.201: icmp_req=3 ttl=64 time=0.895 ms 64 bytes from 192.168.50.201: icmp_req=4 ttl=64 time=0.934 ms 64 bytes from 192.168.50.201: icmp_req=5 ttl=64 time=0.946 ms ^C --- 192.168.50.201 ping statistics --- 5 packets transmitted, 4 received, 20% packet loss, time 4010ms rtt min/avg/max/mdev = 0.895/0.932/0.955/0.038 ms |
#apt-get install nc
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package nc |
#apt-cache search nc
4g8 - Packet Capture and Interception for Switched Networks a2ps - GNU a2ps - 'Anything to PostScript' converter and pretty-printer liba52-0.7.4-dev - library for decoding ATSC A/52 streams (development) liba52-0.7.4 - library for decoding ATSC A/52 streams a7xpg-data - chase action game - game data a7xpg - chase action game aa3d - ASCII art stereogram generator aaphoto - Auto Adjust Photo, automatic color correction of photos abcde - A Better CD Encoder abe-data - Side-scrolling game named "Abe's Amazing Adventure" ... samba - SMB/CIFS file, print, and login server for Unix smbclient - command-line SMB/CIFS clients for Unix swat - Samba Web Administration Tool winbind - Samba nameservice integration server libsvn-java - Java bindings for Subversion libsvn1 - Shared libraries used by Subversion subversion-tools - Assorted tools related to Subversion subversion - Advanced version control system mahara-mediaplayer - Electronic portfolio, weblog, and resume builder - internal media player busybox - Tiny utilities for small and embedded systems |
#apt-cache search mc
libace-rmcast-5.7.7 - ACE reliable multicast library libace-rmcast-dev - ACE reliable multicast library development files libace-tmcast-5.7.7 - ACE transactional multicast library libace-tmcast-dev - ACE transactional multicast library development files alsa-oss - ALSA wrapper for OSS applications amule-emc - lists ed2k links inside emulecollection files ap-utils - Access Point SNMP Utils for Linux apel - portable library for emacsen apmd - Utilities for Advanced Power Management (APM) ardour - digital audio workstation (graphical gtk2 interface) ... xfce4-settings - graphical application for managing Xfce settings xli - command line tool for viewing images in X11 xloadimage - Graphics file viewer under X11 xmcd - X11 based CD player xmpuzzles - collection of puzzles for X (Motif version) xserver-xorg-video-intel - X.Org X server -- Intel i8xx, i9xx display driver xserver-xorg-video-openchrome - X.Org X server -- VIA display driver xsmc-calc - Smith Chart calculator for X xtermcontrol - dynamic configuration of xterm properties yorick-yao - a Yorick-based adaptive optics system simulator |
#apt-get install mc
Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: zip unzip arj dbview odt2txt gv catdvi djvulibre-bin python-boto python-tz The following NEW packages will be installed: mc 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 2,173 kB of archives. After this operation, 6,603 kB of additional disk space will be used. Get:1 http://10.0.35.1/debian/ squeeze/main mc i386 3:4.7.0.9-1 [2,173 kB] Fetched 2,173 kB in 0s (9,666 kB/s) Selecting previously deselected package mc. (Reading database ... 115144 files and directories currently installed.) Unpacking mc (from .../mc_3%3a4.7.0.9-1_i386.deb) ... Processing triggers for man-db ... Processing triggers for menu ... Setting up mc (3:4.7.0.9-1) ... Processing triggers for menu ... |
#cd /etc/asterisk/
|
#cat sip
sip.conf sip_notify.conf |
#cat sip.conf
; ; SIP Configuration example for Asterisk ; ; SIP dial strings ;----------------------------------------------------------- ; In the dialplan (extensions.conf) you can use several ; syntaxes for dialing SIP devices. ; SIP/devicename ; SIP/username@domain (SIP uri) ; SIP/username[:password[:md5secret[:authname[:transport]]]]@host[:port] ... ;[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. |
#cd /etc/asterisk/
|
#ls -la
total 680 drwxr-xr-x 3 asterisk asterisk 4096 Oct 17 14:23 . drwxr-xr-x 123 root root 12288 Oct 17 16:32 .. -rw-r----- 1 asterisk asterisk 140 Jul 7 11:58 adsi.conf -rw-r----- 1 asterisk asterisk 840 Jul 7 11:58 adtranvofr.conf -rw-r----- 1 asterisk asterisk 3035 Jul 7 11:58 agents.conf -rw-r----- 1 asterisk asterisk 2906 Jul 7 11:58 ais.conf -rw-r----- 1 asterisk asterisk 2227 Jul 7 11:58 alarmreceiver.conf -rw-r----- 1 asterisk asterisk 3259 Jul 7 11:58 alsa.conf -rw-r----- 1 asterisk asterisk 767 Jul 7 11:58 amd.conf ... -rw-r----- 1 asterisk asterisk 9135 Jul 7 11:58 skinny.conf -rw-r----- 1 asterisk asterisk 6717 Jul 7 11:58 sla.conf -rw-r----- 1 asterisk asterisk 2669 Jul 7 11:58 smdi.conf -rw-r----- 1 asterisk asterisk 1384 Jul 7 11:58 telcordia-1.adsi -rw-r----- 1 asterisk asterisk 656 Jul 7 11:58 udptl.conf -rw-r----- 1 asterisk asterisk 4909 Jul 7 11:58 unistim.conf -rw-r----- 1 asterisk asterisk 3216 Jul 7 11:58 usbradio.conf -rw-r----- 1 asterisk asterisk 2011 Jul 7 11:58 users.conf -rw-r----- 1 asterisk asterisk 17961 Jul 7 11:58 voicemail.conf -rw-r----- 1 asterisk asterisk 5939 Jul 7 11:58 vpb.conf |
#ls -l
total 664 -rw-r----- 1 asterisk asterisk 140 Jul 7 11:58 adsi.conf -rw-r----- 1 asterisk asterisk 840 Jul 7 11:58 adtranvofr.conf -rw-r----- 1 asterisk asterisk 3035 Jul 7 11:58 agents.conf -rw-r----- 1 asterisk asterisk 2906 Jul 7 11:58 ais.conf -rw-r----- 1 asterisk asterisk 2227 Jul 7 11:58 alarmreceiver.conf -rw-r----- 1 asterisk asterisk 3259 Jul 7 11:58 alsa.conf -rw-r----- 1 asterisk asterisk 767 Jul 7 11:58 amd.conf -rw-r----- 1 asterisk asterisk 3260 Jul 7 11:58 asterisk.adsi -rw-r----- 1 asterisk asterisk 3234 Jul 7 11:58 asterisk.conf ... -rw-r----- 1 asterisk asterisk 9135 Jul 7 11:58 skinny.conf -rw-r----- 1 asterisk asterisk 6717 Jul 7 11:58 sla.conf -rw-r----- 1 asterisk asterisk 2669 Jul 7 11:58 smdi.conf -rw-r----- 1 asterisk asterisk 1384 Jul 7 11:58 telcordia-1.adsi -rw-r----- 1 asterisk asterisk 656 Jul 7 11:58 udptl.conf -rw-r----- 1 asterisk asterisk 4909 Jul 7 11:58 unistim.conf -rw-r----- 1 asterisk asterisk 3216 Jul 7 11:58 usbradio.conf -rw-r----- 1 asterisk asterisk 2011 Jul 7 11:58 users.conf -rw-r----- 1 asterisk asterisk 17961 Jul 7 11:58 voicemail.conf -rw-r----- 1 asterisk asterisk 5939 Jul 7 11:58 vpb.conf |
#ls
adsi.conf chan_dahdi.conf festival.conf misdn.conf say.conf adtranvofr.conf cli_aliases.conf followme.conf modules.conf sip.conf agents.conf cli.conf func_odbc.conf musiconhold.conf sip_notify.conf ais.conf cli_permissions.conf gtalk.conf muted.conf skinny.conf alarmreceiver.conf codecs.conf h323.conf osp.conf sla.conf alsa.conf console.conf http.conf oss.conf smdi.conf amd.conf dbsep.conf iax.conf phone.conf telcordia-1.adsi asterisk.adsi dnsmgr.conf iaxprov.conf phoneprov.conf udptl.conf asterisk.conf dsp.conf indications.conf queuerules.conf unistim.conf cdr_adaptive_odbc.conf dundi.conf jabber.conf queues.conf usbradio.conf cdr.conf enum.conf jingle.conf res_config_sqlite.conf users.conf cdr_custom.conf extconfig.conf logger.conf res_ldap.conf voicemail.conf cdr_manager.conf extensions.ael manager.conf res_odbc.conf vpb.conf cdr_odbc.conf extensions.conf manager.d res_pgsql.conf cdr_pgsql.conf extensions.lua meetme.conf res_snmp.conf cdr_sqlite3_custom.conf extensions_minivm.conf mgcp.conf rpt.conf cdr_tds.conf features.conf minivm.conf rtp.conf |
#cp sip.conf sip.conf.SAVED
|
#vim sip.conf
|
#cat /etc/asterisk/sip.conf | sed 's/;.*//' | expand | grep -xv ' *' | head -7 less
head: cannot open `less' for reading: No such file or directory |
#cat /etc/asterisk/sip.conf | sed 's/;.*//' | expand | grep -xv ' *' | head -7 | less
|
#cd /etc/asterisk/cat sipconf
bash: cd: /etc/asterisk/cat: No such file or directory |
#cat sip.conf
|
#cp sip.conf.SAVED sip.conf
|
#cat sip.conf
; ; SIP Configuration example for Asterisk ; ; SIP dial strings ;----------------------------------------------------------- ; In the dialplan (extensions.conf) you can use several ; syntaxes for dialing SIP devices. ; SIP/devicename ; SIP/username@domain (SIP uri) ; SIP/username[:password[:md5secret[:authname[:transport]]]]@host[:port] ... ;[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 | sed 's/;.*//' | expand | grep -xv ' *' | head -7 | less
|
#less
|
#vim sip.conf
|
#cat sip.conf
[general] context=default allowoverlap=no udpbindaddr=0.0.0.0 tcpenable=no tcpbindaddr=0.0.0.0 srvlookup=yes [2101] type=friend ;friend, user, peer secret=1234 host=dynamic [2102] type=friend ;friend, user, peer secret=1234 host=dynamic |
#~/asterisk -rvv
bash: /root/asterisk: No such file or directory |
#asterisk -rvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) Verbosity is at least 2 [Oct 17 17:39:44] NOTICE[7830]: chan_sip.c:21763 handle_request_register: Registration from '"2102"<sip:2102@192.168.50.1>' failed for '192.168.50.200' - No matching peer found linux5*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] linux5*CLI> exit Executing last minute cleanups |
#asterisk -rvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) Verbosity is at least 2 linux5*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] linux5*CLI> exit Executing last minute cleanups |
#cat sip.conf
[general] context=default allowoverlap=no udpbindaddr=0.0.0.0 tcpenable=no tcpbindaddr=0.0.0.0 srvlookup=yes [2101] type=friend ;friend, user, peer secret=1234 host=dynamic [2102] type=friend ;friend, user, peer secret=1234 host=dynamic |
#asterisk -rvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) Verbosity is at least 2 linux5*CLI> sip reload Reloading SIP == Parsing '/etc/asterisk/sip.conf': == Found == Parsing '/etc/asterisk/users.conf': == Found == Parsing '/etc/asterisk/sip_notify.conf': == Found linux5*CLI> exit Executing last minute cleanups |
#asterisk -rvvvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) Verbosity was 2 and is now 4 -- Registered SIP '2102' at 192.168.50.200 port 34984 > Saved useragent "X-Lite 4 release 4.1 stamp 63214" for peer 2102 [Oct 17 17:46:55] NOTICE[7830]: chan_sip.c:21594 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 2102 linux5*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 2101 (Unspecified) D 5060 Unmonitored 2102/2102 192.168.50.200 D 34984 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] linux5*CLI> exit Executing last minute cleanups |
#ls -la
total 684 drwxr-xr-x 3 asterisk asterisk 4096 Oct 17 17:37 . drwxr-xr-x 123 root root 12288 Oct 17 16:32 .. -rw-r----- 1 asterisk asterisk 140 Jul 7 11:58 adsi.conf -rw-r----- 1 asterisk asterisk 840 Jul 7 11:58 adtranvofr.conf -rw-r----- 1 asterisk asterisk 3035 Jul 7 11:58 agents.conf -rw-r----- 1 asterisk asterisk 2906 Jul 7 11:58 ais.conf -rw-r----- 1 asterisk asterisk 2227 Jul 7 11:58 alarmreceiver.conf -rw-r----- 1 asterisk asterisk 3259 Jul 7 11:58 alsa.conf -rw-r----- 1 asterisk asterisk 767 Jul 7 11:58 amd.conf ... -rw-r----- 1 asterisk asterisk 9135 Jul 7 11:58 skinny.conf -rw-r----- 1 asterisk asterisk 6717 Jul 7 11:58 sla.conf -rw-r----- 1 asterisk asterisk 2669 Jul 7 11:58 smdi.conf -rw-r----- 1 asterisk asterisk 1384 Jul 7 11:58 telcordia-1.adsi -rw-r----- 1 asterisk asterisk 656 Jul 7 11:58 udptl.conf -rw-r----- 1 asterisk asterisk 4909 Jul 7 11:58 unistim.conf -rw-r----- 1 asterisk asterisk 3216 Jul 7 11:58 usbradio.conf -rw-r----- 1 asterisk asterisk 2011 Jul 7 11:58 users.conf -rw-r----- 1 asterisk asterisk 17961 Jul 7 11:58 voicemail.conf -rw-r----- 1 asterisk asterisk 5939 Jul 7 11:58 vpb.conf |
#ls
adsi.conf chan_dahdi.conf festival.conf misdn.conf say.conf adtranvofr.conf cli_aliases.conf followme.conf modules.conf sip.conf agents.conf cli.conf func_odbc.conf musiconhold.conf sip.conf.SAVED ais.conf cli_permissions.conf gtalk.conf muted.conf sip_notify.conf alarmreceiver.conf codecs.conf h323.conf osp.conf skinny.conf alsa.conf console.conf http.conf oss.conf sla.conf amd.conf dbsep.conf iax.conf phone.conf smdi.conf asterisk.adsi dnsmgr.conf iaxprov.conf phoneprov.conf telcordia-1.adsi asterisk.conf dsp.conf indications.conf queuerules.conf udptl.conf cdr_adaptive_odbc.conf dundi.conf jabber.conf queues.conf unistim.conf cdr.conf enum.conf jingle.conf res_config_sqlite.conf usbradio.conf cdr_custom.conf extconfig.conf logger.conf res_ldap.conf users.conf cdr_manager.conf extensions.ael manager.conf res_odbc.conf voicemail.conf cdr_odbc.conf extensions.conf manager.d res_pgsql.conf vpb.conf cdr_pgsql.conf extensions.lua meetme.conf res_snmp.conf cdr_sqlite3_custom.conf extensions_minivm.conf mgcp.conf rpt.conf cdr_tds.conf features.conf minivm.conf rtp.conf |
#cp ext
extconfig.conf extensions.ael extensions.conf extensions.lua extensions_minivm.conf |
#cp extensions.conf extensions.conf.SAVED
|
#cat 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 => _X.,n,SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit exten => _X.,n,Return() ; 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. |
#vim extensions.conf
|
#vim extensions.conf
|
#asterisk -rvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) ... -- Executing [2199@default:1] Playback("SIP/2102-00000003", "demo-thanks") in new stack -- <SIP/2102-00000003> Playing 'demo-thanks.gsm' (language 'en') [Oct 17 18:10:36] NOTICE[10680]: rtp.c:1808 ast_rtp_read: Unknown RTP codec 126 received from '192.168.50.200' [Oct 17 18:10:36] NOTICE[10680]: rtp.c:1808 ast_rtp_read: Unknown RTP codec 126 received from '192.168.50.200' [Oct 17 18:10:36] NOTICE[10680]: rtp.c:1808 ast_rtp_read: Unknown RTP codec 126 received from '192.168.50.200' -- Executing [2199@default:2] Playback("SIP/2102-00000003", "demo-thanks") in new stack -- <SIP/2102-00000003> Playing 'demo-thanks.gsm' (language 'en') -- Auto fallthrough, channel 'SIP/2102-00000003' status is 'UNKNOWN' linux5*CLI> exit Executing last minute cleanups |
#vim extensions.conf
|
#asterisk -rvv\
> asterisk -rvv asterisk: invalid option -- 'a' |
#asterisk -rvvasterisk -rvv
asterisk: invalid option -- 'a' |
#asterisk -rvvasterisk -rvvvvv
asterisk: invalid option -- 'a' |
#asterisk -rvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) ... -- merging incls/swits/igpats from old(app_dial_gosub_virtual_context) to new(app_dial_gosub_virtual_context) context, registrar = pbx_config -- Added extension 's' priority 1 to app_dial_gosub_virtual_context (0xb4d2e0e8) -- Time to scan old dialplan and merge leftovers back into the new: 0.000611 sec -- Time to restore hints and swap in new dialplan: 0.000000 sec -- Time to delete the old dialplan: 0.000035 sec -- Total time merge_contexts_delete: 0.000646 sec == Using SIP RTP CoS mark 5 [Oct 17 18:13:37] NOTICE[7830]: chan_sip.c:20276 handle_request_invite: Call from '2102' to extension '2101' rejected because extension not found in context 'default'. linux5*CLI> exit Executing last minute cleanups |
#vim sip.conf
|
#[2102]
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) ... == Using SIP RTP CoS mark 5 [Oct 17 18:17:55] NOTICE[7830]: chan_sip.c:20276 handle_request_invite: Call from '2102' to extension '2101' rejected because extension not found in context 'default'. == Using SIP RTP CoS mark 5 [Oct 17 18:18:22] NOTICE[7830]: chan_sip.c:20276 handle_request_invite: Call from '2102' to extension '2101' rejected because extension not found in context 'default'. [Oct 17 18:18:46] NOTICE[7830]: chan_sip.c:21763 handle_request_register: Registration from 'sip:2201@192.168.50.1' failed for '192.168.50.201' - No matching peer found [Oct 17 18:19:47] NOTICE[7830]: chan_sip.c:21763 handle_request_register: Registration from 'sip:2201@192.168.50.1' failed for '192.168.50.201' - No matching peer found [Oct 17 18:20:47] NOTICE[7830]: chan_sip.c:21763 handle_request_register: Registration from 'sip:2201@192.168.50.1' failed for '192.168.50.201' - No matching peer found [Oct 17 18:21:47] NOTICE[7830]: chan_sip.c:21763 handle_request_register: Registration from 'sip:2201@192.168.50.1' failed for '192.168.50.201' - No matching peer found linux5*CLI> exit Executing last minute cleanups |
#passwordpassword
bash: passwordpassword: command not found |
#~
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) ... > Saved useragent "Cisco-CP7960G/7.5" for peer 2101 linux5*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 2101/2101 192.168.50.201 D 5060 Unmonitored 2102/2102 192.168.50.200 D 52600 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline] == Using SIP RTP CoS mark 5 [Oct 18 09:45:52] NOTICE[7830]: chan_sip.c:20276 handle_request_invite: Call from '2102' to extension '2101' rejected because extension not found in context 'default'. linux5*CLI> exit Executing last minute cleanups |
#vim extensions.conf
|
#asterisk -rvv
Asterisk 1.6.2.9-2+squeeze3, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze3 currently running on linux5 (pid = 7811) ... -- Remote UNIX connection -- Remote UNIX connection disconnected -- Remote UNIX connection -- Remote UNIX connection disconnected -- Remote UNIX connection Executing last minute cleanups == Destroying musiconhold processes linux5*CLI> Disconnected from Asterisk server Executing last minute cleanups |
; 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 extenpatternmatchnew is set (true, yes, etc), then a new algorithm that uses ; a Trie to find the best matching pattern is used. In dialplans ; with more than about 20-40 extensions in a single context, this ; new algorithm can provide a noticeable speedup. ; With 50 extensions, the speedup is 1.32x ; with 88 extensions, the speedup is 2.23x ; with 138 extensions, the speedup is 3.44x ; with 238 extensions, the speedup is 5.8x ; with 438 extensions, the speedup is 10.4x ; With 1000 extensions, the speedup is ~25x ; with 10,000 extensions, the speedup is 374x ; Basically, the new algorithm provides a flat response ; time, no matter the number of extensions. ; ; By default, the old pattern matcher is used. ; ; ****This is a new feature! ********************* ; The new pattern matcher is for the brave, the bold, and ; the desperate. If you have large dialplans (more than about 50 extensions ; in a context), and/or high call volume, you might consider setting ; this value to "yes" !! ; Please, if you try this out, and are forced to return to the ; old pattern matcher, please report your reasons in a bug report ; on bugs.digium.com. We have made good progress in providing something ; compatible with the old matcher; help us finish the job! ; ; This value can be switched at runtime using the cli command "dialplan set extenpatternmatchnew true" ; or "dialplan set extenpatternmatchnew false", so you can experiment to your hearts content. ; ;extenpatternmatchnew=no ; ; If clearglobalvars is set, global variables will be cleared ; and reparsed on a dialplan 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" ;#include <filename.conf> ;#include filename.conf ; ; You can execute a program or script that produces config files, and they ; will be inserted where you insert the #exec command. The #exec command ; works on all asterisk configuration files. However, you will need to ; activate them within asterisk.conf with the "execincludes" option. They ; are otherwise considered a security risk. ;#exec /opt/bin/build-extra-contexts.sh ;#exec /opt/bin/build-extra-contexts.sh --foo="bar" ;#exec </opt/bin/build-extra-contexts.sh --foo="bar"> ;#exec "/opt/bin/build-extra-contexts.sh --foo=\"bar\"" ; ; 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=DAHDI/1 ;CONSOLE=Phone/phone0 IAXINFO=guest ; IAXtel username/password ;IAXINFO=myuser:mypass TRUNK=DAHDI/G2 ; Trunk interface ; ; Note the 'G2' in the TRUNK variable above. It specifies which group (defined ; in chan_dahdi.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 DAHDI channel ; (aka. ascending sequential hunt group). ; G: select the highest-numbered non-busy DAHDI 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 ;FREENUMDOMAIN=mydomain.com ; domain to send on outbound ; freenum calls (uses outbound-freenum ; context) ; ; WARNING WARNING WARNING WARNING ; If you load any other extension configuration engine, such as pbx_ael.so, ; your global variables may be overridden by that file. Please take care to ; use only one location to set global variables, and you will likely save ; yourself a ton of grief. ; WARNING WARNING WARNING WARNING ; ; 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 parentheses after their name which can be used in goto situations. ; ; Contexts contain several lines, one for each step of each extension. 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. ; Switches may also be included within a context. The order of matching within ; a context is always exact extensions, pattern match extensions, includes, and ; switches. Includes are always processed depth-first. So for example, if you ; would like a switch "A" to match before context "B", simply put switch "A" in ; an included context "C", where "C" is included in your original context ; before "B". ; ;[context] ;exten => someexten,{priority|label{+|-}offset}[(alias)],application(arg1,arg2,...) ; ; Timing list for includes is ; ; <time range>,<days of week>,<days of month>,<months>[,<timezone>] ; ; 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. Please note that ignorepat ; only works with channels which receive dialtone from the PBX, such as DAHDI, ; Phone, and VPB. Other channels, such as SIP and MGCP, which generate their ; own dialtone and converse with the PBX only after a number is complete, are ; generally unaffected by ignorepat (unless DISA or another method is used to ; generate a dialtone after answering the channel). ; ; ; Sample entries for extensions.conf ; ; [dundi-e164-canonical] ;include => stdexten ; ; List canonical entries here ; ;exten => 12564286000,1,Gosub(6000,stdexten(IAX2/foo)) ;exten => 12564286000,n,Goto(default,s,1) ; exited Voicemail ;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(DAHDI/G2/${EXTEN:7}) ; Expose all of 256-428 ;exten => _1256325XXXX,1,Dial(DAHDI/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)}/${FILTER(0-9,${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} ; The following two contexts are a template to enable the ability to dial ; ISN numbers. For more information about what an ISN number is, please see ; http://www.freenum.org. ; ; This is the dialing hook. use: ; include => outbound-freenum [outbound-freenum] ; We'll add more digits as needed. The purpose is to dial things ; like extension numbers at domains (ITAD number) so we're matching ; on lengths of 1 through 6 prior to the separator (the asterisk [*]) ; exten => _X*X!,1,Goto(outbound-freenum2,${EXTEN},1) exten => _XX*X!,1,Goto(outbound-freenum2,${EXTEN},1) exten => _XXX*X!,1,Goto(outbound-freenum2,${EXTEN},1) exten => _XXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1) exten => _XXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1) exten => _XXXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1) [outbound-freenum2] ; This is the handler which performs the dialing logic. It is called ; from the [outbound-freenum] context ; exten => _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN}) same => n,Set(SUFFIX=${CUT(EXTEN,*,2-)}) ; make sure the suffix is all digits as well same => n,GotoIf($["${FILTER(0-9,${SUFFIX})}" != "${SUFFIX}"]?fn-CONGESTION,1) ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document same => n,Set(TIMEOUT(absolute)=10800) same => n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)}) ; perform our lookup with freenum.org same => n,GotoIf($["${isnresult}" != ""]?from) same => n,Set(DIALSTATUS=CONGESTION) same => n,Goto(fn-CONGESTION,1) same => n(from),Set(SIPFROMUSER=${CALLERID(num)}) same => n,GotoIf($["${GLOBAL(FREENUMDOMAIN)}" = ""]?dial) ; check if we set the FREENUMDOMAIN global variable in [global] same => n,Set(SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ; if we did set it, then we'll use it for our outbound dialing domain same => n(dial),Dial(SIP/${isnresult},40) same => n,Goto(fn-${DIALSTATUS},1) exten => fn-BUSY,1,Busy() exten => _f[n]-.,1,NoOp(ISN: ${DIALSTATUS}) same => n,Congestion() [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 [stdexten] ; ; Standard extension subroutine: ; ${EXTEN} - Extension ; ${ARG1} - Device(s) to ring ; ${ARG2} - Optional context in Voicemail (if empty, then "default") ; ; Note that the current version will drop through to the next priority in the ; case of their pressing '#'. This gives more flexibility in what do to next: ; you can prompt for a new extension, or drop the call, or send them to a ; general delivery mailbox, or... ; ; The use of the LOCAL() function is purely for convenience. Any variable ; initially declared as LOCAL() will disappear when the innermost Gosub context ; in which it was declared returns. Note also that you can declare a LOCAL() ; variable on top of an existing variable, and its value will revert to its ; previous value (before being declared as LOCAL()) upon Return. ; exten => _X.,50000(stdexten),NoOp(Start stdexten) exten => _X.,n,Set(LOCAL(ext)=${EXTEN}) exten => _X.,n,Set(LOCAL(dev)=${ARG1}) exten => _X.,n,Set(LOCAL(cntx)=${ARG2}) exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""]) exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce exten => stdexten-NOANSWER,n,NoOp(Finish stdexten NOANSWER) exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce exten => stdexten-BUSY,n,NoOp(Finish stdexten BUSY) exten => stdexten-BUSY,n,Return() ; If they press #, return to start exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain exten => a,n,Return() [stdPrivacyexten] ; ; Standard extension subroutine: ; ${ARG1} - Extension ; ${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)` ; ${ARG5} - Context in voicemail (if empty, then "default") ; ; See above note in stdexten about priority handling on exit. ; exten => _X.,60000(stdPrivacyexten),NoOp(Start stdPrivacyexten) exten => _X.,n,Set(LOCAL(ext)=${ARG1}) exten => _X.,n,Set(LOCAL(dev)=${ARG2}) exten => _X.,n,Set(LOCAL(dontcntx)=${ARG3}) exten => _X.,n,Set(LOCAL(tortcntx)=${ARG4}) exten => _X.,n,Set(LOCAL(cntx)=${ARG5}) exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""]) exten => _X.,n,Dial(${dev},20,p) ; Ring the interface, 20 seconds maximum, call screening ; option (or use P for databased call _X.creening) exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER) exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY) exten => stdexten-BUSY,n,Return() ; If they press #, return to start exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1) ; Callee chose to send this call to a polite "Don't call again" script. exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1) ; Callee chose to send this call to a telemarketer torture script. exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain exten => a,n,Return [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},s) ; s is for ANY call exten => s,n,GoToIf([${AVAILORIGCHAN} = ""]?fail:autoanswer) 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] include => stdexten ; ; 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,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)})) exten => 1234,n,Goto(default,s,1) ; exited Voicemail 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] ; ; 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/${FILTER(0-9,${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,Gosub(${EXTEN},stdexten(${MARK})) ; assuming ${MARK} is something like DAHDI/2 ;exten => 6275,n,Goto(default,s,1) ; exited Voicemail ;exten => mark,1,Goto(6275,1) ; alias mark to 6275 ;exten => 6536,1,Gosub(${EXTEN},stdexten(${WIL})) ; Ditto for wil ;exten => 6536,n,Goto(default,s,1) ; exited Voicemail ;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)) ; ; example of a compartmentalized company called "acme" ; ; this is the context that your incoming IAX/SIP trunk dumps you in... ;[acme-incoming] ;exten => s,1,Wait(1) ;exten => s,n,Answer() ;exten => s,n(menu),Playback(acme/vm-brief-menu) ;exten => s,n(exten),Background(vm-enter-num-to-call) ;exten => s,n,WaitExten(5) ;exten => s,n(goodbye),Playback(vm-goodbye) ;exten => s,n(end),Hangup() ; ;include => acme-extens ; ;exten => i,1,Playback(vm-invalid) ;exten => i,n,Goto(s,exten) ; optionally, transfer to operator ; ;exten => t,1,Goto(s,goodbye) ; ; this is the context our internal SIP hardphones use (see sip.conf) ; ;[acme-internal] ;exten => s,1,Answer() ;exten => s,n(exten),Background(vm-enter-num-to-call) ;exten => s,n,WaitExten(5) ;exten => s,n(goodbye),Playback(vm-goodbye) ;exten => s,n(end),Hangup() ; ;include => trunkint ;include => trunkld ;include => trunklocal ; ;include => acme-extens ; ; you can test what your system sounds like to outside callers by dialing this ;exten => 777,1,DISA(no-password,acme-incoming) ; ; grouping of acme's extensions... never used directly, always included. ; ;[acme-extens] ;include => stdexten ;exten => 111,1,Gosub(111,stdexten(SIP/pete_1,acme)) ;exten => 111,n,Goto(s,exten) ; ;exten => 112,1,Gosub(112,stdexten(SIP/nancy_1,acme)) ;exten => 112,n,Goto(s,end) ; ; end of acme example ; ; Time context: you can patch this in via the following. ; ; [acme-internal] ; ... ; exten => 777,1,Gosub(time) ; exten => 777,n,Hangup() ; ; ... ; include => time ; ; Note: if you're geographically spread out, you can have SIP extensions ; specify their own local timezone in sip.conf as: ; ; [boi] ; type=friend ; context=acme-internal ; callerid="Boise Ofc. <2083451111>" ; ... ; ; use system-wide default timezone of MST7MDT ; ; [lws] ; type=friend ; context=acme-internal ; callerid="Lewiston Ofc. <2087431111>" ; ... ; setvar=timezone=PST8PDT ; ; "timezone" isn't a 'reserved' name in any way, and other places where ; the timezone is significant (e.g. calls to "SayUnixTime()", etc) will ; require modification as well. Note that voicemail.conf already has ; a mechanism for timezones. ; [time] exten => _X.,30000(time),NoOp(Time: ${EXTEN} ${timezone}) exten => _X.,n,Wait(0.25) exten => _X.,n,Answer() ; the amount of delay is set for English; you may need to adjust this time ; for other languages if there's no pause before the synchronizing beep. exten => _X.,n,Set(FUTURETIME=$[${EPOCH} + 12]) exten => _X.,n,SayUnixTime(${FUTURETIME},Zulu,HNS) exten => _X.,n,SayPhonetic(z) ; use the timezone associated with the extension (sip only), or system-wide ; default if one hasn't been set. exten => _X.,n,SayUnixTime(${FUTURETIME},${timezone},HNS) exten => _X.,n,Playback(spy-local) exten => _X.,n,WaitUntil(${FUTURETIME}) exten => _X.,n,Playback(beep) exten => _X.,n,Return() ; ; ANI context: use in the same way as "time" above ; [ani] exten => _X.,40000(ani),NoOp(ANI: ${EXTEN}) exten => _X.,n,Wait(0.25) exten => _X.,n,Answer() exten => _X.,n,Playback(vm-from) exten => _X.,n,SayDigits(${CALLERID(ani)}) exten => _X.,n,Wait(1.25) exten => _X.,n,SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit exten => _X.,n,Return() ; 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.
sip.conf sip_notify.conf
[general] context=default allowoverlap=no udpbindaddr=0.0.0.0 tcpenable=no tcpbindaddr=0.0.0.0 srvlookup=yes [2101] type=friend ;friend, user, peer secret=1234 host=dynamic [2102] type=friend ;friend, user, peer secret=1234 host=dynamic
Время первой команды журнала | 13:15:27 2011-10-17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 08:46:24 2011-10-18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 12.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 4.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.57 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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