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

Содержание

Журнал

Четверг (11/27/14)

/dev/pts/3
15:26:10
#свcd /usr/local/bin/

15:27:48
#more call-all
15:27:53
#vim call-all
15:29:31
#exit 0
#!/bin/bash
# наша задача перебрать разные каналы
#и отправить на каждый из них звонок
# сейчас покажу что обозначает констуркция с фигурными скобками
for CHANNEL in 1201 1202 kiev/{1{1,3},2{1,2,3},3{1,2}}0{1,2}
do
# каналы перебираются правильно
# теперь генерируем звонок
# имя файла звонка не должно повторяться
# иначе мы перезапишем сами себя
...
# <<EOF означает что копировать всё до EOF в поток вывода
cat <<EOF > $FILE
Context: internal
Extension: 8405
Channel: SIP/${CHANNEL}
EOF
chown asterisk:asterisk $FILE
mv $FILE /var/spool/asterisk/outgoing/
done
exit 0
15:29:32
#vim call-all
--- /tmp/l3-saved-3572.9919.32267	2014-11-27 16:29:35.750604153 +0200
+++ call-all	2014-11-27 16:30:10.498604129 +0200
@@ -4,7 +4,7 @@
 #и отправить на каждый из них звонок
 
 # сейчас покажу что обозначает констуркция с фигурными скобками
-for CHANNEL in 1201 1202 kiev/{1{1,3},2{1,2,3},3{1,2}}0{1,2}
+for CHANNEL in 2301 2302 minsk/{1{1,2,3},2{1,2},3{1,2}}0{1,2}
 do
 
 # каналы перебираются правильно
15:30:10
#bash call-all

15:30:17
#^C

15:30:19
#дмdmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.2.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.63-2+deb7u1
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64 root=UUID=c7e7a580-3a72-4861-87d5-2cae1b74997b ro quiet
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009d800 (usable)
[    0.000000]  BIOS-e820: 000000000009d800 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 0000000020000000 (usable)
[    0.000000]  BIOS-e820: 0000000020000000 - 0000000020200000 (reserved)
...
[92074.104015] usbserial: USB Serial Driver core
[92074.142523] USB Serial support registered for GSM modem (1-port)
[92074.142584] option 4-1.8:1.0: GSM modem (1-port) converter detected
[92074.142705] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB0
[92074.142714] option 4-1.8:1.1: GSM modem (1-port) converter detected
[92074.142845] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB1
[92074.142865] option 4-1.8:1.2: GSM modem (1-port) converter detected
[92074.143013] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB2
[92074.143027] usbcore: registered new interface driver option
[92074.143029] option: v0.7.2:USB Driver for GSM modems
прошло 11 минут
15:41:40
#lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 046d:c077 Logitech, Inc.
Bus 001 Device 004: ID 03f0:0024 Hewlett-Packard KU-0316 Keyboard
Bus 004 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
15:41:53
#lsusb | grep hua

15:42:06
#lsusb | grep Hua
Bus 004 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
15:42:08
#tail -30 /var/log/messages
Nov 27 16:37:12 debian6 dhcpd: DHCPACK on 192.168.60.100 to 00:19:e7:14:25:e6 (SEP0019E71425E6) via eth0
Nov 27 16:37:57 debian6 dhcpd: DHCPREQUEST for 192.168.60.102 from 9c:eb:e8:07:70:39 (fallout4) via eth0
Nov 27 16:37:57 debian6 dhcpd: DHCPACK on 192.168.60.102 to 9c:eb:e8:07:70:39 (fallout4) via eth0
Nov 27 16:41:36 debian6 kernel: [92073.860199] usb 4-1.8: new high-speed USB device number 3 using ehci_hcd
Nov 27 16:41:36 debian6 kernel: [92073.963455] usb 4-1.8: New USB device found, idVendor=12d1, idProduct=1001
Nov 27 16:41:36 debian6 kernel: [92073.963460] usb 4-1.8: New USB device strings: Mfr=2, Product=1, SerialNumber=0
Nov 27 16:41:36 debian6 kernel: [92073.963462] usb 4-1.8: Product: HUAWEI Mobile
Nov 27 16:41:36 debian6 kernel: [92073.963465] usb 4-1.8: Manufacturer: HUAWEI Technology
Nov 27 16:41:36 debian6 mtp-probe: checking bus 4, device 3: "/sys/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.8"
Nov 27 16:41:36 debian6 mtp-probe: bus: 4, device: 3 was not an MTP device
...
Nov 27 16:41:36 debian6 kernel: [92074.142714] option 4-1.8:1.1: GSM modem (1-port) converter detected
Nov 27 16:41:36 debian6 kernel: [92074.142845] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB1
Nov 27 16:41:36 debian6 kernel: [92074.142865] option 4-1.8:1.2: GSM modem (1-port) converter detected
Nov 27 16:41:36 debian6 kernel: [92074.143013] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB2
Nov 27 16:41:36 debian6 kernel: [92074.143027] usbcore: registered new interface driver option
Nov 27 16:41:36 debian6 kernel: [92074.143029] option: v0.7.2:USB Driver for GSM modems
Nov 27 16:42:12 debian6 dhcpd: DHCPREQUEST for 192.168.60.102 from 9c:eb:e8:07:70:39 (fallout4) via eth0
Nov 27 16:42:12 debian6 dhcpd: DHCPACK on 192.168.60.102 to 9c:eb:e8:07:70:39 (fallout4) via eth0
Nov 27 16:42:12 debian6 dhcpd: DHCPREQUEST for 192.168.60.100 from 00:19:e7:14:25:e6 (SEP0019E71425E6) via eth0
Nov 27 16:42:12 debian6 dhcpd: DHCPACK on 192.168.60.100 to 00:19:e7:14:25:e6 (SEP0019E71425E6) via eth0
15:42:26
#tail -30 /var/log/messages | grep ttyUS
Nov 27 16:41:36 debian6 kernel: [92074.142705] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB0
Nov 27 16:41:36 debian6 kernel: [92074.142845] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB1
Nov 27 16:41:36 debian6 kernel: [92074.143013] usb 4-1.8: GSM modem (1-port) converter now attached to ttyUSB2
15:42:38
#lsmod | head -2
Module                  Size  Used by
option                 37168  0
15:42:52
#lsmod | head -5
Module                  Size  Used by
option                 37168  0
usb_wwan               17320  1 option
usbserial              32061  2 usb_wwan,option
usb_storage            43870  0
15:42:58
#modinfo us-wwan
ERROR: Module us-wwan not found.
15:43:12
#modinfo usb-wwan
filename:       /lib/modules/3.2.0-4-amd64/kernel/drivers/usb/serial/usb_wwan.ko
license:        GPL
version:        v0.7.2
description:    USB Driver for GSM modems
author:         Matthias Urlichs <smurf@smurf.noris.de>
srcversion:     EF601762583FF1C87ACB46D
depends:        usbcore,usbserial
intree:         Y
vermagic:       3.2.0-4-amd64 SMP mod_unload modversions
parm:           debug:Debug messages (bool)
15:43:17
#ls -l /dev/ttyUSB*
crw-rw---T 1 root dialout 188, 0 Nov 27 16:41 /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 1 Nov 27 16:41 /dev/ttyUSB1
crw-rw---T 1 root dialout 188, 2 Nov 27 16:41 /dev/ttyUSB2
15:43:33
#http://chan-datacard.googlecode.com/svn/trunk/
bash: http://chan-datacard.googlecode.com/svn/trunk/: No such file or directory
15:48:36
#cd chan-datacard/

15:48:39
#ls
__app.c            __at_response.c  __channel.c    COPYRIGHT.txt  Makefile.in     __ringbuffer.h
__at_fifo_queue.c  __at_send.c      __char_conv.c  etc            __manager.c
__at_parse.c       chan_datacard.c  __cli.c        __helpers.c    README.txt
__at_read.c        chan_datacard.h  configure      LICENSE.txt    __ringbuffer.c
15:48:40
#apt-get install asterisk-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgadu3 libmozjs24d xulrunner-24.0
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  asterisk-dev
0 upgraded, 1 newly installed, 0 to remove and 16 not upgraded.
Need to get 959 kB of archives.
After this operation, 2,131 kB of additional disk space will be used.
Get:1 http://192.168.12.254/debian/ wheezy/main asterisk-dev all 1:1.8.13.1~dfsg1-3+deb7u3 [959 kB]
Fetched 959 kB in 0s (29.4 MB/s)
Selecting previously unselected package asterisk-dev.
(Reading database ... 147218 files and directories currently installed.)
Unpacking asterisk-dev (from .../asterisk-dev_1%3a1.8.13.1~dfsg1-3+deb7u3_all.deb) ...
Setting up asterisk-dev (1:1.8.13.1~dfsg1-3+deb7u3) ...
15:48:58
#./configure
configure complete, now type 'make'
15:49:16
#make
gcc -Wall -Wextra -fPIC -DAST_MODULE=\"chan_datacard\" -D_THREAD_SAFE -I. -I/usr/include -O2 -DICONV_CONST="" -D__DEBUG__ -D__APP__ -c chan_datacard.c
In file included from chan_datacard.c:69:0:
chan_datacard.h:257:2: warning: initialization from incompatible pointer type [enabled by default]
chan_datacard.h:257:2: warning: (near initialization for ‘channel_tech.requester’) [enabled by default]
In file included from chan_datacard.c:85:0:
__channel.c: In function ‘channel_new’:
__channel.c:18:2: warning: implicit declaration of function ‘ast_channel_linkedid’ [-Wimplicit-function-declaration]
__channel.c:18:9: warning: pointer/integer type mismatch in conditional expression [enabled by default]
__channel.c:22:3: warning: implicit declaration of function ‘ast_channel_tech_pvt_set’ [-Wimplicit-function-declaration]
__channel.c:23:3: warning: implicit declaration of function ‘ast_channel_tech_set’ [-Wimplicit-function-declaration]
...
__channel.c: In function ‘channel_indicate’:
__channel.c:792:15: warning: initialization makes pointer from integer without a cast [enabled by default]
__channel.c: In function ‘channel_queue_hangup’:
__channel.c:879:6: warning: implicit declaration of function ‘ast_channel_hangupcause_set’ [-Wimplicit-function-declaration]
chan_datacard.c: In function ‘unload_module’:
chan_datacard.c:621:2: warning: implicit declaration of function ‘ast_format_cap_destroy’ [-Wimplicit-function-declaration]
chan_datacard.c: In function ‘load_module’:
chan_datacard.c:685:9: warning: implicit declaration of function ‘ast_format_cap_alloc’ [-Wimplicit-function-declaration]
chan_datacard.c:690:27: warning: assignment makes pointer from integer without a cast [enabled by default]
make: *** [chan_datacard.o] Error 1
15:49:29
#apt-cache search dongle
libgnuradio-fcd3.5.3.2 - gnuradio FunCube Dongle support
libpam-blue - PAM module for local authenticaction with bluetooth devices
openocd - Open on-chip JTAG debug solution for ARM and MIPS systems
qthid-fcd-controller - Funcube Dongle controller
usb-modeswitch - mode switching tool for controlling "flip flop" USB devices
usb-modeswitch-data - mode switching data for usb-modeswitch
15:50:18
#svn co http://chan-d^Cooglecode.com/svn/trunk/ chan-datacard

15:51:55
#cd ..

15:52:20
#apt-get install autoconf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgadu3 libmozjs24d xulrunner-24.0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  automake autotools-dev
Suggested packages:
  autoconf2.13 autoconf-archive gnu-standards autoconf-doc libtool
...
Selecting previously unselected package autotools-dev.
Unpacking autotools-dev (from .../autotools-dev_20120608.1_all.deb) ...
Selecting previously unselected package automake.
Unpacking automake (from .../automake_1%3a1.11.6-1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Setting up autoconf (2.69-1) ...
Setting up autotools-dev (20120608.1) ...
Setting up automake (1:1.11.6-1) ...
update-alternatives: using /usr/bin/automake-1.11 to provide /usr/bin/automake (automake) in auto mode
15:53:44
#svn co http://chan-dongle.googlecode.com/svn/trunk/
svn: 'http://chan-dongle.googlecode.com/svn/trunk' path not found
15:53:56
#svn co http://dongle.googlecode.com/svn/trunk/
^Csvn: Caught signal
15:54:34
#cd chan-dongle/

15:54:42
#./configure
bash: ./configure: No such file or directory
15:54:50
#configure
bash: configure: command not found
15:54:53
#./configure
bash: ./configure: No such file or directory
15:55:04
#ls
Build.lua  DongleCore  DongleHelloWorld  DongleStub  lunit  OptionHouse
15:55:07
#autonmake -a
bash: autonmake: command not found
15:55:22
#automake -a
automake: `configure.ac' or `configure.in' is required
15:55:26
#aclocal
aclocal: `configure.ac' or `configure.in' is required
15:55:35
#autoconf
autoconf: error: no input file
15:55:41
#automake
automake: `configure.ac' or `configure.in' is required
15:55:50
#automake -a
automake: `configure.ac' or `configure.in' is required
15:55:52
#./configure
bash: ./configure: No such file or directory
15:55:56
#cd ..

15:56:05
#svn co http://asterisk-chan-dongle.googlecode.com/svn/trunk/ chan-dongle
svn: 'chan-dongle' is already a working copy for a different URL
15:56:27
#svn co http://asterisk-chan-dongle.googlecode.com/svn/trunk/ chan-dongle2
A    chan-dongle2/at_read.c
A    chan-dongle2/Makefile.in
A    chan-dongle2/chan_dongle.c
A    chan-dongle2/TODO.txt
A    chan-dongle2/at_read.h
A    chan-dongle2/chan_dongle.h
A    chan-dongle2/cli.c
A    chan-dongle2/channel.c
A    chan-dongle2/manager.c
A    chan-dongle2/dc_config.c
...
A    chan-dongle2/contrib/openwrt/asterisk18-chan-dongle/Makefile
A    chan-dongle2/LICENSE.txt
A    chan-dongle2/cpvt.h
A    chan-dongle2/single.c
A    chan-dongle2/memmem.h
A    chan-dongle2/README.txt
A    chan-dongle2/etc
A    chan-dongle2/etc/extensions.conf
A    chan-dongle2/etc/dongle.conf
Checked out revision 42.
15:57:02
#ls
app.c         at_read.c      channel.h     COPYRIGHT.txt  helpers.h    mixbuffer.c   ringbuffer.c
app.h         at_read.h      char_conv.c   cpvt.c         INSTALL      mixbuffer.h   ringbuffer.h
at_command.c  at_response.c  char_conv.h   cpvt.h         LICENSE.txt  mutils.h      single.c
at_command.h  at_response.h  cli.c         dc_config.c    Makefile.in  pdiscovery.c  stamp-h.in
at_parse.c    BUGS           cli.h         dc_config.h    manager.c    pdiscovery.h  test
at_parse.h    chan_dongle.c  config.h.in   etc            manager.h    pdu.c         TODO.txt
at_queue.c    chan_dongle.h  configure.in  export.h       memmem.c     pdu.h         tools
at_queue.h    channel.c      contrib       helpers.c      memmem.h     README.txt
15:57:04
#aclocal

15:57:10
#autoconf

15:57:17
#automake
configure.in:6: required file `./config.guess' not found
configure.in:6:   `automake --add-missing' can install `config.guess'
configure.in:6: required file `./config.sub' not found
configure.in:6:   `automake --add-missing' can install `config.sub'
configure.in:7: required file `./install-sh' not found
configure.in:7:   `automake --add-missing' can install `install-sh'
configure.in:7: required file `./missing' not found
configure.in:7:   `automake --add-missing' can install `missing'
automake: no `Makefile.am' found for any configure output
15:57:21
#automake -a
configure.in:6: installing `./config.guess'
configure.in:6: installing `./config.sub'
configure.in:7: installing `./install-sh'
configure.in:7: installing `./missing'
automake: no `Makefile.am' found for any configure output
15:57:24
#automake
automake: no `Makefile.am' found for any configure output
15:57:29
#automake -a
automake: no `Makefile.am' found for any configure output
15:57:32
#./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
...
checking for memmem... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strncasecmp... yes
checking for strtol... yes
checking for realpath... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
15:57:39
#make -j
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT app.o -MF .app.o.d -MP  -o app.o -c app.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_command.o -MF .at_command.o.d -MP  -o at_command.o -c at_command.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_parse.o -MF .at_parse.o.d -MP  -o at_parse.o -c at_parse.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_queue.o -MF .at_queue.o.d -MP  -o at_queue.o -c at_queue.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_read.o -MF .at_read.o.d -MP  -o at_read.o -c at_read.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_response.o -MF .at_response.o.d -MP  -o at_response.o -c at_response.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT chan_dongle.o -MF .chan_dongle.o.d -MP  -o chan_dongle.o -c chan_dongle.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT channel.o -MF .channel.o.d -MP  -o channel.o -c channel.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT char_conv.o -MF .char_conv.o.d -MP  -o char_conv.o -c char_conv.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT cli.o -MF .cli.o.d -MP  -o cli.o -c cli.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT helpers.o -MF .helpers.o.d -MP  -o helpers.o -c helpers.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT manager.o -MF .manager.o.d -MP  -o manager.o -c manager.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT memmem.o -MF .memmem.o.d -MP  -o memmem.o -c memmem.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT ringbuffer.o -MF .ringbuffer.o.d -MP  -o ringbuffer.o -c ringbuffer.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT cpvt.o -MF .cpvt.o.d -MP  -o cpvt.o -c cpvt.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT dc_config.o -MF .dc_config.o.d -MP  -o dc_config.o -c dc_config.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT pdu.o -MF .pdu.o.d -MP  -o pdu.o -c pdu.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT mixbuffer.o -MF .mixbuffer.o.d -MP  -o mixbuffer.o -c mixbuffer.c
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT pdiscovery.o -MF .pdiscovery.o.d -MP  -o pdiscovery.o -c pdiscovery.c
gcc  -shared -Xlinker -x -o chan_dongle.so app.o at_command.o at_parse.o at_queue.o at_read.o at_response.o chan_dongle.o channel.o char_conv.o cli.o helpers.o manager.o memmem.o ringbuffer.o cpvt.o dc_config.o pdu.o mixbuffer.o pdiscovery.o
15:57:48
#make install
./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
strip chan_dongle.so
/usr/bin/install -c -m 755 chan_dongle.so /usr/lib/asterisk/modules
15:57:55
#cp etc/dongle.conf /etc/asterisk/

16:00:36
#vim /etc/asterisk/dongle.conf
--- /tmp/l3-saved-3572.8879.25560	2014-11-27 17:00:50.682602902 +0200
+++ /etc/asterisk/dongle.conf	2014-11-27 17:01:26.542602880 +0200
@@ -83,8 +83,8 @@
 ; or you can omit both audio and data together and use imei=123456789012345 and/or imsi=123456789012345
 ;  imei and imsi must contain exactly 15 digits !
 ;  imei/imsi discovery is available on Linux only
-imei=123456789012345
-imsi=123456789012345
+;imei=123456789012345
+;imsi=123456789012345
 
 ; if audio and data set together with imei and/or imsi audio and data has precedence
 ;   you can use both imei and imsi together in this case exact match by imei and imsi required
16:01:27
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
16:01:45
#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 debian6 (pid = 18376)
...
  == Starting Dongle/dongle0-0100000002 at default,+1234567890,1 failed so falling back to exten 's'
  == Starting Dongle/dongle0-0100000002 at default,s,1 still failed so falling back to context 'default'
[Nov 27 17:22:06] WARNING[18795]: pbx.c:5367 __ast_pbx_run: Channel 'Dongle/dongle0-0100000002' sent into invalid extension 's' in context 'default', but no invalid handler
    -- Remote UNIX connection disconnected
    -- Remote UNIX connection
Executing last minute cleanups
  == Destroying musiconhold processes
debian6*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
/dev/pts/11
16:11:21
#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 debian6 (pid = 18376)
...
debian6*CLI> dongle ussd dongle0 *101#
[dongle0] USSD queued for send with id 0x1785fa0
    -- [dongle0] Successfully sent USSD 0x1785fa0
[Nov 27 17:13:50] NOTICE[18608]: at_response.c:267 at_response_ok: [dongle0] Successfully sent USSD 0x1785fa0
 [dongle0] Got USSD type 2 'USSD Terminated by network': ''
  == Starting Local/ussd@default-0ed3;1 at default,ussd,1 failed so falling back to exten 's'
  == Starting Local/ussd@default-0ed3;1 at default,s,1 still failed so falling back to context 'default'
[Nov 27 17:13:52] WARNING[18617]: pbx.c:5367 __ast_pbx_run: Channel 'Local/ussd@default-0ed3;1' sent into invalid extension 's' in context 'default', but no invalid handler
debian6*CLI> quit
Executing last minute cleanups
16:14:22
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-18582.10917.23040	2014-11-27 17:14:30.018602358 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 17:16:25.474602281 +0200
@@ -90,6 +90,11 @@
 
 include => parkedcalls
 
+; звонки на украинские номера идут через модем
+; с плюсом и без
+exten => _+380XXXXXXXXX,1,Dial(Dongle/dongle0/${EXTEN})
+exten => _380XXXXXXXXX,1,Dial(Dongle/dongle0/+${EXTEN})
+
 [local]
 ;внутренние звонки
 
16:16:25
#ls
1                                           extensions.conf.bak   sent           voicemail.conf.bak
asterisk-core-sounds-ru-gsm-current.tar.gz  extensions.conf.bak2  sip.conf.back
16:16:27
#ls /tmp/
belki.wav      gnash-cookies.6efRit  orbit-user          someone-called-8300  tracker-user
burunduki.wav  hello-en.wav          pulse-134TkwqLW5kH  someone-called-8301
call.call      hello-ru.wav          pulse-8xTeRLrWdHxS  ssh-eSqVI977c3IR
16:16:35
##ls /tmp/

16:17:19
#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 debian6 (pid = 18376)
...
debian6*CLI>
  == Using SIP RTP CoS mark 5
[Nov 27 17:17:50] NOTICE[18399]: chan_sip.c:22753 handle_request_invite: Call from '2301' (192.168.60.100:5060) to extension '0665097199' rejected because extension not found in context 'gr1'.
  == Using SIP RTP CoS mark 5
    -- Executing [380665097199@gr1:1] Dial("SIP/2301-00000000", "Dongle/dongle0/+380665097199") in new stack
    -- Called Dongle/dongle0/+380665097199
    -- Dongle/dongle0-0100000000 is making progress passing it to SIP/2301-00000000
    -- Dongle/dongle0-0100000000 answered SIP/2301-00000000
debian6*CLI> quit
Executing last minute cleanups
16:18:44
## я так понимаю работает

16:18:50
##yes

16:18:56
## теперь в обратную сторону

16:19:14
#less /etc/asterisk/dongle.conf
16:20:34
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-18582.2539.19662	2014-11-27 17:20:40.914602109 +0200
+++ /etc/asterisk/extensions.conf	2014-11-27 17:21:29.298602078 +0200
@@ -1,5 +1,10 @@
 [default]
 
+[gsm-incoming]
+
+; теперь будет звонить на первый телефон Сергея
+exten => s,1,Dial(SIP/2301)
+
 [menu]
 ;menu cc
 
16:21:29
#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 debian6 (pid = 18376)
...
debian6*CLI>
  == Starting Dongle/dongle0-0100000001 at default,+1234567890,1 failed so falling back to exten 's'
  == Starting Dongle/dongle0-0100000001 at default,s,1 still failed so falling back to context 'default'
[Nov 27 17:21:46] WARNING[18793]: pbx.c:5367 __ast_pbx_run: Channel 'Dongle/dongle0-0100000001' sent into invalid extension 's' in context 'default', but no invalid handler
debian6*CLI>
  == Starting Dongle/dongle0-0100000002 at default,+1234567890,1 failed so falling back to exten 's'
  == Starting Dongle/dongle0-0100000002 at default,s,1 still failed so falling back to context 'default'
[Nov 27 17:22:06] WARNING[18795]: pbx.c:5367 __ast_pbx_run: Channel 'Dongle/dongle0-0100000002' sent into invalid extension 's' in context 'default', but no invalid handler
debian6*CLI> quit
Executing last minute cleanups
16:22:09
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
16:25:36
#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 debian6 (pid = 18825)
...
debian6*CLI>
debian6*CLI>
debian6*CLI>
debian6*CLI>
debian6*CLI>
 [dongle0] Got SMS from +380509721434: 'Тест связи!'
    -- Executing [sms@gsm-incoming:1] System("Local/sms@gsm-incoming-502a;1", "sh -c "echo Тест связи! >> /tmp/sms.log"") in new stack
    -- Auto fallthrough, channel 'Local/sms@gsm-incoming-502a;1' status is 'UNKNOWN'
debian6*CLI> quit
Executing last minute cleanups
16:26:07
#cat /tmp/sms.log
Тест связи!
16:26: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 debian6 (pid = 18825)
Verbosity is at least 3
debian6*CLI>
debian6*CLI> dongle ussd dongle0 *101#
[dongle0] USSD queued for send with id 0x2b3c5b0
    -- [dongle0] Successfully sent USSD 0x2b3c5b0
[Nov 27 17:26:31] NOTICE[18882]: at_response.c:267 at_response_ok: [dongle0] Successfully sent USSD 0x2b3c5b0
 [dongle0] Got USSD type 2 'USSD Terminated by network': ''
    -- Executing [ussd@gsm-incoming:1] System("Local/ussd@gsm-incoming-26a7;1", "sh -c "echo  >> /tmp/ussd.log"") in new stack
    -- Auto fallthrough, channel 'Local/ussd@gsm-incoming-26a7;1' status is 'UNKNOWN'
debian6*CLI> quit
Executing last minute cleanups
16:26:40
#cat /tmp/ussd.log

16:26:43
#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 debian6 (pid = 18825)
Verbosity is at least 3
debian6*CLI> dongle ussd dongle0 *101
[dongle0] USSD queued for send with id 0x2b42870
    -- [dongle0] Successfully sent USSD 0x2b42870
[Nov 27 17:26:54] NOTICE[18882]: at_response.c:267 at_response_ok: [dongle0] Successfully sent USSD 0x2b42870
 [dongle0] Got USSD type 2 'USSD Terminated by network': ''
    -- Executing [ussd@gsm-incoming:1] System("Local/ussd@gsm-incoming-20e4;1", "sh -c "echo  >> /tmp/ussd.log"") in new stack
    -- Auto fallthrough, channel 'Local/ussd@gsm-incoming-20e4;1' status is 'UNKNOWN'
debian6*CLI>
debian6*CLI> quit
Executing last minute cleanups
16:27:02
#cat /tmp/ussd.log

16:27:03
#vim /etc/asterisk/extensions.conf
16:29:04
#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 debian6 (pid = 18825)
...
show         sms          start        stop         ussd
debian6*CLI> dongle sms dongle0
Usage: dongle sms <device> <number> <message>
       Send a SMS to <number> with the <message> from <device>
debian6*CLI> dongle sms dongle0 +380662707273 "Hello from Asterisk"
[dongle0] SMS queued for send with id 0x2b3b200
    -- [dongle0] Successfully sent SMS message 0x2b3b200
[Nov 27 17:31:55] NOTICE[18882]: at_response.c:257 at_response_ok: [dongle0] Successfully sent SMS message 0x2b3b200
debian6*CLI> quit
Executing last minute cleanups
16:32:00
#asterisk -rx 'dongle sms dongle0 +380662707273 "Hello from Asterisk once again"'
[dongle0] SMS queued for send with id 0x2b26580

Пятница (11/28/14)

/dev/pts/4
09:02:38
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-3858.1593.11306	2014-11-28 10:02:46.979470074 +0200
+++ /etc/asterisk/extensions.conf	2014-11-28 10:23:07.235453726 +0200
@@ -1,7 +1,27 @@
 [default]
 
+[gsm-card0]
+; для каждой карточки если надо
+[gsm-card1]
+
 [gsm-incoming]
 
+; ${DONGLENUMBER}  -- номер на который пришёл звонок
+
+; как сделать красивый маппинг?
+; +380501234567 => 3301
+; +380502233445 => 3302
+; через базу данных:
+; database set gsm-incoming +380501234567 3301
+; database set gsm-incoming +380502233445 3302
+; и используете в диалплане так:
+; Dial(SIP/${DB(gsm-incoming/${DONGLENUMBER})})
+
+; exten => _33XX,1,Dial(SIP/${EXTEN},5)
+; exten => _33XX,n,Dial(SIP/${DB(redirect/${EXTEN})})
+; только сначала нужно прописать мобильные телефоны в базе redirect:
+; database put redirect 3301 +380503322117
+
 ; теперь будет звонить на первый телефон Сергея
 ;exten => s,1,Dial(SIP/2301)
 
@@ -103,8 +123,16 @@
 
 ; звонки на украинские номера идут через модем
 ; с плюсом и без
-exten => _+380XXXXXXXXX,1,Dial(Dongle/dongle0/${EXTEN})
-exten => _380XXXXXXXXX,1,Dial(Dongle/dongle0/+${EXTEN})
+
+; это были исходящие звонки
+exten => _+38067XXXXXXX,1,Dial(Dongle/p:Kievstar/${EXTEN})
+exten => _38067XXXXXXX,1,Dial(Dongle/p:Kievstar/+${EXTEN})
+
+exten => _+38063XXXXXXX,1,Dial(Dongle/p:ASTELIT/${EXTEN})
+exten => _38063XXXXXXX,1,Dial(Dongle/p:ASTELIT/+${EXTEN})
+
+exten => _+38050XXXXXXX,1,Dial(Dongle/p:MTS/${EXTEN})
+exten => _38050XXXXXXX,1,Dial(Dongle/p:MTS/+${EXTEN})
 
 [local]
 ;внутренние звонки
/dev/pts/1
09:03:57
#screen -x
/dev/pts/0
09:03:57
#screen -x
/dev/pts/1
09:04:02
#w
 10:04:04 up 24 min,  4 users,  load average: 0.06, 0.05, 0.11
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
user     tty7     :0               09:40   24:03  13.72s  0.07s gdm-session-worker [pam/gdm3]
user     pts/0    :0               09:41    4.00s  0.10s  0.96s gnome-terminal
user     pts/3    :0               09:41   44.00s  0.07s  0.03s ssh user@192.168.12.254
root     pts/4    192.168.12.254   10:02   12.00s  0.07s  0.00s script -f -c bash -q /root/.lilalo//272701148987512
/dev/pts/0
09:04:02
#w
 10:04:04 up 24 min,  4 users,  load average: 0.06, 0.05, 0.11
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
user     tty7     :0               09:40   24:03  13.72s  0.07s gdm-session-worker [pam/gdm3]
user     pts/0    :0               09:41    4.00s  0.10s  0.96s gnome-terminal
user     pts/3    :0               09:41   44.00s  0.07s  0.03s ssh user@192.168.12.254
root     pts/4    192.168.12.254   10:02   12.00s  0.07s  0.00s script -f -c bash -q /root/.lilalo//272701148987512
прошло 24 минуты
/dev/pts/4
09:28:49
#lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation H67 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
01:00.0 PCI bridge: Integrated Technology Express, Inc. Device 8892 (rev 10)
02:00.0 Ethernet controller: Digium, Inc. Wildcard TDM800P 8-port analog card (rev 11)
03:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)
04:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6315 Series Firewire Controller (rev 01)
/dev/pts/1
09:34:09
#screen -x
/dev/pts/0
09:34:09
#screen -x
прошло >2 часов
/dev/pts/4
11:38:42
#ls -l
total 2048
-rw-r--r-- 1 root root     736 Nov 25 15:28 1
-rw-r--r-- 1 root root 2050757 Sep  7 02:39 asterisk-core-sounds-ru-gsm-current.tar.gz
-rw-r--r-- 1 root root     822 Nov 26 09:52 extensions.conf.bak
-rw-r--r-- 1 root root    1188 Nov 26 12:11 extensions.conf.bak2
-rw------- 1 root root     682 Nov 26 10:59 sent
-rw-r--r-- 1 root root     129 Nov 25 10:19 sip.conf.back
-rw-r----- 1 root root   21238 Nov 26 09:59 voicemail.conf.bak
прошло 78 минут
/dev/pts/1
12:56:54
#more /etc/asterisk/extensions.conf
/dev/pts/0
12:56:54
#more /etc/asterisk/extensions.conf
/dev/pts/1
12:59:28
#asterisk -rx "dialplan eload"
No such command 'dialplan eload' (type 'core show help dialplan eload' for other possible commands)
/dev/pts/0
12:59:28
#asterisk -rx "dialplan eload"
No such command 'dialplan eload' (type 'core show help dialplan eload' for other possible commands)
/dev/pts/1
12:59:44
#asterisk -rx "dialplan reload"
Dialplan reloaded.
/dev/pts/0
12:59:44
#asterisk -rx "dialplan reload"
Dialplan reloaded.
/dev/pts/1
13:03:23
#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 debian6 (pid = 2477)
...
[Nov 28 14:11:10] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:11:25] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:11:40] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:11:55] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:12:10] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:12:25] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:12:40] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
debian6*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
/dev/pts/0
13:03:23
#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 debian6 (pid = 2477)
...
[Nov 28 14:11:10] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:11:25] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:11:40] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:11:55] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:12:10] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:12:25] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
[Nov 28 14:12:40] WARNING[2561]: chan_dongle.c:215 opentty: unable to open /dev/ttyUSB2: No such file or directory
debian6*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
/dev/pts/1
13:12:51
#scp root@192.168.50.1://etc/asterisk/extensions.conf extensions.conf.pri
The authenticity of host '192.168.50.1 (192.168.50.1)' can't be established.
ECDSA key fingerprint is 2f:55:30:bf:42:64:f6:ec:16:a0:57:a3:f2:87:cb:69.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.50.1' (ECDSA) to the list of known hosts.
root@192.168.50.1's password:
extensions.conf                                             100% 8773     8.6KB/s   00:00
/dev/pts/0
13:12:51
#scp root@192.168.50.1://etc/asterisk/extensions.conf extensions.conf.pri
The authenticity of host '192.168.50.1 (192.168.50.1)' can't be established.
ECDSA key fingerprint is 2f:55:30:bf:42:64:f6:ec:16:a0:57:a3:f2:87:cb:69.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.50.1' (ECDSA) to the list of known hosts.
root@192.168.50.1's password:
extensions.conf                                             100% 8773     8.6KB/s   00:00
/dev/pts/1
13:14:38
#more /etc/asterisk/extensions.confю.pri

Файлы

  • /tmp/sms.log
  • /tmp/ussd.log
  • /tmp/sms.log
    >
    Тест связи!
    
    /tmp/ussd.log
    >

    Статистика

    Время первой команды журнала15:26:10 2014-11-27
    Время последней команды журнала13:14:38 2014-11-28
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %17.82
    Процент синтаксически неверно набранных команд, % 4.95
    Суммарное время работы с терминалом *, час 1.92
    Количество командных строк в единицу времени, команда/мин 0.88
    Частота использования команд
    asterisk15|==============| 14.15%
    ls7|======| 6.60%
    automake7|======| 6.60%
    vim7|======| 6.60%
    configure6|=====| 5.66%
    svn5|====| 4.72%
    more4|===| 3.77%
    screen4|===| 3.77%
    cd4|===| 3.77%
    lsusb3|==| 2.83%
    make3|==| 2.83%
    cat3|==| 2.83%
    grep3|==| 2.83%
    autoconf2|=| 1.89%
    /etc/init.d/asterisk2|=| 1.89%
    #2|=| 1.89%
    apt-get2|=| 1.89%
    lsmod2|=| 1.89%
    aclocal2|=| 1.89%
    w2|=| 1.89%
    modinfo2|=| 1.89%
    head2|=| 1.89%
    scp2|=| 1.89%
    tail2|=| 1.89%
    #yes1|| 0.94%
    дмdmesg1|| 0.94%
    cp1|| 0.94%
    свcd1|| 0.94%
    autonmake1|| 0.94%
    http://chan-datacard.googlecode.com/svn/trunk/1|| 0.94%
    #ls1|| 0.94%
    lspci1|| 0.94%
    bash1|| 0.94%
    less1|| 0.94%
    ^C1|| 0.94%
    exit1|| 0.94%
    apt-cache1|| 0.94%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ 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
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$