Configure the kannel with nokia(symbian) phone

Hello friends now i gave the tutorial how to configure the kannel with nokia phones

wvdial:-wvdial is used for check the mobile is as a modem.wvdial is also used  a some command with help the check your phone is work like a modem or not.

WvDial sacrifices some of the flexibility of programs like “chat” in order to make your dialup configuration easier. When you install this package, your modem will be detected automatically and you need to specify just three parameters: the phone number, username, and password. WvDial knows enough to dial with most modems and log in to most servers without any other help.

  • 1)first of all you download the wvdial package

this package is very useful in configure the kannel

  • sudo apt-get install wvdial

now your wvdial package are install now configure the wvdial

find the wvdial configure  file write the command

  • locate wvdial.conf

now you see this path

  • /etc/wvdial.conf

open this file in editor

  • sudo gedit /etc/wvdial.conf

now add some line in this file

  • [Dialer Defaults]
  • Init1 = ATZ
  • Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
  • ;Phone = +919779173995
  • Modem Type = USB Modem
  • ; Phone = <Target Phone Number>
  • ISDN = 0
  • ; Password = <Your Password>
  • New PPPD = yes
  • ; Username = <Your Login Name>
  • Modem = /dev/ttyACM0
  • Baud = 460800

now attach your phone with pc and check its work or not

run the command in terminal

  • sudo wvdialconf

if screen like this then your device are work

2013-06-08 12.22.23

else device not work

now your device are work the start the configuring kannel

open the kannel.conf file in editor

find the kannel.conf file

run  this command in terminal

locate kannel.conf

And now open this file in editor

Edit kannel.conf file on your desktop or anywhere you want in your file system.

core group is used for general bearerbox configuration. dlr-storage value is depend on which DBMS is used.

  •  group = core
     admin-port = 13003
     admin-password =
     admin-allow-ip = "127.0.0.1"
     dlr-storage = mysql //where to store the logs of sms
     smsbox-port = 13016
     log-file = "/var/log/kannel/bearerbox.log"
     access-log = "/var/log/kannel/access.log"
     box-allow-ip = "127.0.0.1"
     log-level = 0

smsc group include all variables which used to set SMS center in kannel. smsc-id value is name of device which is connected. modemtype and device change according to Modem value in wvdial.conf file

  •  group = smsc
     smsc-id = Nokia
     smsc = at
     modemtype = USB Modem
     device= /dev/ttyACM0
     my-number = +919888888887
     connect-allow-ip = 127.0.0.1
     sim-buffering = false
     log-level = 0

mysql-connection group is used when mysql database is used to store data values. database,username,password variables values are database name,database username and password respectively.


  • group = mysql-connection
  • id = mydlr
  • host = localhost
  • username = boot
  • password = abc
  • database = key
 
  •  group = dlr-db
     id = mydlr
     table = dlr
     field-smsc = smsc
     field-timestamp = ts
     field-source=source
     field-destination = destination
     field-service = service
     field-url = url
     field-mask = mask
     field-status = status
     field-boxc-id = boxc
 

Modem group is used to define Modem configuration. init- string variable value change according to Init value in wvdial.conf file





  • group = modems
  • id = Nokia
  • name = Nokia
  • detect-string = “Nokia”
  • init-string = “ATZ”
  • init-string = “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”
  • message-storage = SM
  • message-start = 0

 

smsbox group must define to use SMS Kannel


  • group = smsbox
     smsbox-id = mysmsbox
     bearerbox-host = localhost //hostname
     bearerbox-port = 13020
     sendsms-port = 13013
     global-sender = +919888888887 //your modem number
     access-log = "/var/log/kannel/smsbox-access.log"
     log-file = "/var/log/kannel/smsbox.log"
     log-level = 0
     mo-recode = true

smsbox route group is develop an interface between smsbox and bearerbox.

 

  •  group = smsbox-route
  • smsbox-id = mysmsbox
  • smsc-id = Nokia

 

sendsms-user group is used to push SMS through browser. Variables username and password are used for authentication purpose

 

  • group = sendsms-user
     username =
     password =
     concatenation= true
     max-messages = 10000

 

 

sms-service group is provide services to incoming SMS. Accepted-smsc variable means which SMS center used to accept as incoming SMS

 

  •  group = sms-service
     keyword-regex = .*
     catch-all = true
     accepted-smsc = Nokia
     max-messages = 99
     get-url = "http://localhost/api/sms.php?phone=%p&text=%a"

 

Edit sqlbox.conf file where your kannel.conf file is placed.

sqlbox group used to tell kannel about sms log table and insert table. The sql-insert-table is used to store SMS which we want to send and sql-log-table is show logs of sms which are send through kannel and log of delivery reports.

 

  • group = sqlbox
    id = sqlbox-db
    global-sender = "+919888888887"
    bearerbox-host = localhost
    bearerbox-port = 13016
    smsbox-port = 13020
    smsbox-port-ssl = false
    sql-log-table = sent_sms
    sql-insert-table = send_sms
    log-file = "/var/log/kannel/kannel-sqlbox.log"
    log-level = 0

 

 

mysql-connection group explained before

  • group = mysql-connection
    id = sqlbox-db
    host = localhost
    username = boot
    password = abc
    database = key

 

Lets send SMS through kannel through http(browser) and application. Excited ;)

Start kannel service: Run these commands on seperate Terminals sequentially with sudo user.

 

  • $ bearerbox -v 1 kannel.conf
  • $ sqlbox -v 1 sqlbox.conf
  • $ smsbox -v 1 kannel.conf

 

Set verbosity level
0 is ‘debug’.
1 is ‘info.
2 ‘warning’.
3 ‘error’.
4 ‘panic’.

Send SMS through browser : Open your favorite browser and type below given on address bar.

http://localhost:13003/cgi-bin/sendsms?username=&password=&to=0123456&text=Hello+world

13001 is an admin-port number which is defined in core group.
username and password value which is define in sendsms-user group.
to value contain phone number to whom we want to send SMS.
text value contain content of SMS.

Send SMS through application : To send through application is just do one entry in send_sms table of defined database in config files.

Method : Write sql query which insert sender, receive number and message data in send_sms table. kannel automatically check send_sms table and send SMS.

sql code of tables

 

  • sent_sms


CREATE TABLE IF NOT EXISTS `sent_sms` (
  `sql_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `momt` enum('MO','MT','DLR') DEFAULT NULL,
  `sender` varchar(20) DEFAULT NULL,
  `receiver` varchar(20) DEFAULT NULL,
  `udhdata` blob,
  `msgdata` text,
  `time` bigint(20) DEFAULT NULL,
  `smsc_id` varchar(255) DEFAULT NULL,
  `service` varchar(255) DEFAULT NULL,
  `account` varchar(255) DEFAULT NULL,
  `id` bigint(20) DEFAULT NULL,
  `sms_type` bigint(20) DEFAULT NULL,
  `mclass` bigint(20) DEFAULT NULL,
  `mwi` bigint(20) DEFAULT NULL,
  `coding` bigint(20) DEFAULT NULL,
  `compress` bigint(20) DEFAULT NULL,
  `validity` bigint(20) DEFAULT NULL,
  `deferred` bigint(20) DEFAULT NULL,
  `dlr_mask` bigint(20) DEFAULT NULL,
  `dlr_url` varchar(255) DEFAULT NULL,
  `pid` bigint(20) DEFAULT NULL,
  `alt_dcs` bigint(20) DEFAULT NULL,
  `rpi` bigint(20) DEFAULT NULL,
  `charset` varchar(255) DEFAULT NULL,
  `boxc_id` varchar(255) DEFAULT NULL,
  `binfo` varchar(255) DEFAULT NULL,
  `meta_data` text,
  PRIMARY KEY (`sql_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ;
  • send_sms
 
CREATE TABLE IF NOT EXISTS `send_sms` (
  `sql_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `momt` enum('MO','MT') DEFAULT NULL,
  `sender` varchar(20) DEFAULT NULL,
  `receiver` varchar(20) DEFAULT NULL,
  `udhdata` blob,
  `msgdata` text,
  `time` bigint(20) DEFAULT NULL,
  `smsc_id` varchar(255) DEFAULT NULL,
  `service` varchar(255) DEFAULT NULL,
  `account` varchar(255) DEFAULT NULL,
  `id` bigint(20) DEFAULT NULL,
  `sms_type` bigint(20) DEFAULT NULL,
  `mclass` bigint(20) DEFAULT NULL,
  `mwi` bigint(20) DEFAULT NULL,
  `coding` bigint(20) DEFAULT NULL,
  `compress` bigint(20) DEFAULT NULL,
  `validity` bigint(20) DEFAULT NULL,
  `deferred` bigint(20) DEFAULT NULL,
  `dlr_mask` bigint(20) DEFAULT NULL,
  `dlr_url` varchar(255) DEFAULT NULL,
  `pid` bigint(20) DEFAULT NULL,
  `alt_dcs` bigint(20) DEFAULT NULL,
  `rpi` bigint(20) DEFAULT NULL,
  `charset` varchar(255) DEFAULT NULL,
  `boxc_id` varchar(255) DEFAULT NULL,
  `binfo` varchar(255) DEFAULT NULL,
  `meta_data` text,
  PRIMARY KEY (`sql_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Advertisements

One Comment Add yours

  1. Justin says:

    good job 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s