/l3/users/2014-11-nt-voip/nt-voip/debian5/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 |
|
#~
E325: ATTENTION Found a swap file by the name "/etc/asterisk/.extensions.conf.swp" owned by: root dated: Tue Nov 25 15:44:27 2014 file name: /etc/asterisk/extensions.conf modified: YES user name: root host name: debian5 process ID: 18251 (still running) While opening file "/etc/asterisk/extensions.conf" dated: Thu Nov 27 13:28:13 2014 NEWER than swap file! ... file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /etc/asterisk/extensions.conf " to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/asterisk/.extensions.con f .swp" to avoid this message. Swap file "/etc/asterisk/.extensions.conf.swp" already exists! |
#~
E325: ATTENTION Found a swap file by the name "/etc/asterisk/.extensions.conf.swp" owned by: root dated: Tue Nov 25 15:44:27 2014 file name: /etc/asterisk/extensions.conf modified: YES user name: root host name: debian5 process ID: 18251 (still running) While opening file "/etc/asterisk/extensions.conf" dated: Thu Nov 27 13:28:13 2014 NEWER than swap file! ... file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /etc/asterisk/extensions.conf " to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/asterisk/.extensions.con f .swp" to avoid this message. Swap file "/etc/asterisk/.extensions.conf.swp" already exists! |
#rm -f /etc/asterisk/
Display all 100 possibilities? (y or n) adsi.conf console.conf musiconhold.conf agents.conf dbsep.conf muted.conf ais.conf dnsmgr.conf osp.conf alarmreceiver.conf dsp.conf oss.conf alsa.conf dundi.conf phone.conf amd.conf enum.conf phoneprov.conf app_mysql.conf extconfig.conf queuerules.conf asterisk.adsi extensions.ael queues.conf asterisk.conf extensions.conf res_config_mysql.conf ... cel_pgsql.conf jabber.conf sla.conf cel_sqlite3_custom.conf jingle.conf smdi.conf cel_tds.conf logger.conf telcordia-1.adsi chan_dahdi.conf manager.conf udptl.conf chan_mobile.conf manager.d/ unistim.conf chan_ooh323.conf meetme.conf users.conf cli_aliases.conf mgcp.conf voicemail.conf cli.conf minivm.conf vpb.conf cli_permissions.conf misdn.conf codecs.conf modules.conf |
#rm -f /etc/asterisk/
Display all 100 possibilities? (y or n) adsi.conf console.conf musiconhold.conf agents.conf dbsep.conf muted.conf ais.conf dnsmgr.conf osp.conf alarmreceiver.conf dsp.conf oss.conf alsa.conf dundi.conf phone.conf amd.conf enum.conf phoneprov.conf app_mysql.conf extconfig.conf queuerules.conf asterisk.adsi extensions.ael queues.conf asterisk.conf extensions.conf res_config_mysql.conf ... cel_pgsql.conf jabber.conf sla.conf cel_sqlite3_custom.conf jingle.conf smdi.conf cel_tds.conf logger.conf telcordia-1.adsi chan_dahdi.conf manager.conf udptl.conf chan_mobile.conf manager.d/ unistim.conf chan_ooh323.conf meetme.conf users.conf cli_aliases.conf mgcp.conf voicemail.conf cli.conf minivm.conf vpb.conf cli_permissions.conf misdn.conf codecs.conf modules.conf |
#~
25 exten => s,n(start),Background(/var/tmp/asterisk/record02) "/etc/asterisk/extensions.conf" 204L, 6601C 26 exten => s,n,WaitExten(3) 27 exten => s,n,Background(/var/tmp/asterisk/record03) 28 exten => s,n,WaitExten(3) 29 exten => s,n,Background(/var/tmp/asterisk/record04) 30 exten => s,n,Hangup 31 32 exten => 1,1,Goto(submenu,s,1) 33 ... 39 ; проговариваем record07 "ваш заказ №" 40 exten => 3,n,Playback(/var/tmp/asterisk/record07) 41 42 ; проговариваем переменную ORDER 43 exten => 3,n,SayDigits(${ORDER}) 44 45 ; проговариваем record08 "заказ не существует" 46 exten => 3,n,Playback(/var/tmp/asterisk/record08) 47 48 ; если нажали цифру 4 - то переходим на вызов оператора |
#~
19 ; с возможностью выбора (WaitExten) 20 exten => s,1,Answer 21 exten => s,n,Background(/var/tmp/asterisk/record01) 22 exten => s,n,WaitExten(1) 23 24 ; метка (labels), ставятся с помощью скобочек после n 25 exten => s,n(start),Background(/var/tmp/asterisk/record02) "/etc/asterisk/extensions.conf" 204L, 6601C 26 exten => s,n,WaitExten(3) 27 exten => s,n,Background(/var/tmp/asterisk/record03) ... 39 ; проговариваем record07 "ваш заказ №" 40 exten => 3,n,Playback(/var/tmp/asterisk/record07) 41 42 ; проговариваем переменную ORDER 43 exten => 3,n,SayDigits(${ORDER}) 44 45 ; проговариваем record08 "заказ не существует" 46 exten => 3,n,Playback(/var/tmp/asterisk/record08) 47 48 ; если нажали цифру 4 - то переходим на вызов оператора |
# 49 ; попадаем на очередь (Queue), имя очереди queue1
Updated database successfully |
# 49 ; попадаем на очередь (Queue), имя очереди queue1
Updated database successfully |
#asterisk -rvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 3091) ... -- <SIP/2201-000000a0> Playing '/var/tmp/asterisk/record01.gsm' (language 'ru') -- Executing [s@menu:3] WaitExten("SIP/2201-000000a0", "1") in new stack -- Timeout on SIP/2201-000000a0, continuing... -- Executing [s@menu:4] BackGround("SIP/2201-000000a0", "/var/tmp/asterisk/record02") in new stack -- <SIP/2201-000000a0> Playing '/var/tmp/asterisk/record02.gsm' (language 'ru') -- Executing [1@menu:1] Goto("SIP/2201-000000a0", "submenu,s,1") in new stack -- Goto (submenu,s,1) [Nov 27 13:52:09] WARNING[11183]: pbx.c:5367 __ast_pbx_run: Channel 'SIP/2201-000000a0' sent into invalid extension 's' in context 'submenu', but no invalid handler debian5*CLI> exit Executing last minute cleanups |
#asterisk -rvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 3091) ... -- <SIP/2201-000000a0> Playing '/var/tmp/asterisk/record01.gsm' (language 'ru') -- Executing [s@menu:3] WaitExten("SIP/2201-000000a0", "1") in new stack -- Timeout on SIP/2201-000000a0, continuing... -- Executing [s@menu:4] BackGround("SIP/2201-000000a0", "/var/tmp/asterisk/record02") in new stack -- <SIP/2201-000000a0> Playing '/var/tmp/asterisk/record02.gsm' (language 'ru') -- Executing [1@menu:1] Goto("SIP/2201-000000a0", "submenu,s,1") in new stack -- Goto (submenu,s,1) [Nov 27 13:52:09] WARNING[11183]: pbx.c:5367 __ast_pbx_run: Channel 'SIP/2201-000000a0' sent into invalid extension 's' in context 'submenu', but no invalid handler debian5*CLI> exit Executing last minute cleanups |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-25685.5212.28713 2014-11-27 13:54:54.311661027 +0200 +++ /etc/asterisk/extensions.conf 2014-11-27 13:56:50.703662407 +0200 @@ -42,8 +42,11 @@ ; проговариваем переменную ORDER exten => 3,n,SayDigits(${ORDER}) -; проговариваем record08 "заказ не существует" -exten => 3,n,Playback(/var/tmp/asterisk/record08) +; обращение к БД из плана набора: +; ${DB(db_name/key)} +; dn_name = order в нашем случае +; key = в нашем случае введённый номер заказа +exten => 3,n,Playback(/var/tmp/asterisk/record${DB(order/${ORDER})}) ; если нажали цифру 4 - то переходим на вызов оператора ; попадаем на очередь (Queue), имя очереди queue1 |
#play /var/tmp/asterisk/record09.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record09.gsm: File Size: 2.21k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.34 [00:00:00.00] Out:10.7k [======|======] Clip:0 Done. |
#play /var/tmp/asterisk/record09.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record09.gsm: File Size: 2.21k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.34 [00:00:00.00] Out:10.7k [======|======] Clip:0 Done. |
#play /var/tmp/asterisk/record10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record10.gsm: File Size: 1.68k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.02 [00:00:00.00] Out:8.16k [======|======] Clip:0 Done. |
#play /var/tmp/asterisk/record10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record10.gsm: File Size: 1.68k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.02 [00:00:00.00] Out:8.16k [======|======] Clip:0 Done. |
#ls /var/tmp/asterisk/
record00.gsm record03.gsm record06.gsm record09.gsm record12.gsm record01.gsm record04.gsm record07.gsm record10.gsm record02.gsm record05.gsm record08.gsm record11.gsm |
#ls /var/tmp/asterisk/
record00.gsm record03.gsm record06.gsm record09.gsm record12.gsm record01.gsm record04.gsm record07.gsm record10.gsm record02.gsm record05.gsm record08.gsm record11.gsm |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-25685.18526.12947 2014-11-27 14:08:07.931670419 +0200 +++ /etc/asterisk/extensions.conf 2014-11-27 14:17:01.971676744 +0200 @@ -46,7 +46,12 @@ ; ${DB(db_name/key)} ; dn_name = order в наÑем ÑлÑÑае ; key = в наÑем ÑлÑÑае введÑннÑй Ð½Ð¾Ð¼ÐµÑ Ð·Ð°ÐºÐ°Ð·Ð° +; доволÑно Ñ Ð¸ÑÑÐ°Ñ ÐºÐ¾Ð½ÑÑÑÑкÑиÑ: +; $[ a = b ]? label +exten => 3,n,GotoIf($["$[DB(order/${OREDR})]" = ""]?unknown_order) exten => 3,n,Playback(/var/tmp/asterisk/record${DB(order/${ORDER})}) +exten => 3,n,Hangup +exten => 3,n,(unknown_order),Playback(/var/tmp/asterisk/record10) ; еÑли нажали ÑиÑÑÑ 4 - Ñо пеÑÐµÑ Ð¾Ð´Ð¸Ð¼ на вÑзов опеÑаÑоÑа ; попадаем на оÑеÑÐµÐ´Ñ (Queue), Ð¸Ð¼Ñ Ð¾ÑеÑеди queue1 |
#asterisk -rvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 3091) ... [Nov 27 14:19:31] WARNING[11551]: ast_expr2.fl:472 ast_yyerror: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables -- Executing [3@menu:5] GotoIf("SIP/2201-000000af", "0?unknown_order") in new stack -- Executing [3@menu:6] Playback("SIP/2201-000000af", "/var/tmp/asterisk/record9") in new stack [Nov 27 14:19:31] WARNING[11551]: file.c:663 ast_openstream_full: File /var/tmp/asterisk/record9 does not exist in any format [Nov 27 14:19:31] WARNING[11551]: file.c:958 ast_streamfile: Unable to open /var/tmp/asterisk/record9 (format 0x4 (ulaw)): No such file or directory [Nov 27 14:19:31] WARNING[11551]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/2201-000000af for /var/tmp/asterisk/record9 -- Executing [3@menu:7] Hangup("SIP/2201-000000af", "") in new stack == Spawn extension (menu, 3, 7) exited non-zero on 'SIP/2201-000000af' debian5*CLI> exit Executing last minute cleanups |
#asterisk -rvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 3091) ... [Nov 27 14:19:31] WARNING[11551]: ast_expr2.fl:472 ast_yyerror: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables -- Executing [3@menu:5] GotoIf("SIP/2201-000000af", "0?unknown_order") in new stack -- Executing [3@menu:6] Playback("SIP/2201-000000af", "/var/tmp/asterisk/record9") in new stack [Nov 27 14:19:31] WARNING[11551]: file.c:663 ast_openstream_full: File /var/tmp/asterisk/record9 does not exist in any format [Nov 27 14:19:31] WARNING[11551]: file.c:958 ast_streamfile: Unable to open /var/tmp/asterisk/record9 (format 0x4 (ulaw)): No such file or directory [Nov 27 14:19:31] WARNING[11551]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/2201-000000af for /var/tmp/asterisk/record9 -- Executing [3@menu:7] Hangup("SIP/2201-000000af", "") in new stack == Spawn extension (menu, 3, 7) exited non-zero on 'SIP/2201-000000af' debian5*CLI> exit Executing last minute cleanups |
#exit
1 ; контекст плана звонков default 2 [default] 3 4 ; Dial приложение (позвонить) 5 ; SIP/ название канала, куда его нужно перенаправить 6 ; $ - значение переменной {EXTEN} 7 8 9 ; создаем меню для колл-центра 10 [menu] ... 41 42 ; проговариваем переменную ORDER 43 exten => 3,n,SayDigits(${ORDER}) 44 45 ; обращение к БД из плана набора: 46 ; ${DB(db_name/key)} 47 ; dn_name = order в нашем случае 48 ; key = в нашем случае введённый номер заказа 49 ; довольно хитрая конструкция: :q! |
#exit
1 ; контекст плана звонков default 2 [default] 3 4 ; Dial приложение (позвонить) 5 ; SIP/ название канала, куда его нужно перенаправить 6 ; $ - значение переменной {EXTEN} 7 8 9 ; создаем меню для колл-центра 10 [menu] ... 41 42 ; проговариваем переменную ORDER 43 exten => 3,n,SayDigits(${ORDER}) 44 45 ; обращение к БД из плана набора: 46 ; ${DB(db_name/key)} 47 ; dn_name = order в нашем случае 48 ; key = в нашем случае введённый номер заказа 49 ; довольно хитрая конструкция: :q! |
#ls /var/tmp/asterisk/
record00.gsm record02.gsm record04.gsm record06.gsm record08.gsm record10.gsm record12.gsm record01.gsm record03.gsm record05.gsm record07.gsm record09.gsm record11.gsm |
#ls /var/tmp/asterisk/
record00.gsm record02.gsm record04.gsm record06.gsm record08.gsm record10.gsm record12.gsm record01.gsm record03.gsm record05.gsm record07.gsm record09.gsm record11.gsm |
#play /var/tmp/asterisk/record02.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record02.gsm: File Size: 25.3k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:11.26 [00:00:00.00] Out:90.1k [ =|= ] Clip:0 Aborted. |
#play /var/tmp/asterisk/record02.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record02.gsm: File Size: 25.3k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:11.26 [00:00:00.00] Out:90.1k [ =|= ] Clip:0 Aborted. |
#play /var/tmp/asterisk/record02.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record02.gsm: File Size: 25.3k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:15.36 [00:00:00.00] Out:123k [ | ] Clip:0 Aborted. |
#play /var/tmp/asterisk/record02.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record02.gsm: File Size: 25.3k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:15.36 [00:00:00.00] Out:123k [ | ] Clip:0 Aborted. |
#play /var/tmp/asterisk/record03.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record03.gsm: File Size: 3.96k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:02.40 [00:00:00.00] Out:19.2k [ -====|====- ] Clip:0 Done. |
#play /var/tmp/asterisk/record03.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record03.gsm: File Size: 3.96k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:02.40 [00:00:00.00] Out:19.2k [ -====|====- ] Clip:0 Done. |
#play /var/tmp/asterisk/record11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record11.gsm: File Size: 7.95k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:04.82 [00:00:00.00] Out:38.6k [ | ] Hd:4.2 Clip:0 Done. |
#play /var/tmp/asterisk/record11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record11.gsm: File Size: 7.95k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:04.82 [00:00:00.00] Out:38.6k [ | ] Hd:4.2 Clip:0 Done. |
#play /var/tmp/asterisk/record11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record11.gsm: File Size: 9.37k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:05.68 [00:00:00.00] Out:45.4k [ | ] Clip:0 Done. |
#play /var/tmp/asterisk/record11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record11.gsm: File Size: 9.37k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:05.68 [00:00:00.00] Out:45.4k [ | ] Clip:0 Done. |
#vim /etc/asterisk/extensions.conf
|
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-25685.7305.5633 2014-11-27 14:43:36.575695617 +0200 +++ /etc/asterisk/extensions.conf 2014-11-27 14:46:56.475697982 +0200 @@ -29,6 +29,7 @@ exten => s,n,Background(/var/tmp/asterisk/record04) exten => s,n,Hangup +; переходим на submenu exten => 1,1,Goto(submenu,s,1) ; при нажатии 3 - проигрываем exten => 3 (record05) "введите номер заказа" @@ -75,13 +76,12 @@ [submenu] - exten => s,1,Background(/var/tmp/asterisk/record11) exten => s,n,WaitExten(6) exten => s,n,Background(/var/tmp/asterisk/record03) exten => s,n,WaitExten(6) exten => s,n,Background(/var/tmp/asterisk/record04) -exten => s,n,Hangup +exten => s,n,Goto(menu,s,start) ; при нажатии 1 - проигрываем exten => 1 ; при нажатии 2 - проигрываем exten => 2 exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt) |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-25685.18352.17764 2014-11-27 14:47:28.527698361 +0200 +++ /etc/asterisk/extensions.conf 2014-11-27 14:48:56.503699403 +0200 @@ -56,7 +56,8 @@ ; если нажали цифру 4 - то переходим на вызов оператора ; попадаем на очередь (Queue), имя очереди queue1 -exten => 4,1,Queue(queue1) +exten => 4,1,Answer +exten => 4,n,Queue(queue1) ; при нажатии на 0 на телефоне перейти на (Goto) ; Goto поддерживает три варианта описания координат: @@ -81,7 +82,8 @@ exten => s,n,Background(/var/tmp/asterisk/record03) exten => s,n,WaitExten(6) exten => s,n,Background(/var/tmp/asterisk/record04) -exten => s,n,Goto(menu,s,start) +exten => s,n,Hangup +;exten => s,n,Goto(menu,s,start) ; при нажатии 1 - проигрываем exten => 1 ; при нажатии 2 - проигрываем exten => 2 exten => 1,1,AGI(/usr/local/bin/asterisk-festival.pl,/var/tmp/belki.txt) |
#vim /etc/asterisk/queues.conf
--- /tmp/l3-saved-25685.26658.26272 2014-11-27 14:50:41.087700641 +0200 +++ /etc/asterisk/queues.conf 2014-11-27 14:54:04.727703052 +0200 @@ -535,3 +535,14 @@ ;member => Agent/:1,1 ; Any agent in group 1, wait for first ; available, but consider with penalty + +; наÑа Ð¶Ð¸Ð²Ð°Ñ Ð¾ÑеÑедÑ, коÑоÑÑÑ Ð¼Ñ Ð¿ÑопиÑали в extensions.conf +[queue1] + +member => SIP/2201 + + + + + + |
#asterisk 'queue reload'
Privilege escalation protection disabled! See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details. Asterisk already running on /var/run/asterisk/asterisk.ctl. Use 'asterisk -r' to connect. |
#asterisk 'queue reload'
Privilege escalation protection disabled! See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details. Asterisk already running on /var/run/asterisk/asterisk.ctl. Use 'asterisk -r' to connect. |
#asterisk -rx 'queue reload'
No such command 'queue reload' (type 'core show help queue reload' for other possible commands) |
#asterisk -rx 'queue reload'
No such command 'queue reload' (type 'core show help queue reload' for other possible commands) |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 3091) Verbosity is at least 3 debian5*CLI> queue re reload remove reset debian5*CLI> queue reload No such command 'queue reload ' (type 'core show help queue reload' for other possible commands) debian5*CLI> queue reload all [Nov 27 14:55:12] NOTICE[12239]: app_queue.c:6476 reload_queue_rules: queuerules.conf has not changed since it was last loaded. Not taking any action. == Parsing '/etc/asterisk/queues.conf': == Found debian5*CLI> exit |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 3091) Verbosity is at least 3 debian5*CLI> queue re reload remove reset debian5*CLI> queue reload No such command 'queue reload ' (type 'core show help queue reload' for other possible commands) debian5*CLI> queue reload all [Nov 27 14:55:12] NOTICE[12239]: app_queue.c:6476 reload_queue_rules: queuerules.conf has not changed since it was last loaded. Not taking any action. == Parsing '/etc/asterisk/queues.conf': == Found debian5*CLI> exit |
#мÑvim /etc/asterisk/agents.conf
84 ; The format to be used to record the calls: wav, gsm, wav49. 86 ;recordformat=gsm 87 ; 88 ; The text to be added to the name of the recording. All lows forming a url link. 89 ;urlprefix=http://localhost/calls/ 90 ; 91 ; The optional directory to save the conversations in. The default is ... orm: 101 ; 102 ; agent => agentid,agentpassword,name 103 ; 104 ;agent => 1001,4321,Mark Spencer 105 ;agent => 1002,4321,Will Meadows ~ 105,32 Bot 107 agent => 007,1234,James Bond 107,28 Bot <terisk/agents.conf" 107L, 2790C written |
#мÑvim /etc/asterisk/agents.conf
1 ; 2 ; Agent configuration "/etc/asterisk/agents.conf" 105L, 2760C 84 ; The format to be used to record the calls: wav, gsm, wav49. 86 ;recordformat=gsm 87 ; 88 ; The text to be added to the name of the recording. All lows forming a url link. 89 ;urlprefix=http://localhost/calls/ ... 103 ; 104 ;agent => 1001,4321,Mark Spencer 105 ;agent => 1002,4321,Will Meadows ~ 105,32 Bot 107 agent => 007,1234,James Bond 107,28 Bot <terisk/agents.conf" 107L, 2790C written 39 ;acceptdtmf=# 40 ; 41 ; Define endcall to allow an agent to hangup a call witt |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#asterisk -rvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 12382) Verbosity is at least 2 == Using SIP RTP CoS mark 5 [Nov 27 15:12:43] NOTICE[12421]: chan_sip.c:22753 handle_request_invite: Call from '2201' (192.168.50.100:5060) to extension '8407' rejected because extension not found in context 'gr1'. debian5*CLI> exit Executing last minute cleanups |
#asterisk -rvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 12382) Verbosity is at least 2 == Using SIP RTP CoS mark 5 [Nov 27 15:12:43] NOTICE[12421]: chan_sip.c:22753 handle_request_invite: Call from '2201' (192.168.50.100:5060) to extension '8407' rejected because extension not found in context 'gr1'. debian5*CLI> exit Executing last minute cleanups |
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-25685.2252.21348 2014-11-27 15:17:52.203719946 +0200 +++ /etc/asterisk/extensions.conf 2014-11-27 15:18:05.803720108 +0200 @@ -143,8 +143,6 @@ exten => 8405,1,Goto(menu,s,1) -; использование агента -exten => 8407,1,AgentLogin(007) [local] |
#ls /var/tmp/asterisk/
record00.gsm record03.gsm record06.gsm record10.gsm record9.gsm record01.gsm record04.gsm record07.gsm record11.gsm record02.gsm record05.gsm record08.gsm record12.gsm |
#ls /var/tmp/asterisk/
record00.gsm record03.gsm record06.gsm record10.gsm record9.gsm record01.gsm record04.gsm record07.gsm record11.gsm record02.gsm record05.gsm record08.gsm record12.gsm |
#ls /var/tmp/asterisk/
play .aptitude/ .lilalo/ asterisk-core-sounds-ru-gsm-current .profile .asterisk_history .pulse-cookie .bash_history .rnd .bash_profile sent .bashrc .ssh/ .gconf/ .viminfo .l3rc .vimrc |
#ls /var/tmp/asterisk/
play .aptitude/ .lilalo/ asterisk-core-sounds-ru-gsm-current .profile .asterisk_history .pulse-cookie .bash_history .rnd .bash_profile sent .bashrc .ssh/ .gconf/ .viminfo .l3rc .vimrc |
#ls /var/tmp/asterisk/
play /var/tmp/asterisk/record9.gsm play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record9.gsm: File Size: 2.21k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.34 [00:00:00.00] Out:10.7k [======|======] Clip:0 Done. |
#ls /var/tmp/asterisk/
play /var/tmp/asterisk/record9.gsm play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record9.gsm: File Size: 2.21k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.34 [00:00:00.00] Out:10.7k [======|======] Clip:0 Done. |
#play /var/tmp/asterisk/recor1.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/recor1.gsm': No such file or directory |
#play /var/tmp/asterisk/recor1.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/recor1.gsm': No such file or directory |
#play /var/tmp/asterisk/recor11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/recor11.gsm': No such file or directory |
#play /var/tmp/asterisk/recor11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/recor11.gsm': No such file or directory |
#play /var/tmp/asterisk/recor10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/recor10.gsm': No such file or directory |
#play /var/tmp/asterisk/recor10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/recor10.gsm': No such file or directory |
#play /var/tmp/asterisk/record08.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record08.gsm: File Size: 1.91k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.16 [00:00:00.00] Out:9.28k [ -==|==- ] Clip:0 Done. |
#play /var/tmp/asterisk/record08.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record08.gsm: File Size: 1.91k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.16 [00:00:00.00] Out:9.28k [ -==|==- ] Clip:0 Done. |
#play /var/tmp/asterisk/record07.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record07.gsm: File Size: 1.88k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.14 [00:00:00.00] Out:9.12k [ =====|===== ] Clip:0 Done. |
#play /var/tmp/asterisk/record07.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record07.gsm: File Size: 1.88k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.14 [00:00:00.00] Out:9.12k [ =====|===== ] Clip:0 Done. |
#play /var/tmp/asterisk/record09.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/record09.gsm': No such file or directory |
#play /var/tmp/asterisk/record09.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable play FAIL formats: can't open input file `/var/tmp/asterisk/record09.gsm': No such file or directory |
#play /var/tmp/asterisk/record10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record10.gsm: File Size: 1.68k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.02 [00:00:00.00] Out:8.16k [======|======] Clip:0 Done. |
#play /var/tmp/asterisk/record10.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record10.gsm: File Size: 1.68k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:01.02 [00:00:00.00] Out:8.16k [======|======] Clip:0 Done. |
#play /var/tmp/asterisk/record11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record11.gsm: File Size: 9.37k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:05.68 [00:00:00.00] Out:45.4k [ | ] Clip:0 Done. |
#play /var/tmp/asterisk/record11.gsm
play WARN alsa: can't encode 0-bit Unknown or not applicable /var/tmp/asterisk/record11.gsm: File Size: 9.37k Encoding: GSM Channels: 1 @ 16-bit Samplerate: 8000Hz Replaygain: off Duration: unknown In:0.00% 00:00:05.68 [00:00:00.00] Out:45.4k [ | ] Clip:0 Done. |
#ls /var/tmp/asterisk/
36 ; читаем нажатие кнопок на телефоне и пишем их в переменную ORDER 37 exten => 3,1,Playback(/var/tmp/asterisk/record05) 38 exten => 3,n,Read(ORDER) 39 ; переходим на submenu 40 ; проговариваем record07 "ваш заказ №" 41 exten => 3,n,Playback(/var/tmp/asterisk/record07) 42 ; при нажатии 3 - проигрываем exten => 3 (record05) "введите номер заказа 43 ; проговариваем переменную ORDER 44 exten => 3,n,SayDigits(${ORDER}) 45 ... 62 ; при нажатии на 0 на телефоне перейти на (Goto) 63 ; Goto поддерживает три варианта описания координат: 64 ; context,extension,label 65 ; extension,label 66 ; label 67 exten => 0,1,Goto(s,start) 68 69 ; неверный выбор 70 ; i - invalid (extension) 70,1 12% |
#ls /var/tmp/asterisk/
18 ; проигрываем приветствие и пункты меню (Background) 19 ; с возможностью выбора (WaitExten) 20 exten => s,1,Answer 21 [menu]=> s,n,Background(/var/tmp/asterisk/record01) 22 exten => s,n,WaitExten(1) 23 24 ; метка (labels), ставятся с помощью скобочек после n 25 exten => s,n(start),Background(/var/tmp/asterisk/record02) "/etc/asterisk/extensions.conf" 225L, 7399C 26 exten => s,n,WaitExten(3) ... 62 ; при нажатии на 0 на телефоне перейти на (Goto) 63 ; Goto поддерживает три варианта описания координат: 64 ; context,extension,label 65 ; extension,label 66 ; label 67 exten => 0,1,Goto(s,start) 68 69 ; неверный выбор 70 ; i - invalid (extension) 70,1 12% |
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian5 (pid = 12641) ... 9" = "" ^ [Nov 27 15:58:43] WARNING[13079]: ast_expr2.fl:472 ast_yyerror: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables -- Executing [3@menu:5] GotoIf("SIP/2201-0000000b", ""9?unknown_order") in new stack -- Goto (menu,3,8) -- Executing [3@menu:8] Playback("SIP/2201-0000000b", "/var/tmp/asterisk/record08") in new stack -- <SIP/2201-0000000b> Playing '/var/tmp/asterisk/record08.gsm' (language 'ru') -- Auto fallthrough, channel 'SIP/2201-0000000b' status is 'UNKNOWN' debian5*CLI> exit Executing last minute cleanups |
Время первой команды журнала | 12:29:35 2014-11-27 | |||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:58:10 2014-11-27 | |||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 29.70 | |||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | |||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.91 | |||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.88 | |||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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