Recently , I got opportunity to work in a project whose main aim is to develop a system that could send and receive SMS via Kannel. During the course of building the system, I learned more about it and I am here to share my knowledge on basics of Kannel and its configuration to make a simple system which could send and receive SMS. 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. In this article , I would focus only on SMS configuration part in Kannel. SMS, Short Messaging Service, is a way to send short (160 character) messages from one GSM phone to another. When a sender sends the SMS to certain number , this sms is send to SMS center ( SMSC ) first which is responsible for that number. This SMS center then sends the message onward to specified receiver. The SMS center might be any of the mobile network operator like NTC , NCELL , UTL etc. for Nepal or Docomo , Vodafone for India. Here , in this article I have used a FAKE SMSC program which acts as a SMSC simulator. Since we dont have real SMSC available here so I will be using a Fake SMSC for test . REQUIREMENTS: To make a system working we require : Kannel FAKE SMSC
sudo apt-get install kannel sudo apt-get install kannel-extras Configuring the SMS gateway : The configuration file must be set at /etc/kannel/kannel.conf . The configuration part can be divided into three parts : Bearerbox configurations Smsbox configurations Wapbox configurations
We would only be talking about the Bearerbox and Smsbox configuration here. BEARERBOX CONFIGURATIONS: group = core admin-port = 13000 admin-password = test admin-deny-ip = "..." admin-allow-ip = "127.0.0.1" smsbox-port = 13001 box-deny-ip = "..." box-allow-ip = "127.0.0.1" dlr-storage = internal log-level = 0 SMSBOX CONFIGURATIONS: group = smsbox smsbox-id = mysmsbox bearerbox-host = localhost sendsms-port = 13013 log-level = 0 Further we have to define the Sms-service ,Sendsms-user , Smsbox-route and SMSC to make system send SMS. group = sendsms-user username = simple password = simple123 group = smsc smsc = fake smsc-id = FAKE port = 10000 log-level = 0 group = smsbox-route smsbox-id = mysmsbox smsc-id = FAKE group = sms-service keyword = default text = "hi how are you" Inside the /etc/kannel/kannel.conf the configuration file looks like : kannel.confThe above part is the configuration part for kannel.conf inside /etc/kannel. After writing the configuration we would start the kannel service using . sudo service kannel start This will start the Bearerbox. Similarly we have to start the Smsbox . For that we can follow the following steps : cd /etc/kannel smsbox We are using FAKE SMSC to send and receive message. Message can be send in two ways from the system and they are : Inbound Message Outbound Message
Inbound Message :
Inbound message are those messages that are received in the kannel system with specific keyword and the kannel system will reply back with the text associated with that keyword. In the real life scenario this can be related to any customer sending message for request of news report , weather report or SLC result using certain keyword like SLC
kannel.conf