Журнал лабораторных работ

Содержание

Журнал

Суббота (04/26/14)

/dev/pts/2
08:19:39
#vi /etc/asterisk/extensions.conf.local
08:23:54
#~
exten => _83XX,1,Answer
exten => _83XX,n,AgentLogin(0${EXTEN:2})
;exten => _22XX,1,Dial(SIP/${EXTEN})
;;exten => _2201,1,Dial(SIP/2201,3)
;;exten => _2201,n,NoOp(Dial Status: ${DIALSTATUS})
;exten => _2201,n,Dial(SIP/2202)
;exten => _2201,n,Goto(s-${DIALSTATUS})
;exten => s-NOANSWER,n,Dial(SIP/2202)
;exten => s-CONGESTION,n,Dial(SIP/2202)
08:24:04
#;exten => s-ANSWER,n,Hangup
; A strategy may be specified.  Valid strategies include:
;
; ringall - ring all available channels until one answers (default)
; leastrecent - ring interface which was least recently hung up by this queue
; fewestcalls - ring the one with fewest completed calls from this queue
; random - ring random interface
; rrmemory - round robin with memory, remember where we left off last ring pass
; rrordered - same as rrmemory, except the queue member order from config file
;             is preserved
; linear - rings interfaces in the order specified in this configuration file.
...
~
~
~
~
~
~
~
~
"/etc/asterisk/queues.conf" 544L, 23930C written
~
08:27:09
#vi /etc/asterisk/extensions.conf.local
--- /tmp/l3-saved-13163.14140.19171	2014-04-26 09:27:12.885319775 +0300
+++ /etc/asterisk/extensions.conf.local	2014-04-26 09:28:16.325320963 +0300
@@ -3,8 +3,9 @@
 exten => 2299,1,Dial(SIP/2201&SIP/2202)
 exten => 2299,1,Hangup
 
-exten => 2298,1,Answer
+exten => 2298,1,Answer  ;для queue обязательно 
 exten => 2298,n,Queue(queue1)
+exten => 2298,n,Hangup
 
 exten => _22XX,1,Macro(localcall,${EXTEN})
 
08:28:16
#vi /etc/asterisk/queues.conf
08:33:17
#vi /etc/asterisk/extensions.conf
08:34:18
#cat /tmp/1.call
cat: /tmp/1.call: No such file or directory
08:36:26
#vi /tmp/1.call
--- /tmp/l3-saved-13163.16212.22391	2014-04-26 09:36:31.049330253 +0300
+++ /tmp/1.call	2014-04-26 09:36:43.993330495 +0300
@@ -1,3 +1,3 @@
 Channel: SIP/2201
 Extension: 8200
-COntext: internal
+Context: internal
08:36:44
#chown asterisk:asterisk /tmp/1.call

08:37:11
#cp -p /tmp/1.call /var/spool/asterisk/outgoing/

08:37:34
#ls -al /usr/local/bin/
total 64
drwxrwsr-x  2 root     staff     4096 Apr 26 09:45 .
drwxrwsr-x 10 root     staff     4096 Apr 22 12:10 ..
-rwxr-xr-x  1 root     staff      702 Apr 25 14:18 asterisk-festival.pl
-rw-r--r--  1 root     staff      267 Apr 26 09:45 call-all
-rw-r-xr-x  1 asterisk asterisk   152 Apr 24 17:29 jabber-send
-rwxr-xr-x  1 root     staff    33439 Apr 22 13:55 l3-agent
-rwxr-xr-x  1 root     staff      100 Apr 22 13:55 l3-config
lrwxrwxrwx  1 root     staff        9 Apr 22 13:55 l3script -> /bin/bash
-rwxr-xr-x  1 root     staff      133 Apr 25 10:58 restart-samba
08:45:58
#cat /usr/local/bin/call-all
for N in kiev/{1,2,3}{1,2,3}0{1,2}
do
N=`echo $N | sed s@kiev/11@11@`
FILENAME=/tmp/$RANDOM$RANDOM.call
cat <<EOF > $FILENAME
Channel: SIP/$N
Extension: 8107
Context: internal
EOF
chown asterisk:asterisk $FILENAME
mv $FILENAME /var/spool/asterisk/outgoing/
done
08:49:37
#crontab -l
no crontab for root
08:52:53
#crontab -e
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
* * * * * /usr/local/bin/call-all
                                           [ Wrote 24 lines ]
crontab: installing new crontab
08:54:08
#crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
...
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
* * * * * /usr/local/bin/call-all
08:54:12
#/etc/init.d/crontab
acpid                   gdm3                    mtab.sh                 screen-cleanup
alsa-utils              halt                    networking              sendsigs
anacron                 hdparm                  network-manager         single
asterisk                hostname.sh             nfs-common              speech-dispatcher
atd                     hwclock.sh              pppd-dns                ssh
avahi-daemon            kbd                     procps                  sudo
binfmt-support          keyboard-setup          pulseaudio              udev
bluetooth               killprocs               rc                      udev-mtab
bootlogs                kmod                    rc.local                umountfs
bootmisc.sh             minissdpd               rcS                     umountnfs.sh
checkfs.sh              motd                    reboot                  umountroot
checkroot-bootclean.sh  mountall-bootclean.sh   rmnologin               unattended-upgrades
checkroot.sh            mountall.sh             rpcbind                 urandom
console-setup           mountdevsubfs.sh        rsync                   x11-common
cron                    mountkernfs.sh          rsyslog
dbus                    mountnfs-bootclean.sh   samba
exim4                   mountnfs.sh             saned
08:54:12
#/etc/init.d/cron restart
Restarting periodic command scheduler: cronStopping periodic command scheduler: cron.
Starting periodic command scheduler: cron.
08:54:37
#vi /usr/local/bin/call-all
08:55:17
#вфdate
Sat Apr 26 09:55:46 EEST 2014
08:55:46
#date
Sat Apr 26 09:55:47 EEST 2014
08:55:47
#date
Sat Apr 26 09:55:48 EEST 2014
08:55:48
#date
Sat Apr 26 09:55:48 EEST 2014
08:55:48
#date
Sat Apr 26 09:55:48 EEST 2014
08:55:48
#date
Sat Apr 26 09:55:49 EEST 2014
08:55:49
#date
Sat Apr 26 09:55:49 EEST 2014
08:55:49
#date
Sat Apr 26 09:55:49 EEST 2014
08:55:49
#date
Sat Apr 26 09:55:50 EEST 2014
08:55:50
#date
Sat Apr 26 09:55:50 EEST 2014
08:55:50
#date
Sat Apr 26 09:55:50 EEST 2014
08:55:50
#date
Sat Apr 26 09:55:51 EEST 2014
08:55:51
#date
Sat Apr 26 09:55:51 EEST 2014
08:55:51
#date
Sat Apr 26 09:55:51 EEST 2014
08:55:51
#date
Sat Apr 26 09:55:53 EEST 2014
08:55:53
#date
Sat Apr 26 09:55:54 EEST 2014
08:55:54
#date
Sat Apr 26 09:55:54 EEST 2014
08:55:54
#date
Sat Apr 26 09:55:55 EEST 2014
08:55:55
#date
Sat Apr 26 09:56:01 EEST 2014
08:56:01
#date
Sat Apr 26 09:56:02 EEST 2014
08:56:02
#date
Sat Apr 26 09:56:02 EEST 2014
08:56:02
#date
Sat Apr 26 09:56:02 EEST 2014
08:56:02
#date
Sat Apr 26 09:56:03 EEST 2014
08:56:03
#date
Sat Apr 26 09:56:03 EEST 2014
08:56:03
#date
Sat Apr 26 09:56:03 EEST 2014
08:56:03
#date
Sat Apr 26 09:56:03 EEST 2014
08:56:03
#date
Sat Apr 26 09:56:04 EEST 2014
08:56:26
#vi /usr/local/bin/
08:57:21
#~
for N in kiev/{1,2,3}{1,2,3}0{1,2}
FILENAME=/tmp/$RANDOM$RANDOM.call
cat <<EOF > $FILENAME
Channel: SIP/$N
Extension: 8107
Context: internal
EOF
chown asterisk:asterisk $FILENAME
~
~
~
~
~
~
~
"/usr/local/bin/call-all" 19L, 280C written
09:03:37
#crontab -e
# m h  dom mon dow   command
* * * * * /usr/local/bin/call-all
#
                                           [ Wrote 26 lines ]
crontab: installing new crontab
09:03:51
#crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
...
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
* * * * * /usr/local/bin/call-all
#
09:05:13
#crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
...
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
#* * * * * /usr/local/bin/call-all
#
09:05:28
#vi /usr/local/bin/call-all
09:06:27
#crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
...
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
#* * * * * /usr/local/bin/call-all
#
09:06:30
#crontab -e
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
...
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
                                            [ Read 26 lines ]
No modification made
09:06:35
#vi /usr/local/bin/call-all
--- /tmp/l3-saved-13163.23204.26068	2014-04-26 10:15:37.273374301 +0300
+++ /usr/local/bin/call-all	2014-04-26 10:16:24.133375180 +0300
@@ -1,6 +1,7 @@
 #!/bin/bash
 
-for N in kiev/{1,2,3}{1,2,3}0{1,2}
+#for N in kiev/{1,2,3}{1,2,3}0{1,2}
+for N in 2102
 do
 
 N=`echo $N | sed s@kiev/11@11@`
@@ -8,7 +9,7 @@
 
 cat <<EOF > $FILENAME
 Channel: SIP/$N
-Extension: 8107
+Extension: 2101
 Context: internal
 EOF
 
09:16:24
#vi /usr/local/bin/call-all
09:16:40
#ls -al /usr/local/bin/call-all
-rw-r--r-- 1 root staff 295 Apr 26 10:16 /usr/local/bin/call-all
09:17:06
#/usr/local/bin/call-all

09:18:10
#/usr/local/bin/call-all

09:18:15
#/usr/local/bin/call-all

09:18:16
#/usr/local/bin/call-all

09:19:44
#vi /usr/local/bin/call-all
09:19:53
#/usr/local/bin/call-all