/l3/users/igor-public/asterisk/debian1.net.nt/root |
|
#pkill -1 l3-agent
|
#who
user tty7 2009-11-27 05:54 (:0) user pts/0 2009-11-27 05:55 (:0.0) user pts/1 2009-11-27 06:09 (:0.0) user pts/3 2009-11-27 06:13 (:0:S.0) |
#ls
Desktop install |
#apt-get install build-e
|
#/etc/bash_completion.d/
l3script: /etc/bash_completion.d/: is a directory |
#./etc/bash_completion
l3script: ./etc/bash_completion: No such file or directory |
#ls /etc/bash_completion
/etc/bash_completion |
#. /etc/bash_completion
|
#apt-get install build-essential
Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
#ifconfig eth0 192.168.7.1
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 inet6 addr: fe80::204:76ff:fea1:f05d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:24868 errors:0 dropped:0 overruns:1 frame:0 TX packets:8175 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:19566830 (18.6 MiB) TX bytes:769967 (751.9 KiB) Interrupt:20 Base address:0x6c00 eth1 Link encap:Ethernet HWaddr 00:1b:fc:7d:b5:98 ... collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:560 (560.0 B) TX bytes:560 (560.0 B) |
#route add default gw 192.168.7.254
|
#vim /etc/network/interfaces
--- /tmp/l3-saved-6742.28162.17275 2009-11-28 04:28:50.000000000 -0500 +++ /etc/network/interfaces 2009-11-28 04:30:21.000000000 -0500 @@ -2,9 +2,14 @@ # and how to activate them. For more information, see interfaces(5). # The loopback network interface -auto lo +auto lo eth0 iface lo inet loopback # The primary network interface -allow-hotplug eth0 -iface eth0 inet dhcp +#allow-hotplug eth0 +#iface eth0 inet dhcp + +iface eth0 inet static + address 192.168.7.1 + netmask 255.255.255.0 + gateway 192.168.7.254 |
#/etc/init.d/network-manager-dispatcher stop
Stopping network events dispatcher: NetworkManagerDispatcher. |
#/etc/init.d/network-manager stop
Stopping network connection manager: NetworkManager. |
#ifup eth0
ifup: interface eth0 already configured |
#ifdown eth0
SIOCDELRT: No such process |
#ifdown eth0
ifdown: interface eth0 not configured |
#ifup eth0
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 inet6 addr: fe80::204:76ff:fea1:f05d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:25896 errors:0 dropped:0 overruns:1 frame:0 TX packets:8714 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:19719587 (18.8 MiB) TX bytes:859589 (839.4 KiB) Interrupt:20 Base address:0x6c00 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:16 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1360 (1.3 KiB) TX bytes:1360 (1.3 KiB) |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 inet6 addr: fe80::204:76ff:fea1:f05d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:25908 errors:0 dropped:0 overruns:1 frame:0 TX packets:8731 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:19720745 (18.8 MiB) TX bytes:863096 (842.8 KiB) Interrupt:20 Base address:0x6c00 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:16 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1360 (1.3 KiB) TX bytes:1360 (1.3 KiB) |
#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 debhelper gettext html2text intltool-debian libc-client2007b libcompress-raw-zlib-perl libcompress-zlib-perl libdigest-hmac-perl libdigest-sha1-perl libfile-remove-perl libiksemel3 libio-compress-base-perl libio-compress-zlib-perl libio-stringy-perl libmail-box-perl libmail-sendmail-perl libmailtools-perl libmime-types-perl libobject-realize-later-perl libpq5 libpri1.0 libradiusclient-ng2 libsqlite0 libsys-hostname-long-perl libtonezone1 libuser-identity-perl libvpb0 mlock module-assistant odbcinst1debian1 po-debconf unixodbc vpb-driver-source Suggested packages: ohphone twinkle kphone asterisk-doc asterisk-dev asterisk-h323 dh-make cvs gettext-doc uw-mailutils libmime-tools-perl libhtml-format-perl spamassassin libmail-imapclient-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) ... |
#dpkg -L astrisk
Package `astrisk' is not installed. Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg --contents (= dpkg-deb --contents) to list their contents. |
#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 |
#dpkg -L asterisk sk|
> |
#dpkg -L asterisk | grep .conf
/usr/lib/asterisk/modules/res_config_odbc.so /usr/lib/asterisk/modules/res_config_pgsql.so /usr/lib/asterisk/modules/pbx_config.so |
#dpkg -L asterisk | grep *conf
|
#dpkg -L asterisk | grep etc
/etc /etc/asterisk /etc/logrotate.d /etc/logrotate.d/asterisk /etc/default /etc/default/asterisk /etc/init.d /etc/init.d/asterisk /usr/lib/asterisk/modules/app_getcpeid.so /usr/lib/asterisk/modules/app_setcallerid.so /usr/lib/asterisk/modules/app_setcdruserfield.so |
#ls /etc/asterisk/
adsi.conf asterisk.conf codecs.conf extensions.conf http.conf manager.d osp.conf res_snmp.conf sla.conf watchdog.conf adtranvofr.conf cdr.conf dnsmgr.conf features.conf iax.conf meetme.conf oss.conf rpt.conf smdi.conf zapata.conf agents.conf cdr_custom.conf dundi.conf festival.conf iaxprov.conf mgcp.conf phone.conf rtp.conf telcordia-1.adsi alarmreceiver.conf cdr_manager.conf enum.conf followme.conf indications.conf misdn.conf privacy.conf say.conf udptl.conf alsa.conf cdr_odbc.conf esel.conf func_odbc.conf jabber.conf modules.conf queues.conf sip.conf users.conf amd.conf cdr_pgsql.conf extconfig.conf gtalk.conf logger.conf musiconhold.conf res_odbc.conf sip_notify.conf voicemail.conf asterisk.adsi cdr_tds.conf extensions.ael h323.conf manager.conf muted.conf res_pgsql.conf skinny.conf vpb.conf |
#ls -l /etc/rc2.d/*asterisk
lrwxrwxrwx 1 root root 18 2009-11-28 04:50 /etc/rc2.d/S21asterisk -> ../init.d/asterisk |
#ls /etc/default/asterisk
/etc/default/asterisk |
#cat /etc/default/asterisk
# This file allows you to alter the configuration of the Asterisk # init.d script. Normally you should leave the file as-is. # # RUNASTERISK: If set to anything other that 'yes', the asterisk init.d script # will not run. The default is 'yes'. #RUNASTERISK=no # # # AST_REALTIME: if set to anything other than "no", asterisk will run in # real-time priority (pass '-p' to asterisk). un-rem the ... # However if you just enable generation of core files and run # asterisk as a daemon it will fail to write core files. # # Alternatively you can set this independently elsewhere. # See http://lxr.linux.no/source/Documentation/sysctl/kernel.txt # Here is what Asterisk's ast_grab_core # script would expect: #CORE_PATTERN='core.%p' # But you might prefer something like: #CORE_PATTERN='core.%e.%t' |
#pkill dhclient
|
#pkill dhclient3
|
#ping 192.168.7.4
PING 192.168.7.4 (192.168.7.4) 56(84) bytes of data. 64 bytes from 192.168.7.4: icmp_seq=1 ttl=64 time=4.05 ms 64 bytes from 192.168.7.4: icmp_seq=2 ttl=64 time=0.118 ms ^C --- 192.168.7.4 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1003ms rtt min/avg/max/mdev = 0.118/2.085/4.053/1.968 ms |
#cd /etc/asterisk/
|
#ls
adsi.conf asterisk.conf codecs.conf extensions.conf http.conf manager.d osp.conf res_snmp.conf sla.conf watchdog.conf adtranvofr.conf cdr.conf dnsmgr.conf features.conf iax.conf meetme.conf oss.conf rpt.conf smdi.conf zapata.conf agents.conf cdr_custom.conf dundi.conf festival.conf iaxprov.conf mgcp.conf phone.conf rtp.conf telcordia-1.adsi alarmreceiver.conf cdr_manager.conf enum.conf followme.conf indications.conf misdn.conf privacy.conf say.conf udptl.conf alsa.conf cdr_odbc.conf esel.conf func_odbc.conf jabber.conf modules.conf queues.conf sip.conf users.conf amd.conf cdr_pgsql.conf extconfig.conf gtalk.conf logger.conf musiconhold.conf res_odbc.conf sip_notify.conf voicemail.conf asterisk.adsi cdr_tds.conf extensions.ael h323.conf manager.conf muted.conf res_pgsql.conf skinny.conf vpb.conf |
#vim sip
|
#vim sip
|
#vim sip.conf
|
#allowoverlap=no ; Disable overlap dialing support. (Default is yes)
|
#dpkg -l | grep asterisk
ii asterisk 1:1.4.21.2~dfsg-3 Open Source Private Branch Exchange (PBX) ii asterisk-config 1:1.4.21.2~dfsg-3 Configuration files for Asterisk ii asterisk-sounds-main 1:1.4.21.2~dfsg-3 Core Sound files for Asterisk (English) |
#dpkg -L asterisk-sounds-main
/. /usr /usr/share /usr/share/asterisk /usr/share/asterisk/sounds /usr/share/asterisk/sounds/es /usr/share/asterisk/sounds/fr /usr/share/asterisk/sounds/CHANGES-asterisk-core-en-1.4.9 /usr/share/asterisk/sounds/CREDITS-asterisk-core-en-1.4.9 /usr/share/asterisk/sounds/agent-alreadyon.gsm ... /usr/share/asterisk/moh /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/asterisk-sounds-main /usr/share/doc /usr/share/doc/asterisk-sounds-main /usr/share/doc/asterisk-sounds-main/copyright /usr/share/doc/asterisk-sounds-main/NEWS.Debian.gz /usr/share/doc/asterisk-sounds-main/changelog.gz /usr/share/doc/asterisk-sounds-main/changelog.Debian.gz |
#vim sip.conf
--- /tmp/l3-saved-7109.6657.18485 2009-11-28 05:15:08.000000000 -0500 +++ sip.conf 2009-11-28 05:34:00.000000000 -0500 @@ -571,19 +571,19 @@ ; See doc/callingpres.txt for more information -;[xlite1] +[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 +type=friend +regexten=1111 ; When they register, create extension 1234 +callerid="ho" <1111> +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 +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 |
#vim ext
|
#vim extensions.conf
|
#:q
|
#vi sip.conf
|
#;vmexten=voicemail ; dialplan extension to reach mailbox
; See doc/callingpres.txt for more information ;allow=g729 ; Pass-thru only unless g729 license obtained ;callingpres=allowed_passed_screen ; Set caller ID presentation [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=1111 ; When they register, create extension 1234 callerid="ho" <1111> host=dynamic ; This device needs to register ... ;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 ; subscribes for mailbox notification ;vmexten=voicemailext,2345 ; sets the Message-Account in the MWI notify message ; defaults to global vmexten which defaults to "asterisk" "sip.conf" 669L, 31865C written |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#ping 192.168.7.4
PING 192.168.7.4 (192.168.7.4) 56(84) bytes of data. From 192.168.7.1 icmp_seq=1 Destination Host Unreachable From 192.168.7.1 icmp_seq=2 Destination Host Unreachable From 192.168.7.1 icmp_seq=3 Destination Host Unreachable ^C --- 192.168.7.4 ping statistics --- 6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5020ms , pipe 3 |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 inet6 addr: fe80::204:76ff:fea1:f05d/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:39286 errors:0 dropped:0 overruns:1 frame:0 TX packets:17394 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33263952 (31.7 MiB) TX bytes:2038365 (1.9 MiB) Interrupt:20 Base address:0x6c00 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:197 errors:0 dropped:0 overruns:0 frame:0 TX packets:197 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:18012 (17.5 KiB) TX bytes:18012 (17.5 KiB) |
#ping 192.168.7.254
PING 192.168.7.254 (192.168.7.254) 56(84) bytes of data. From 192.168.7.1 icmp_seq=1 Destination Host Unreachable From 192.168.7.1 icmp_seq=2 Destination Host Unreachable From 192.168.7.1 icmp_seq=5 Destination Host Unreachable From 192.168.7.1 icmp_seq=6 Destination Host Unreachable From 192.168.7.1 icmp_seq=8 Destination Host Unreachable From 192.168.7.1 icmp_seq=9 Destination Host Unreachable From 192.168.7.1 icmp_seq=12 Destination Host Unreachable From 192.168.7.1 icmp_seq=13 Destination Host Unreachable From 192.168.7.1 icmp_seq=16 Destination Host Unreachable From 192.168.7.1 icmp_seq=17 Destination Host Unreachable From 192.168.7.1 icmp_seq=20 Destination Host Unreachable From 192.168.7.1 icmp_seq=21 Destination Host Unreachable ^C --- 192.168.7.254 ping statistics --- 23 packets transmitted, 0 received, +12 errors, 100% packet loss, time 22036ms , pipe 2 |
#ping 192.168.7.254
PING 192.168.7.254 (192.168.7.254) 56(84) bytes of data. From 192.168.7.1 icmp_seq=1 Destination Host Unreachable From 192.168.7.1 icmp_seq=4 Destination Host Unreachable From 192.168.7.1 icmp_seq=5 Destination Host Unreachable From 192.168.7.1 icmp_seq=8 Destination Host Unreachable From 192.168.7.1 icmp_seq=9 Destination Host Unreachable From 192.168.7.1 icmp_seq=11 Destination Host Unreachable From 192.168.7.1 icmp_seq=12 Destination Host Unreachable From 192.168.7.1 icmp_seq=13 Destination Host Unreachable ^C --- 192.168.7.254 ping statistics --- 16 packets transmitted, 0 received, +8 errors, 100% packet loss, time 15017ms , pipe 3 |
#ifdown -v eth0
Configuring interface eth0=eth0 (inet) run-parts --verbose /etc/network/if-down.d run-parts: executing /etc/network/if-down.d/wpasupplicant route del default gw 192.168.7.254 eth0 ifconfig eth0 down run-parts --verbose /etc/network/if-post-down.d run-parts: executing /etc/network/if-post-down.d/avahi-daemon run-parts: executing /etc/network/if-post-down.d/wpasupplicant |
#ifup -v eth0
Configuring interface eth0=eth0 (inet) run-parts --verbose /etc/network/if-pre-up.d run-parts: executing /etc/network/if-pre-up.d/wpasupplicant ifconfig eth0 192.168.7.1 netmask 255.255.255.0 up route add default gw 192.168.7.254 eth0 run-parts --verbose /etc/network/if-up.d run-parts: executing /etc/network/if-up.d/avahi-daemon run-parts: executing /etc/network/if-up.d/mountnfs run-parts: executing /etc/network/if-up.d/ntpdate run-parts: executing /etc/network/if-up.d/openssh-server run-parts: executing /etc/network/if-up.d/wpasupplicant |
#ping 192.168.7.254
PING 192.168.7.254 (192.168.7.254) 56(84) bytes of data. ^C --- 192.168.7.254 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2012ms |
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:39286 errors:0 dropped:0 overruns:1 frame:0 TX packets:17394 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33263952 (31.7 MiB) TX bytes:2038365 (1.9 MiB) Interrupt:20 Base address:0x6c00 |
#mii-tool
eth0: no link SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:39286 errors:0 dropped:0 overruns:1 frame:0 TX packets:17394 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33263952 (31.7 MiB) TX bytes:2038365 (1.9 MiB) Interrupt:20 Base address:0x6c00 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:248 errors:0 dropped:0 overruns:0 frame:0 TX packets:248 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:23114 (22.5 KiB) TX bytes:23114 (22.5 KiB) |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:39286 errors:0 dropped:0 overruns:1 frame:0 TX packets:17394 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33263952 (31.7 MiB) TX bytes:2038365 (1.9 MiB) Interrupt:20 Base address:0x6c00 eth1 Link encap:Ethernet HWaddr 00:1b:fc:7d:b5:98 BROADCAST MULTICAST MTU:1500 Metric:1 ... collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:248 errors:0 dropped:0 overruns:0 frame:0 TX packets:248 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:23114 (22.5 KiB) TX bytes:23114 (22.5 KiB) |
#ping 192.168.7.254
PING 192.168.7.254 (192.168.7.254) 56(84) bytes of data. From 192.168.7.1 icmp_seq=2 Destination Host Unreachable From 192.168.7.1 icmp_seq=3 Destination Host Unreachable From 192.168.7.1 icmp_seq=5 Destination Host Unreachable From 192.168.7.1 icmp_seq=6 Destination Host Unreachable From 192.168.7.1 icmp_seq=7 Destination Host Unreachable ^C --- 192.168.7.254 ping statistics --- 7 packets transmitted, 0 received, +5 errors, 100% packet loss, time 6018ms , pipe 3 |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#ping 192.168.7.210
PING 192.168.7.210 (192.168.7.210) 56(84) bytes of data. From 192.168.7.1 icmp_seq=1 Destination Host Unreachable From 192.168.7.1 icmp_seq=2 Destination Host Unreachable From 192.168.7.1 icmp_seq=3 Destination Host Unreachable From 192.168.7.1 icmp_seq=5 Destination Host Unreachable From 192.168.7.1 icmp_seq=6 Destination Host Unreachable From 192.168.7.1 icmp_seq=7 Destination Host Unreachable From 192.168.7.1 icmp_seq=9 Destination Host Unreachable From 192.168.7.1 icmp_seq=10 Destination Host Unreachable From 192.168.7.1 icmp_seq=11 Destination Host Unreachable ... From 192.168.7.1 icmp_seq=37 Destination Host Unreachable From 192.168.7.1 icmp_seq=38 Destination Host Unreachable From 192.168.7.1 icmp_seq=39 Destination Host Unreachable From 192.168.7.1 icmp_seq=41 Destination Host Unreachable From 192.168.7.1 icmp_seq=42 Destination Host Unreachable From 192.168.7.1 icmp_seq=43 Destination Host Unreachable ^C --- 192.168.7.210 ping statistics --- 43 packets transmitted, 0 received, +33 errors, 100% packet loss, time 42052ms , pipe 3 |
#ping 192.168.7.210
PING 192.168.7.210 (192.168.7.210) 56(84) bytes of data. ^C --- 192.168.7.210 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 1999ms |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:39286 errors:0 dropped:0 overruns:1 frame:0 TX packets:17394 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33263952 (31.7 MiB) TX bytes:2038365 (1.9 MiB) Interrupt:20 Base address:0x6c00 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:344 errors:0 dropped:0 overruns:0 frame:0 TX packets:344 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:33006 (32.2 KiB) TX bytes:33006 (32.2 KiB) |
#mii-tool
eth0: no link SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#mii-tool
eth0: no link SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#mii-tool
eth0: no link SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#mii-tool
eth0: no link SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#mii-tool
eth0: no link SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#mii-tool
eth0: no link SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#mii-tool
eth0: negotiated 100baseTx-FD, link ok SIOCGMIIPHY on 'eth1' failed: Invalid argument |
#ping 192.168.7.254
PING 192.168.7.254 (192.168.7.254) 56(84) bytes of data. 64 bytes from 192.168.7.254: icmp_seq=1 ttl=64 time=0.211 ms 64 bytes from 192.168.7.254: icmp_seq=2 ttl=64 time=0.204 ms ^C --- 192.168.7.254 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.204/0.207/0.211/0.014 ms |
#vim extensions.conf
|
#230 fewer lines
|
#vim sip.conf
--- /tmp/l3-saved-7109.22608.2425 2009-11-28 06:04:37.000000000 -0500 +++ sip.conf 2009-11-28 06:06:02.000000000 -0500 @@ -576,6 +576,7 @@ ; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed type=friend regexten=1111 ; When they register, create extension 1234 +context=demo1 callerid="vovan" host=dynamic ; This device needs to register ;nat=yes ; X-Lite is behind a NAT router |
#asterisk -r
Asterisk 1.4.21.2~dfsg-3, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= Connected to Asterisk 1.4.21.2~dfsg-3 currently running on debian1 (pid = 10554) debian1*CLI> quit |
#asterisk -rvv
Asterisk 1.4.21.2~dfsg-3, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... debian1*CLI> debian1*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 1111/1111 192.168.7.210 D 2049 Unmonitored 1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline] == Spawn extension (demo1, 1000, 3) exited non-zero on 'SIP/1111-09670c50' == Spawn extension (demo1, 1000, 3) exited non-zero on 'SIP/1111-09670c50' == Spawn extension (demo1, 1000, 3) exited non-zero on 'SIP/1111-09670c50' debian1*CLI> quit Executing last minute cleanups |
#vim sip.conf
--- /tmp/l3-saved-7109.4436.29932 2009-11-28 06:09:50.000000000 -0500 +++ sip.conf 2009-11-28 06:12:05.000000000 -0500 @@ -588,6 +588,19 @@ ;mailbox=1234@default,1233@default ; Subscribe to status of multiple mailboxes +[aster4] +; 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 +context=demo1 +host=192.168.7.4 +;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 + ;[snom] ;type=friend ; Friends place calls and receive calls ;context=from-sip ; Context for incoming calls from this user |
#vim extensions.conf
--- /tmp/l3-saved-7109.7044.12202 2009-11-28 06:12:10.000000000 -0500 +++ extensions.conf 2009-11-28 06:14:28.000000000 -0500 @@ -151,4 +151,5 @@ exten => 1000,n,Playback(demo-thanks) exten => 1000,n,Hangup - +exten => _4XXX,1,Dial(SIP/aster4/${EXTEN},60) +exten => _4XXX,n,Hangup() |
#asterisk -rvv
Asterisk 1.4.21.2~dfsg-3, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... == Setting global variable 'TRUNKMSD' to '1' == Parsing '/etc/asterisk/users.conf': Found debian1*CLI> == Spawn extension (demo1, 4444, 2) exited non-zero on 'SIP/1111-09684828' debian1*CLI> debian1*CLI> debian1*CLI> exi No such command 'exi' (type 'help exi' for other possible commands) debian1*CLI> exit Executing last minute cleanups |
#vim sip.conf
--- /tmp/l3-saved-7109.390.9388 2009-11-28 06:15:09.000000000 -0500 +++ sip.conf 2009-11-28 06:15:47.000000000 -0500 @@ -594,6 +594,7 @@ type=friend context=demo1 host=192.168.7.4 +qualify=1 ;nat=yes ; X-Lite is behind a NAT router canreinvite=no ; Typically set to NO if behind NAT disallow=all |
#asterisk -rvv
Asterisk 1.4.21.2~dfsg-3, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... == Spawn extension (demo1, 4444, 2) exited non-zero on 'SIP/1111-09684828' debian1*CLI> debian1*CLI> debian1*CLI> == Spawn extension (demo1, 4444, 2) exited non-zero on 'SIP/1111-09684828' == Spawn extension (demo1, 4000, 1) exited non-zero on 'SIP/1111-09684828' debian1*CLI> debian1*CLI> debian1*CLI> exit Executing last minute cleanups |
#vim extensions.conf
--- /tmp/l3-saved-7109.9283.28593 2009-11-28 06:19:16.000000000 -0500 +++ extensions.conf 2009-11-28 06:20:46.000000000 -0500 @@ -151,5 +151,8 @@ exten => 1000,n,Playback(demo-thanks) exten => 1000,n,Hangup +exten => _1XXX,1,Dial(SIP/${EXTEN},60) +exten => _1XXX,n,Hangup() + exten => _4XXX,1,Dial(SIP/aster4/${EXTEN},60) exten => _4XXX,n,Hangup() |
#asterisk -rvv
Asterisk 1.4.21.2~dfsg-3, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= This package has been modified for the Debian GNU/Linux distribution Please report all bugs to http://bugs.debian.org/asterisk ========================================================================= ... == Setting global variable 'CONSOLE' to 'Console/dsp' == Setting global variable 'IAXINFO' to 'guest' == Setting global variable 'TRUNK' to 'Zap/G2' == Setting global variable 'TRUNKMSD' to '1' == Parsing '/etc/asterisk/users.conf': Found debian1*CLI> == Spawn extension (demo1, 4444, 2) exited non-zero on 'SIP/1111-09684828' debian1*CLI> debian1*CLI> exit Executing last minute cleanups |
#vim sip.conf
|
#;subscribecontext=localextensions ; Only allow SUBSCRIBE for local extensions
; ; 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 ... ; extension, which can take one of two forms as listed below, ; with the first form being preferred. [demo1] exten => 1000,1,ANSWER exten => 1000,n,Playback(demo-thanks) exten => 1000,n,Hangup exten => _1XXX,1,Dial(SIP/${EXTEN},60) exten => _1XXX,n,Hangup() exten => _4XXX,1,Dial(SIP/aster4/${EXTEN},60) exten => _4XXX,n,Hangup() |
#e
context=demo1 callerid="vovan" 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 ... canreinvite=no ; Typically set to NO if behind NAT disallow=all allow=gsm ; GSM consumes far less bandwidth than ulaw allow=ulaw allow=alaw ;[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 |
#vim extensions.conf
|
#{EXTEN},60)
; ;videosupport=yes ; in the this section to get any video support at all. on ; 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 ; Videosupport and maxcallbitrate is settable4 kb/s) ; for peers and users as well ;callevents=no ; performs events (e.g. hold)n sip ua ;alwaysauthreject = yes ; for any reason, always reject with '401 Unauthorized', ; instead of letting the requester know whether there was ... ;context=from-sip ; Context for incoming calls from this user ;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw! ;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 |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 inet6 addr: fe80::204:76ff:fea1:f05d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:329 errors:0 dropped:0 overruns:0 frame:0 TX packets:135 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:41788 (40.8 KiB) TX bytes:18237 (17.8 KiB) Interrupt:20 Base address:0x8c00 eth1 Link encap:Ethernet HWaddr 00:1b:fc:7d:b5:98 ... collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:9 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:639 (639.0 B) TX bytes:639 (639.0 B) |
# This file allows you to alter the configuration of the Asterisk # init.d script. Normally you should leave the file as-is. # # RUNASTERISK: If set to anything other that 'yes', the asterisk init.d script # will not run. The default is 'yes'. #RUNASTERISK=no # # # AST_REALTIME: if set to anything other than "no", asterisk will run in # real-time priority (pass '-p' to asterisk). un-rem the # following line to disable asterisk from running in real-time # priority #AST_REALTIME=no # # PARAMS: extra parameters to pass to asterisk: generate cores in # case of crash, and be more verbose. -F guarantees that Asterisk # will still run daemonized. # # Instead of adding switches here, consider editing # /etc/asterisk/asterisk.conf #PARAMS="-F -g -vvv" # # # RUNASTSAFE: run safe_asterisk rather than asterisk (will auto-restart upon # crash). This is generally less tested and has some known issues # with properly starting and stopping Asterisk. #RUNASTSAFE=yes # # ASTSAFE_CONSOLE: whether you want safe_asterisk to spawn a console for Asterisk. #ASTSAFE_CONSOLE=yes # # ASTSAFE_TTY: tty for Asterisk to run on (only for safe_asterisk) #ASTSAFE_TTY=9 # # MAXFILES: Set this to the number of open file handles the Asterisk # process can have. Useful if you get "Too many open files" error. #MAXFILES=8192 # # AST_DUMPCORE: if set to anything other than "no", asterisk will be run with # the option -g (to tell it to dump core on crash) and its # working directory will be set to /var/spool/asterisk, as that # directory is writable and hence core files can be written there. # See /etc/init.d/asterisk for some other relevant variables. # # It is recommended that you install asterisk-dbg to be able # to produce meaningful backtraces from the core file. # # By default core files will be written to /tmp (can be # changed by setting AST_DUMPCORE_DIR). Alternatively, see # CORE_PATTERN below. #AST_DUMPCORE=yes # # AST_DUMPCORE_DIR: By default asterisk runs in the directory '/' like any # daemon. Setting this allows you to tell it to tell the # Asterisk daemon to run in a different directory if # AST_DUMPCORE is enabled. The default is # /var/spool/asterisk. That is a good choice because it # is writable (thus enabling the actual writing of the # core file) but relatively immune to symlink attacks # (because not world-writable like /tmp/). # Note, however, that if CORE_PATTERN is an absolute # path, it will override AST_DUMPCORE_DIR. # # CORE_PATTERN: If you use AST_DUMPCORE above, this is optionally set to a # pattern of the core file. The default is not to touch the # core_pattern settings, which is generally a good idea as # it affects every core file generated on your system. # # However if you just enable generation of core files and run # asterisk as a daemon it will fail to write core files. # # Alternatively you can set this independently elsewhere. # See http://lxr.linux.no/source/Documentation/sysctl/kernel.txt # Here is what Asterisk's ast_grab_core # script would expect: #CORE_PATTERN='core.%p' # But you might prefer something like: #CORE_PATTERN='core.%e.%t'
Время первой команды журнала | 10:20:45 2009-11-28 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:17:29 2009-11-28 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 93 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 15.05 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.08 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.73 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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