During this past weekend I tested Kannel with my old GSM modem, it's a Free Works ED6000 (or WOO ED6000), also tried it on my Huawei K3565.
I got the Kannel development version from SVN
svn co http://svn.kannel.org/gateway/trunk kannel-gateway, this contains the smsbox, bearerbox and sqlbox (currently unused).
I then changed to my Kannel source directory (kannel-gateway) and compiled the source to /opt/kannel15. After compiling I started the bearerbox and smsbox, but obviously failed because both expect to be passed a configuration file which is not auto-generated during compilation. I had a lot of issues getting a working config file, most of the problems were due to not having an smsc group in my configuration which caused some weird behaviour, Kannel expects the core, smsbox, smsc and sendsms-user configured in order to do anything useful, that is if your interested in sending SMSs. There is an example config file in the docs package (/doc/examples/) but is hard to notice, I'm going to share my modified version below and explain some sections.
# CORE group = core admin-port = 13000 admin-password = bar log-file = "/tmp/kannel.log" access-log = "/tmp/access.log" # Smsbox related smsbox-port = 13001
The admin-port and admin-password are used to run Kannel commands like shut-down, adding smscs, removing smscs, etc. I think smsbox-port is the port used by the smsbox to connect to the bearerbox.
# SMSBOX SETUP group = smsbox bearerbox-host = localhost sendsms-port = 13013 log-file = "/tmp/smsbox.log"
The sendsms-port is the port used by the sendsms section, this is accessible from
# SEND-SMS USERS group = sendsms-user username = foo password = bar
The sendsms user.
To configure the modems, I needed their init-string, device (the device location) and modemtype, and I used wvdial to get all this information (install it
sudo apt-get install wvdial).
Then insert the modem and run
wvdialconf, it will generate a wall of text, mine contained the following lines.
# HUAWEI ttyUSB1<*1>: Modem Identifier: ATI -- Manufacturer: huawei Found a modem on /dev/ttyUSB0. ttyUSB0<Info>: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0" # WOO ED6000 ttyACM0<*1>: Modem Identifierr: ATI -- 5209.T406.00.A4 Found an USB modem on /dev/ttyACM0. ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
The first line has the modemtype ("huawei" and "5209.T406.00.A4"), the second has the device location (/dev/ttyUSB0 and /dev/ttyACM0) and the third has the init-string. My config for both modems look like this:
# SMSC GSM group = smsc smsc = at smsc-id = myhuawei allowed-smsc-id = myhuawei modemtype = huawei device = /dev/ttyUSB0 group = smsc smsc = at smsc-id = ed6000 allowed-smsc-id = ed6000 modemtype = "5209.T406.00.A4" device = /dev/ttyACM0 # MODEMS group = modems id = huawei name = myhuawei init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0" group = modems id = "5209.T406.00.A4" name = ed6000 init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
I struggled with SMSs being sent via an incorrect modem even while specifying the modem I wanted to handle the SMS, this was due to not having the allowed-smsc-id configuration option.
After this, I added my config to the Kannel directory /opt/kannel15/ and ran it using the following commands:
/opt/kannel15/sbin/bearerbox /opt/kannel15/kannel.conf & /opt/kannel15/sbin/smsbox /opt/kannel15/kannel.conf
To wrap things up, I went to:
and didn't receive anything:( Tried a couple of things and even assumed that my modem is not supported.
and it worked:) This set-up expects the number to either not have a country code or have the country code with the + (written as 00) before it.
I will now attempt to get the inbound messages working and also make use of the SQLBox and hopefully write a post about it.