is an Open Source Gateway use to convert WAP and SMPP to HTTP. Here I'm not going to talk about Kannel but going to talk about how to do proper installation of Kannel in Linux.
You can download source of Kannel latest stable version 1.4.3 (though it released in 2009) from here.
Before install kannel you must check whether you have installed libxml in your server/PC. If not you must install it before installing Kannel. (Download libxml)
Now you good to go......
Installation
- First we must install the libxml. To do that you can do the following steps.....
- Go to where your downloaded libxml tar.gz file located
- tar -zxvf libxml2-2....tar.gz
- Go in to extracted libxml2 folder
- ./configure --prefix=/usr --disable-static --with-history
- make
- make install
- Now it's time to install Kannel
- Go to where your downloaded kannel tar.gz file located
- tar -zxvf kannel....tar.gz
- Go in to extracted kannel folder
- ./configure --enable-start-stop-daemon --prefix=/usr/kannel
- make
- make install
- All your installation files of kannel will be located in /usr/kannel
- Now installation is success. But still remain the worse part. Configuration!!!
Configuration
- Make a file named "kannel.conf"(any name for kannel)
- Edit it as follow, change the configurations as suitable for your SMSC connections.
# 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 = 13003
admin-password = "Your password"
status-password = "Your password"
admin-deny-ip = "*.*.*.*"
admin-allow-ip = "127.0.0.1"
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
#This path can be change as you wish. But for the logs containing folder must have write permission
log-file = "/var/log/smsgw/kannel.log"
log-level = 0
access-log = "/var/log/smsgw/kannel.access"
#---------------------------------------------
# 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
#Outgoing SMS
group = smsc
smsc = smpp
host = "Host of your SMSC"
port = "Port open from SMSC side"
transceiver-mode = true
smsc-username = "SMSC User Name"
smsc-password = SmscPassword
smsc-id = IdOfYourSMSC
system-type = ""
# SMSBOX SETUP
# This will handle the sending messages from application to SMSC
group = smsbox
bearerbox-host = localhost
sendsms-port = 17013
sendsms-url = /cgi-bin/sendsms
sendota-url = /cgi-bin/sendota
sendsms-chars = "0123456789 +-"
log-file = "/var/log/smsgw/kannel.log"
log-level = 0
access-log = "/var/log/smsgw/kannel.access"
group = sms-service
keyword = nop
text = "You asked nothing and I did it!"
# SERVICES
group = sms-service
keyword = default
#get-url is the application url that receiving messages
get-url = "http://localhost/path/to/your/app?phone_no=%p&msg=%a"
omit-empty = 1
max-messages = 0
Now you must create a start-up script to start installed kannel.
Following script will give you an idea to create your own script.You must have little bit knowledge of shell to understand that.But it isn't must.
Normally You can locate the files that you need for use start-up script will locate in you kannel installation path's sbin folder.
(As per my installation "/usr/kannel")
#!/bin/sh
# Use start-stop-kannel
prog="/usr/kannel/sbin/start-stop-kannel"
args="--start --background --chuid kannel:kannel --exec "
config="/etc/kannel.conf"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ -f $config ] || exit 1
KPATH = "/usr/kannel/sbin"
RETVAL=0
RETVAL_BEARER=0
RETVAL_SMS=0
start() {
# Start daemons.
echo -n "Starting kannel bearer box: "
daemon $prog $args $KPATH/bearerbox $config
RETVAL_BEARER=$?
echo
# It seems like the bearerbox may need to settle before accepting
# connections from wapbox and smsbox
sleep 3s
# Starting wap and sms only makes sense if bearerbox is running
if [ $RETVAL_BEARER -eq 0 ]; then
if grep "^group = smsbox" $config &>/dev/null; then
echo -n "Starting kannel sms box: "
daemon $prog $args $KPATH/smsbox $config
RETVAL_SMS=$?
echo
fi
fi
[ $RETVAL_BEARER -eq 0 -a $RETVAL_SMS -eq 0 ] \
&& touch /var/lock/subsys/kannel || RETVAL=1
}
stop() {
# Stop daemons.
if grep "^group = smsbox" $config &>/dev/null; then
echo -n "Shutting down kannel sms box: "
killproc $KPATH/smsbox
RETVAL_SMS=$?
echo
fi
echo -n "Shutting down kannel bearer box: "
killproc $KPATH/bearerbox
RETVAL_BEARER=$?
echo
[ $RETVAL_BEARER -eq 0 -a $RETVAL_SMS -eq 0 ] \
|| RETVAL=1
rm -f /var/lock/subsys/kannel
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $KPATH/bearerbox
RETVAL_BEARER=$?
if grep "^group = smsbox" $config &>/dev/null; then
status $KPATH/smsbox
RETVAL_SMS=$?
fi
[ $RETVAL_BEARER -eq 0 -a $RETVAL_SMS -eq 0 ] \
|| RETVAL=1
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
Hi, An SMPP SMS Gateway or Software is basically a industry standard, open protocol specifically designed for offering a platform that makes way for flexible data communication.
ReplyDelete