I prefer to run Debian GNU/Linux on servers, but this will work well on Ubuntu Linux.
I have already covered the installation of the Dongle module in relation to the dir320 router in detail, so I will not repeat myself in such moments as disabling the flash drive and virtual cdrom on the Huawei E1550 modem, this is described in detail in this article. instruction.
Asterisk itself is installed according to the instructions: Install Asterisk 1.8 in Debian Squeeze or Ubuntu Linux, build from VOIP Asterisk source
The installation is similar on newer versions of Debian, Ubuntu and other Debian-based operating systems, as well as non-Debian systems such as Redhat, Centos, etc.
Let's start installing the Dongle module
The first thing you need to do is set up. udevSo that when you connect the modem, it gets Asterisk user rights and Asterisk itself can work with the modem. And that's what we create. /etc/udev/rules.d/10-modem.rules team:
echo 'KERNEL=="ttyUSB*", OWNER="asterisk", GROUP="dialout"' > /etc/udev/rules.d/10-modem.rules
When connecting the modem, we can see the rights that it received by the team:
ls -la /dev/ttyUSB*
System response:
crw-rw---- 1 asterisk dialout 188, 0 Сен 30 22:08 /dev/ttyUSB0 crw-rw---- 1 asterisk dialout 188, 1 Сен 30 22:08 /dev/ttyUSB1 crw-rw---- 1 asterisk dialout 188, 2 Сен 30 22:08 /dev/ttyUSB2
Go to the folder where we will work on assembling a module from source code by the team:
cd /usr/src/asterisk-src
Install the latest stable version of Dongle-1.1.r14:
Download, unpack and go to the folder with the source module chan_dongle following the commands:
wget http://asterisk-chan-dongle.googlecode.com/files/chan_dongle-1.1.r14.tgz tar xvfz chan_dongle-1.1.r14.tgz cd chan_dongle-1.1.r14
If the official site does not have an archive with a distribution of the Dongle module, download it from this site:
wget http://softnastroy.com/downloads/asterisk/chan_dongle-1.1.r14.tgz tar xvfz chan_dongle-1.1.r14.tgz cd chan_dongle-1.1.r14
Start configuration, assembly and installation of the module chan_dongle by teams:
./configure make cp chan_dongle.so /usr/lib/asterisk/modules/ cp etc/dongle.conf /etc/asterisk/
Install the latest version of Dongle from svn:
aptitude install autoconf cd /usr/src/asterisk-src/ svn checkout http://asterisk-chan-dongle.googlecode.com/svn/trunk/ cd trunk/ aclocal autoconf automake -a ./configure make cp chan_dongle.so /usr/lib/asterisk/modules/ cp etc/dongle.conf /etc/asterisk/ chown -R asterisk:asterisk /usr/lib/asterisk/modules/chan_dongle.so /etc/init.d/asterisk restart
Add to the bottom of the configuration file /etc/asterisk/dongle.conf:
vi /etc/asterisk/dongle.conf [modem1] ;0X3 - XXX-XX-XX - Life audio=/dev/ttyUSB1 ; tty for audio connection data=/dev/ttyUSB2 ; tty for AT commands ;imei=XXXXXXXXXXXXXXX ;imsi=XXXXXXXXXXXXXXX context=incoming-modem1 languge=ru group=1 rxgain=0 ; increase the incoming volume txgain=0 ; increase the outgoint volume autodeletesms=yes resetdatacard=yes ; reset datacard during initialization u2diag=0 ; set U2DIAG parameter (256 = modem+card_reader) usecallingpres=yes ; use the caller ID presentation or not callingpres=allowed_passed_screen ; set caller ID presentation
File in. /etc/asterisk/extensions.conf add:
vi /etc/asterisk/extensions.conf
;;;;;;; GSM ;;;;;;;
;;; Life - (XXX-XXX-XX-XX) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[incoming-modem1]
; Предположим номер на симке Украина: 0632223344, Россия: 89852223344 указываем этот номер в контексте модема:
;;; Для Украины:
exten => +380632223344,1,Set(CALLERID(all)=${CALLERID(num):3})
;;; Для России:
;;;exten => +79852223344,n,Set(CALLERID(all)=${CALLERID(num)})
;;; same => n,Set(CALLERID(num)=8${CALLERID(num):2})
same => n,Dial(SIP/101,60,KTt)
same => n,Hangup()
exten => ussd,1,Verbose(Incoming USSD: ${BASE64_DECODE(${USSD_BASE64})})
same => n,System(echo ${DONGLENAME} - ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${BASE64_DECODE(${USSD_BASE64})} > /var/log/asterisk/ussd_Life1-modem1.txt)
same => n,System(echo "${DONGLENAME} (063-222-33-44) - ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${BASE64_DECODE(${USSD_BASE64})}" > /var/log/asterisk/ussd_Life1-modem1.txt)
same => n,Hangup()
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
same => n,System(echo "${DONGLENAME} - ${CALLERID(num)} - ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${BASE64_DECODE(${SMS_BASE64})}" >> /var/log/asterisk/sms_Life1-modem1.txt)
same => n,Hangup()
For calls through this modem, in the context of the user sip who has the right to make calls through this modem add:
;;; Life1
exten => _9X.,1,Dial(Dongle/modem1/${EXTEN:1},120,KT)
same => n,Hangup(${HANGUPCAUSE})It says that after 9 we call any number via gsm modem.
After installing the module, restart Asterisk with the command:
/etc/init.d/asterisk restart
To check the modem, run the console with the command:
rasterisk
And we're doing the command in the console:
dongle show devices
Dongle Show Devices – This command lets us see if the module can see our modem. Here's my takeaway from this team:
serv*CLI>dongle show devices ID Group State RSSI Mode Submode Provider Name Model Firmware IMEI IMSI Number Life-modem1 1 Free 5 5 4 life:) E1550 11.608.14.15.311 XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX Unknown serv*CLI>
! You have to do this. If you write a number instead of a number UnknownThen you need to specify the SIM card number using two commands in the Asterisk console:
dongle cmd modem1 AT+CPBS=\"ON\" dongle cmd modem1 AT+CPBW=1,\"+380632223344\",145
Reboot Asterisk and check for the number in the output modems.
serv*CLI>dongle show devices ID Group State RSSI Mode Submode Provider Name Model Firmware IMEI IMSI Number modem1 1 Free 5 5 4 life:) E1550 11.608.14.15.311 XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX +380632223344 serv*CLI>
Task accomplished.
GSM gateway on VOIP Asterisk and Debian server, or Ubuntu Linux is made and runs via Huawei E1550 3G modem
I was with you. Sergey Lazarenko.
Since the work of a system administrator is very associated with a sedentary lifestyle, we try to regularly load ourselves, for example, we will do a small charge for 8 minutes by swaying the press:



comment