| /l3/users/2014-11-nt-voip/nt-voip/debian6/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 |
|
|
#more call-all
|
|
#vim call-all
|
|
#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
|
|
#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
# каналы перебираются правильно
|
|
#bash call-all
|
|
#^C
|
|
#дм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 |
|
#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 |
|
#lsusb | grep hua
|
|
#lsusb | grep Hua
Bus 004 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem |
|
#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 |
|
#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 |
|
#lsmod | head -2
Module Size Used by option 37168 0 |
|
#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 |
|
#modinfo us-wwan
ERROR: Module us-wwan not found. |
|
#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) |
|
#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 |
|
#http://chan-datacard.googlecode.com/svn/trunk/
bash: http://chan-datacard.googlecode.com/svn/trunk/: No such file or directory |
|
#cd chan-datacard/
|
|
#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 |
|
#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) ... |
|
#./configure
configure complete, now type 'make' |
|
#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 |
|
#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 |
|
#svn co http://chan-d^Cooglecode.com/svn/trunk/ chan-datacard
|
|
#cd ..
|
|
#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 |
|
#svn co http://chan-dongle.googlecode.com/svn/trunk/
svn: 'http://chan-dongle.googlecode.com/svn/trunk' path not found |
|
#svn co http://dongle.googlecode.com/svn/trunk/
^Csvn: Caught signal |
|
#cd chan-dongle/
|
|
#./configure
bash: ./configure: No such file or directory |
|
#configure
bash: configure: command not found |
|
#./configure
bash: ./configure: No such file or directory |
|
#ls
Build.lua DongleCore DongleHelloWorld DongleStub lunit OptionHouse |
|
#autonmake -a
bash: autonmake: command not found |
|
#automake -a
automake: `configure.ac' or `configure.in' is required |
|
#aclocal
aclocal: `configure.ac' or `configure.in' is required |
|
#autoconf
autoconf: error: no input file |
|
#automake
automake: `configure.ac' or `configure.in' is required |
|
#automake -a
automake: `configure.ac' or `configure.in' is required |
|
#./configure
bash: ./configure: No such file or directory |
|
#cd ..
|
|
#svn co http://asterisk-chan-dongle.googlecode.com/svn/trunk/ chan-dongle
svn: 'chan-dongle' is already a working copy for a different URL |
|
#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. |
|
#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 |
|
#aclocal
|
|
#autoconf
|
|
#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 |
|
#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 |
|
#automake
automake: no `Makefile.am' found for any configure output |
|
#automake -a
automake: no `Makefile.am' found for any configure output |
|
#./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 |
|
#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 |
|
#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 |
|
#cp etc/dongle.conf /etc/asterisk/
|
|
#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 |
|
#/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 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 |
|
#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 |
|
#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]
;внутренние звонки
|
|
#ls
1 extensions.conf.bak sent voicemail.conf.bak asterisk-core-sounds-ru-gsm-current.tar.gz extensions.conf.bak2 sip.conf.back |
|
#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 |
|
##ls /tmp/
|
|
#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 |
|
## я так понимаю работает
|
|
##yes
|
|
## теперь в обратную сторону
|
|
#less /etc/asterisk/dongle.conf
|
|
#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 |
|
#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 |
|
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
|
#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 |
|
#cat /tmp/sms.log
Тест связи! |
|
#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
|
|
#cat /tmp/ussd.log
|
|
#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
|
|
|