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

Содержание

Журнал

Среда (04/10/13)

/dev/pts/0
13:02:23
#screen
/dev/pts/1
13:02:23
#screen
/dev/pts/4
13:02:38
#cd /etc/asterisk/

13:02:53
#nano meetme.conf
13:03:17
#;
;
; Configuration file for MeetMe simple conference rooms for Asterisk of course.
;
; This configuration file is read every time you call app meetme()
                        ; when feeding audio frames from non-DAHDI channels
                        ; into the conference; larger numbers will allow
                        ; for the conference to 'de-jitter' audio that arrives
[general]               ; at different timing than the conference's timing
                        ; source, but can also allow for latency in hearing
;audiobuffers=32        ; the audio from the speaker. Minimum value is 2,
...
; in the conference and it goes away.  When it is created again, it will have
; the new pin number.
;
;conf => 1234
;conf => 2345,9938
                                                                                         44,1          Bot
conf =>
conf =>
conf =>
                                                                                         49,1          Bot
/dev/pts/6
13:04:29
#asterisk -r
Asterisk 1.6.2.9-2+squeeze10, 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.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 5926)
linux5*CLI> meetme
kick    lock    mute    unlock  unmute  list
...
  == Using SIP RTP CoS mark 5
    -- Executing [1234@user_group3:1] Dial("SIP/2101-00000002", "SIP/minsk/1234") in new stack
  == Using SIP RTP CoS mark 5
    -- Called minsk/1234
    -- SIP/minsk-00000003 answered SIP/2101-00000002
    -- Packet2Packet bridging SIP/2101-00000002 and SIP/minsk-00000003
  == Spawn extension (user_group3, 1234, 1) exited non-zero on 'SIP/2101-00000002'
[Apr 10 14:07:50] NOTICE[5948]: chan_sip.c:18485 handle_response_peerpoke: Peer '2110' is now Lagged. (2062ms / 2000ms)
[Apr 10 14:08:14] NOTICE[5948]: chan_sip.c:18485 handle_response_peerpoke: Peer '2110' is now Reachable. (607ms / 2000ms)
linux5*CLI> exit
13:08:31
#asterisk -r
Asterisk 1.6.2.9-2+squeeze10, 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.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 5926)
Verbosity is at least 3
linux5*CLI> module reload app_meetme.so
...
  == Using SIP RTP CoS mark 5
    -- Executing [2102@user_group3:1] Answer("SIP/2101-00000015", "") in new stack
    -- Executing [2102@user_group3:2] Dial("SIP/2101-00000015", "SIP/2102,10,wWtT") in new stack
  == Using SIP RTP CoS mark 5
    -- Called 2102
    -- SIP/2102-00000016 is ringing
    -- SIP/2102-00000016 answered SIP/2101-00000015
    -- Music class default requested but no musiconhold loaded.
  == Spawn extension (user_group3, 2102, 2) exited non-zero on 'SIP/2101-00000015'
linux5*CLI> exit
/dev/pts/4
13:09:17
#~
 same =>      n,Playback(demo-congrats)
exten => _81XX,1,Record(/var/tmp/message/${EXTEN:2}:gsm,1)
exten => _81XX,n,Playback(/var/tmp/message/${EXTEN:2})
exten => _82XX,1,Playback(/var/tmp/message/${EXTEN:2})
exten => _8300,1,Voicemailmain()
[local_monitor]f" 72L, 1588C
exten => _21XX,1,Answer
 same =>       n,Set(CALLFILENAME=${EXTEN}-${CALLERID(num)}-${EPOCH})
 same =>       n,Monitor(wav,${CALLFILENAME},m)
 same =>       n,Dial(SIP/${EXTEN})
...
[       ]
[xten => ]21XX,1,Answer
[        ]
 same =>       n,Dial(SIP/${EXTEN},10,wWtT)
 same =>       n,Voicemail(${EXTEN}@default)
[national]
exten => _22XX,1,Dial(SIP/minsk/${EXTEN})
exten => _23XX,1,Dial(SIP/minsk/${EXTEN})
exten => _23XX,1,Dial(SIP/minsk/${EXTEN})
-- INSERT --                                                                             19,1          Top
прошло 24 минуты
/dev/pts/10
13:33:32
#apt-get install mpg123
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  mysql-common libmysqlclient16
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libmpg123-0
Suggested packages:
  libartsc0 libaudio2
...
Selecting previously deselected package libmpg123-0.
(Reading database ... 128690 files and directories currently installed.)
Unpacking libmpg123-0 (from .../libmpg123-0_1.12.1-3_i386.deb) ...
Selecting previously deselected package mpg123.
Unpacking mpg123 (from .../mpg123_1.12.1-3_i386.deb) ...
Processing triggers for man-db ...
Setting up libmpg123-0 (1.12.1-3) ...
Setting up mpg123 (1.12.1-3) ...
update-alternatives: using /usr/bin/mpg123.bin to provide /usr/bin/mpg123 (mpg123) in auto mode.
update-alternatives: using /usr/bin/mpg123.bin to provide /usr/bin/mp3-decoder (mp3-decoder) in auto mode.
13:33:46
#cd /home/user/

13:34:00
#mpg123 -w moh_music.wav moh_music.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.12.1; written and copyright by Michael Hipp and others
        free software (LGPL/GPL) without any warranty but with best wishes
Playing MPEG stream 1 of 1: moh_music.mp3 ...
Title:   Шалай-валяй (zaycev.net)
Artist:  Чайф
Comment: (zaycev.net)
MPEG 1.0 layer III, VBR, 44100 Hz stereo
[4:00] Decoding of moh_music.mp3 finished.
13:34:31
#sox -t wav moh_music.wav -r 8000 -c1 -t gsm moh_music.gsm resample -ql
sox WARN sox: effect `resample' is deprecated; see sox(1) for an alternative
sox WARN resample: resample clipped 57 samples; decrease volume?
13:35:38
#sox -t wav moh_music.wav -r 8000 -c1 -t gsm moh_music.gsm rate -ql
sox WARN rate: rate clipped 35 samples; decrease volume?
13:36:30
#cp moh_music.gsm /var/lib/asterisk/moh/

13:36:59
#cd /var/lib/asterisk/moh/

13:37:04
#ls -l
total 392
-rw-r--r-- 1 root root 396825 Apr 10 14:36 moh_music.gsm
13:37:06
#cd /etc/asterisk/

13:37:36
#vim musiconhold.conf
13:37:58
#; understand when it loads.
; /var/lib/asterisk.
; NOTE:
; If you are not using "autoload" in modules.conf, then you
; must ensure that the format modules for any formats you wish
; to use are loaded _before_ res_musiconhold. If you do not do
; this, res_musiconhold will skip the files it is not able to
; understand when it loads.
;
[default]
[       ]
directory=moh
;
;[native-random]
;mode=files
;directory=moh
;digit=#        ; If this option is set for a class, then when callers are
mode=files                                                                               52,1          33%
/dev/pts/6
13:39:35
#cd /etc/asterisk/

13:39:41
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
13:39:51
#asterisk -r
Asterisk 1.6.2.9-2+squeeze10, 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.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 6717)
linux5*CLI> moh show
classes  files
...
in    it    jp    lt    mx    my    nl    no    nz    ph    pl    pt    ru    se    sg    th    tw
uk    us    us-o  ve    za    bg
linux5*CLI> module reload indications
[Apr 10 14:50:34] WARNING[6763]: config.c:1163 process_text_line: No '=' (equal sign) in line 736 of /etc/asterisk/indications.conf
[Apr 10 14:50:39] NOTICE[6739]: chan_sip.c:18485 handle_response_peerpoke: Peer '2110' is now Reachable. (693ms / 2000ms)
linux5*CLI> module reload indications
linux5*CLI> dialplan reload
Dialplan reloaded.
[Apr 10 14:51:42] NOTICE[6739]: chan_sip.c:18485 handle_response_peerpoke: Peer '2110' is now Lagged. (2841ms / 2000ms)
linux5*CLI> exit
/dev/pts/10
13:46:03
#vim indications.conf
--- /tmp/l3-saved-6477.1086.3675	2013-04-10 14:48:57.000000000 +0300
+++ indications.conf	2013-04-10 14:49:30.000000000 +0300
@@ -729,3 +729,9 @@
 record = 1400/500,0/10000
 info = 950/330,1400/330,1800/330,0/330
 stutter = !400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,400*33
+
+[starwars](us)
+description = Star Wars Theme Song
+ring = 262/400,392/500,0/100,349/400,330/400,294/400,524/400,392/500,0/100,349/400, \
+       330/400,294/400,524/400,392/500,0/100,349/400,330/400,349/400,294/500,0/2000
+
13:49:32
#description = Star Wars Theme Song
exten => _8300,1,Voicemailmain()
exten => _8301,1,Meetme(1234)
exten => _8302,1,Meetme(1234,m)
exten => _8303,1,Meetme(1234,t)
exten => _8304,1,Meetme(1234,as)
exten => _8305,1,Meetme(1234,s)
exten => _8306,1,Meetme(1234,sq)
exten => _8309,1,Meetme(9999)
[local_monitor]
exten => _21XX,1,Answer
...
exten => _2121,1,Answer
 same =>       n,Dial(SIP/2101&SIP/2102)                                                 2,0-1         Top
[             ]
[             ]
[local]
[     ]
exten => _21XX,1,Answer
 same =>       n,Dial(SIP/${EXTEN},10,wWtT)
 same =>       n,Voicemail(${EXTEN}@default)
                                                                                         39,1           6%
/dev/pts/6
13:51:46
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
13:51:48
#asterisk -r
Asterisk 1.6.2.9-2+squeeze10, 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.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 6894)
linux5*CLI> module reload indications
linux5*CLI> module reload indications
...
linux5*CLI> module reload indications
linux5*CLI> dialplan reload
Dialplan reloaded.
[Apr 10 14:54:58] NOTICE[6916]: chan_sip.c:18485 handle_response_peerpoke: Peer '2110' is now Reachable. (201ms / 2000ms)
[Apr 10 14:56:02] NOTICE[6916]: chan_sip.c:23124 sip_poke_noanswer: Peer '2110' is now UNREACHABLE!  Last qualify: 0
[Apr 10 14:56:43] NOTICE[6916]: chan_sip.c:18485 handle_response_peerpoke: Peer '2110' is now Reachable. (174ms / 2000ms)
linux5*CLI> module reload indications
linux5*CLI> core set verbose 3
Verbosity was 0 and is now 3
linux5*CLI> quit
/dev/pts/10
14:00:30
#vim extensions.conf
--- /tmp/l3-saved-6477.29109.9241	2013-04-10 15:00:32.000000000 +0300
+++ extensions.conf	2013-04-10 15:01:43.000000000 +0300
@@ -35,6 +35,7 @@
  same =>       n,Dial(SIP/2101&SIP/2102) 
 
 exten => _21XX,1,Answer
+ same =>       n,Set(CHANNEL(tonezone)=starwars)
  same =>       n,Dial(SIP/${EXTEN},10,wWtT) 
  same =>       n,Voicemail(${EXTEN}@default)
 
14:01:43
#vim indications.conf
14:01:59
#vim queues.conf
--- /tmp/l3-saved-6477.22967.12696	2013-04-10 15:02:12.000000000 +0300
+++ queues.conf	2013-04-10 15:04:18.000000000 +0300
@@ -498,3 +498,7 @@
 ;member => Agent/:1,1		; Any agent in group 1, wait for first
                                 ; available, but consider with penalty
 
+[queue_main]
+; General queue section
+member => SIP/2101
+member => SIP/2102
14:04:18
#vim extensions.conf
--- /tmp/l3-saved-6477.6749.23014	2013-04-10 15:04:19.000000000 +0300
+++ extensions.conf	2013-04-10 15:05:56.000000000 +0300
@@ -24,6 +24,8 @@
 exten => _8306,1,Meetme(1234,sq)
 exten => _8309,1,Meetme(9999)
 
+exten => 2105,1,Queue(queue_main)
+
 [local_monitor]
 exten => _21XX,1,Answer
  same =>       n,Set(CALLFILENAME=${EXTEN}-${CALLERID(num)}-${EPOCH})
прошло 11 минут
14:16:04
#vim sip.conf
--- /tmp/l3-saved-6477.1094.19528	2013-04-10 15:40:59.000000000 +0300
+++ sip.conf	2013-04-10 15:42:02.000000000 +0300
@@ -48,6 +48,8 @@
 callgroup=2
 pickupgroup=2
 
+qualify=no
+
 [2111]
 context=user_group3
 type=friend
прошло 25 минут
14:42:02
#vim queues.conf
--- /tmp/l3-saved-6477.16888.9089	2013-04-10 15:42:57.000000000 +0300
+++ queues.conf	2013-04-10 15:52:13.000000000 +0300
@@ -500,5 +500,10 @@
 
 [queue_main]
 ; General queue section
-member => SIP/2101
-member => SIP/2102
+;member => SIP/2101
+;member => SIP/2102
+
+member => Agent/1001
+member => Agent/1002
+
+strategy = linear
прошло 10 минут
14:52:13
#vim agents.conf
--- /tmp/l3-saved-6477.9026.25557	2013-04-10 15:52:16.000000000 +0300
+++ agents.conf	2013-04-10 15:54:25.000000000 +0300
@@ -109,5 +109,5 @@
 ;
 ; agent => agentid,agentpassword,name
 ;
-;agent => 1001,4321,Mark Spencer
-;agent => 1002,4321,Will Meadows
+agent => 1001,4321,Mark Spencer
+agent => 1002,4321,Will Meadows
14:54:25