Payday Loans Payday Loan

Archive

Archive for August, 2010

Kannel: Compile, Install, and Configure Open Source WAP and SMS Gateway

August 2nd, 2010 2 comments

I have recently worked an application where we needed to send and receive SMS messages. The application will receive a sms message, and return some business values to the client. It will also periodically push message to clients and update the status of their transactions. It become obvious that we need a gateway that could handle sms message between our applications and client’s handheld devices.

The application would be part of platform which includes asterisks(Open source PBX) and other great open source products. We needed to have an open source sms gateway to include the platform and that was one we came across the kannel. Kannel is a compact and very powerful open source WAP and SMS gateway, used widely across the globe both for serving trillions of short messages (SMS), WAP Push service indications and mobile internet connectivity. ”

I am going to layout the steps that I have followed to install, configure, and run some real world scenarios:

Compiling and Installation:

To compile and install the latest version of kannel on ubuntu 10.04 LTS follow these steps:

  $ cd  ~Download
  $ wget http://www.kannel.org/download/1.4.3/gateway-1.4.3.tar.gz
  $ cd ..
  $ mkdir src
  $ tar xfz ../Downloads/gateway-1.4.3.tar.gz 
  //congures kannel to be installed on   /opt/kannel
  $ configure --prefix=/opt/kannel   
  //In my case after running the above command, it complain not finding one of the required library libxml12. 
  //I have downloaded and installed (compiled the src and installed) plus the following command
 // sudo apt-get install libxml2-dev
  $ make 
  $ make install

Configuration
Like any great server application, for-example apache http, and Asterisk, comping and isntalling is the easy part. In order to use the system in a usefull way you need to tell the system how you want it to work and behave.
In kannel, there are several configuriton files that you need to understand and modify. you can find them /opt/kannel/gw/ (if you have followed my steps). If they are not already there, check “gw” folder with the following files
modems.conf, other_smskannel.conf, other_smskannel.conf, other_smskannel.conf, smskannel-ssl.conf, smskannel-ssl.conf in the compilation directory(~src/gateway-1.4.3/gw) and copy to /opt/kannel/gw

Most of the server softwares that comes with configuration, you can run and the system would run smoothlly but it may not behave as you expected. As you I have said before you need to modify the configuration files with your needs.
I usually runt they system with the default configurations and later tweak with my needs. Kannel comes with a test program which acts like SMSC. It is a fake SMSC. Fake SMSC is a simple protocol to test out Kannel. It is not a real SMS center, and cannot be used to send or receive SMS messages from real phones. So, it is ONLY used for testing purposes.

$ ls  /opt/kanne/sbin/
bearerbox  run_kannel_box  smsbox  wapbox

After you have compiled Kannel and edited configuration file for your taste, you can either run Kannel from command line or use supplied start-stop-daemon and run_kannel_box programs to use it as a daemon service.
Let us just test the system without any modification to the configuration files and use the fake SMSC for sending and receiving messages:

//starting the gateway
/opt/kannel$ sudo ./sbin/bearerbox  gw/smskannel.conf

//after the bearerbox, you can start either smsbox or wapbox
/opt/kannel$ sudo ./sbin/smsbox  gw/smskannel.conf

you need to start the bearer box before the other boxes. After that we can start the fake SMSC (please see the manual for details http://www.kannel.org/download/1.4.3/userguide-1.4.3/userguide.html)

test/fakesmsc -i 0.1 -m 100 "100 200 text nop" "100 300 text echo this"

With the above steps completed, you have a working system and sending/receiving messages between bearerbox, smsbox, and fakesmsc.
Let us now modify gw/smskannel.conf and configure the kannel to work with out GSM modem and interact with a web application.

Read more…

Categories: WAP and SMS Tags: , , ,