Pages

Thursday, July 1, 2010

Configure and Use Kannel SMS Gateway

=================================================
Downloading and Compiling
=================================================

download kannel gateway from (Download Latest Kannel Gateway)

prepare installation

# mkdir src
# cd src
# tar xfz ../downloads/gateway-1.4.1.tar.gz
# cd gateway-1.4.1

Compile and install.

# make
# sudo make install
password: **************


=================================================
KANNEL COMMANDS
==================================================
GO TO gw directory (like /usr/share/gateway-1.4.3/gw)

=> start bearerbox
./bearerbox /etc/httpd/conf/kannel.conf

=> start smsbox
./smsbox /etc/httpd/conf/kannel.conf


run in browser to test status
=> http://localhost:13000/status

sendsms with
=> http://192.168.100.xxx:13013/cgi-bin/sendsms?to=9558043842&text=hello+how+u+u&username=user&password=pass


=======================================
SAMPLE KANNEL CONFIGURATION FILE
=======================================

(named kannel.conf and may be located at /etc/httpd/conf directory)
Configuration : Configuration is divided into a few key groups,
- The core Group
- The smsc Group
- The smsbox Group
- The Sendsms Group


#
# THIS IS A SAMPLE CONFIGURATION FOR SMS KANNEL
#
# Modified by Donald Jackson based on the original smskannel.conf by
# Kalle Marjola for Kannel project 2001, 2004

#---------------------------------------------
# CORE
#
# There is only one core group and it sets all basic settings
# of the bearerbox (and system). You should take extra notes on
# configuration variables like 'store-file' (or 'store-dir'),
# 'admin-allow-ip' and 'access.log'


group = core
admin-port = 13000
smsbox-port = 13001
wapbox-port = 13002
admin-password = bar
#status-password = foo
#admin-deny-ip = ""
#admin-allow-ip = ""
#log-file = "/tmp/kannel.log"
#log-level = 0
box-allow-ip = "192.168.100.42"
#unified-prefix = "+358,00358,0;+,00"
#access-log = "/tmp/access.log"
#store-file = "kannel.store"
#ssl-server-cert-file = "cert.pem"
#ssl-server-key-file = "key.pem"
#ssl-certkey-file = "mycertandprivkeyfile.pem"

#---------------------------------------------
# SMSC CONNECTIONS
#
# SMSC connections are created in bearerbox and they handle SMSC specific
# protocol and message relying. You need these to actually receive and send
# messages to handset, but can use GSM modems as virtual SMSCs


# This is a fake smsc connection, _only_ used to test the system and services.
# It really cannot relay messages to actual handsets!

#group = smsc
#smsc = at
#smsc-id = n79
#port = 10000
#connect-allow-ip = 127.0.0.1
#

group = smsc
smsc = at
modemtype = auto
device=/dev/ttyACM0
##my-number = 8000770700
log-level = 1


group = modems
id = nokia
name = "Nokia N79"
speed = 115200
detect-string = "Nokia"
init-string = "ATZ"
init-string = "AT Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"





#---------------------------------------------
# SMSBOX SETUP
#
# Smsbox(es) do higher-level SMS handling after they have been received from
# SMS centers by bearerbox, or before they are given to bearerbox for delivery

group = smsbox
bearerbox-host = 192.168.100.42
sendsms-port = 13013
global-sender = 13013
#sendsms-chars = "0123456789 +-"
#log-file = "/tmp/smsbox.log"
#log-level = 0
#access-log = "/tmp/access.log"

#group = smsbox
#bearerbox-host = 127.0.0.1
#sendsms-port = 13013
#global-sender = 9998143131
#log-level = 0


#---------------------------------------------
# WAPBOX SETUP
#

group = wapbox
bearerbox-host = 127.0.0.1
#log-file = "/tmp/wapbox.log"
#log-level = 0
syslog-level = none
#access-log = "/tmp/wapaccess.log"

#---------------------------------------------
# SEND-SMS USERS
#
# These users are used when Kannel smsbox sendsms interface is used to
# send PUSH sms messages, i.e. calling URL like
# http://kannel.machine:13013/cgi-bin/sendsms?username=tester&password=foobar...

#group = sendsms-user
#username = tester
#password = foobar
#user-deny-ip = ""
#user-allow-ip = ""

#---------------------------------------------
# SERVICES
#
# These are 'responses' to sms PULL messages, i.e. messages arriving from
# handsets. The response is based on message content. Only one sms-service is
# applied, using the first one to match.

#group = sms-service
#keyword = nop
#text = "You asked nothing and I did it!"

# There should be always a 'default' service. This service is used when no
# other 'sms-service' is applied.

#group = sms-service
#keyword = default
#text = "No service specified"


group = sendsms-user
username = sanjay
password = sanjay
concatenation= true
max-messages = 10


group = sms-service
keyword-regex = .*
catch-all = yes
max-messages = 0
get-url = "http://localhost/sms?phone=%p&text=%a"