Wednesday, 28 November 2012

How to configure your Local HTTP Gateway using KANNEL on Ubuntu

 Howto configure your Local HTTP Gateway using KANNEL on Ubuntu

As per web defines: Kannel (http://www.kannel.org/) is one of the most popular open source WAP/SMS Gateway, because its very good performance to handle a huge SMS. Kannel supports many modem's brand even generic modem, also support multi modems (modem bank).
x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x
After some testing, I have found Kannel one of the best , fastest SMS and WAP gateway among other open source sms gateways , capable of handling several hundreds of requests per second". "
Following is a guide on how you can configure your own Local SMS HTTP gateway using KANNEL
(The aim of configuring kannel on my Ubuntu box was that I required it to send sms via DMASOFTLAB RADIUS MANAGER which uses API to send sms via clickatell HTTP gateway for New Account / Expiry Warning / Password recovery via sms , verification code and many other cool functions. It comes with the clickatell HTTP gateway API which off course require you to buy sms bundle package and do require handsome amount of $$ if you have a huge number of users, Therefore to save $$ money , I  created my own gateway)
O/S = Ubuntu 10.4
Hardware = Teltonika ModemUSB/E12 UM1400
First install KANNEL using apt-get (the easiest one ;) )
apt-get install libxml2
apt-get install kannel
NOTE:
Kannel works great with the Linux base distribution BUT there are some workarounds to make it run on Windows. Do some googling and you will find few links for it.
Now open the kannel config file by
nano /etc/kannel/kannel.conf
Remove all the lines and paste the following config
# Syed Jahanzaib
# http://aacable.wordpress.com
# aacable [at] hotmail.com
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = zaibadmin
status-password = zaibstatus
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
group = smsc
smsc = at
modemtype = teltonika
device = /dev/ttyACM0 # change this to match your port, it could ACM1 , if you dont set it correctly,  it will not work and you will get error in logs that unable to connect to device, Jahanzaib)
speed = 19200
my-number = 0333302100000 # (put your sim number, not necessary)
group = modems
id = teltonika
name = "Teltonika e12"
detect-string = "Undefined"
enable-mms = true
init-string = "AT+CNMI=2,2,0,1,1"
speed = 115200
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"
group = sendsms-user
username = kannel
password = kannel
concatenation = true
max-messages = 3
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
Open two terminal windows and issue below commands in each terminal box
1. Start the BearerBox
bearerbox -v 0 /etc/kannel/kannel.conf
2. Start the SMSBox
smsbox -v 0 /etc/kannel/kannel.conf
[If you receive error that the address is already in use, first issue the command service kannel stop]
.
Now From your browse, type the following to make sure kannel is working fine :)
http://101.11.11.250:13000/status?password=zaibstatus
[change the ip and password to match your config]
and you may see the following screen , if your config is ok
http://aacable.files.wordpress.com/2012/11/kannel-status.png&h=209
.
.
Howto send SMS via http command
Open your browser and paste the following command.
http://101.11.11.250:13013/cgi-bin/sendsms?username=kannel&password=kannel&to=03333021909&text=ZAIB+KANNEL+WORK
Change the IP / ID + Password = and number to match your local configuration.
The result would be similar to the following . . .
http://aacable.files.wordpress.com/2012/11/kannel-test-ok-send-sms.png&h=169
& You will receive the sms on the target number very soon.
.
Regard's
Syed Jahanzaib










































No comments:

Post a Comment