PoiNtEr->: Install and Configure Kannel SMS and WAP gateway

                             Difference between a dream and an aim. A dream requires soundless sleep, whereas an aim requires sleepless efforts.

Search This Blog

Friday, February 17, 2012

Install and Configure Kannel SMS and WAP gateway

In this First tutorial we gonna have a look at the kannel architecture and how to Install configure it as an sms gateway with Samsung S5230 Mobile modem.            

To install kannel :
1:For ubuntu Users

Goto software center or synaptic manager and select kannel from list.
 Alternative: Via terminal
 If you are more at ease using terminal
  1. Check that libxml2 is installed on your system : dpkg -l libxml2
  2. else : sudo apt-get install libxml2
  3. Install kannel from debian or kannel repository : sudo apt-get install kannel2
2:Other platform 
Goto kannel download page and select appropriate release for yourself.

/* If you have any installation problem just leave comment below*/
                                                                                                                          Kannel architecture
Kannel Architecture

The architecture of is divided in three kinds of processes called boxes:
  1. BearerBox is the core of the architecture – it implements the WDP layer (provide basic core services)
  2. SMSBox implements the rest of the SMS gateway functionality (can have multiple SMSBox)
  3. WAPBox implements WAP protocol stack and WAP Push (can have multiple WAPBox)
As this tutorial is about configuring Kannel to be used for an SMS application we will only consider the SMS centre , the BearerBox and the SMSBox.
You can find more details explanations about the architecture in here.

Now before moving any further make sure your Web Server(apache2) is up and working.
Open /etc/kannel/kannel.conf with your editor and add the following lines.

1. The Core Group (BearerBox)
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
status-password = foo
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = ""

2. The SMS Centre Group

group = smsc
smsc = at
modemtype = Samsung Electronics Co., Ltd S5230
device = /dev/ttyACM0
speed = 19200
my-number = +918009657517
sms-center = +919020000500
validityperiod = 167

3. The Modems Group

group = modems
broken = true
id = Samsung Electronics Co., Ltd S5230
name = "Samsung Electronics Co., Ltd S5230"
detect-string = "S5230"
init-string = "AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0 "
speed = 115200
enable-mms = true
message-storage = sm

Now this one is difficult as you have to find init-strings for your modem . To find that you can install wvdial and check its wvdial.conf file or you can go to the modem manufacturer website and check out its manual or google it out ,well i will suggest you to use first way.I am using Samsung S5230 as my primary modem here which will be used to send sms on behalf of me.

4. The SMSBox Group
group = smsbox
bearerbox-host = localhost
sendsms-port = 13013
global-sender = 13013
sendsms-chars = "0123456789 +-"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"

5. Send SMS User Group
group = sendsms-user
username = kannel
password = kannel
concatenation = true
max-messages = 3
max-messages = 10

6.SMS Service Group

group = sms-service

keyword = default

get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b"

accept-x-kannel-headers = true

max-messages = 3

concatenation = true

catch-all = true

catch-all = true

Starting Kannel Boxes
1. Start the BearerBox
Open terminal and type the following command
sudo bearerbox -v 0 /etc/kannel/kannel.conf
Bearerbox Working

Bearerbox Working

(you will get this screen if your configuration file has not mistakes)

2. Start the SMSBox

Open terminal and type the following command
sudo smsbox -v 0 /etc/kannel/kannel.conf
                                                     (this will start the SMSBox)

Your done, you can check the status of the services by navigating to “http://localhost:13000/status?password=foo” with your browser



  1. Thanks for the Nice blog to having information of sms gateway and get detail of Top 5 Bulk SMS Service Provider in India to send promotional sms.

  2. Companies can also purchase the Bulk SMS software that offers a wide range of functionality such as customizable speed options padisoft company