julmajanne.com

Kannel Installation Guide

There are binary packages available for debian and fedora at Kannel's site if you do not wish to compile it from source code.

Notes: I'm using Nokia 5100 or iTegno WM1080A ( wacom ) and USB cable with a charger.

Download Kannels source code and unpack it into some directory ( ex /usr/local/src ) and compile it.

# cd /usr/local/src
# tar -xzvf ~/gateway-1.4.1.tar.gz
# cd gateway-1.4.1/
# ./configure --prefix=/usr/local/kannel --enable-start-stop-daemon
Configure...
# make >& make.log &
# tail -f make.log
<all kinds of code is running on your screen at this point...>

# make install >& install.log &
# tail -f install.log

Kannel Gateway Configuration

# CORE
group = core
admin-port = 13000
admin-password = yourpassword
status-password = yourpassword
log-file = "/var/log/kannel/kannel.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
wapbox-port = 13002
smsbox-port = 13001
store-file = "/var/log/kannel/kannel.store"


# SMSC Fake
group = smsc
smsc = at
modemtype = auto
device = /dev/ttyUSB0
speed = 57600
pin = 0000
#host = localhost
#port = 13013


# MODEM DEFINITIONS
group = modems
id = nokia
name = "Nokia"
detect-string = "Nokia"


# SMSBOX SETUP
group = smsbox
bearerbox-host = localhost
sendsms-port = 13014
sendsms-chars = "0123456789+"
global-sender = "+358401234567"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"


# SEND-SMS USERS
group = sendsms-user
username = youruser
password = yourpassword
concatenation = 1
max-messages = 10


# SMS SERVICE 'default'
group = sms-service
keyword = nop
text = "You asked nothing and I did it!"
catch-all = true # Catch all incoming messages
# regarding the keyword. If you
# define other services, remove
# this line.


# SMS SERVICE for receiving sms messages
# If you're about to implement service to receive sms messages.
# group = sms-service
# keyword = yourkeyword
# get-url = http://server.domain/moodle/receivesms.php?q=%k&sender=%p&message=%a

Create a startup script ( this example is for Fedora Core ) in your /etc/init.d/ directory:

#!/bin/sh
#
# gateway This shell script takes care of starting and stopping
# the Kannel WAP gateway (bearer/wapbox)
#
# chkconfig: 2345 97 03
# description: Start and stop the Kannel WAP gateway used to fetch \
# some WML content from a Web server & compile it \
# into WMLC mobile phone bytecode.
# probe: true

# Use start-stop-daemon
ver=1.40
BBOX=/usr/local/sbin/bearerbox
SBOX=/usr/local/sbin/smsbox
START="/usr/sbin/start-stop-daemon --start --background --quiet --exec"
STOP="/usr/sbin/start-stop-daemon --stop --quiet --oknodo --exec"
CONF=/etc/smskannel.conf
[ $# -eq 2 ] && ver=$2

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -x $BBOX ] || exit 0

[ -x $SBOX ] || exit 0

[ -f $CONF ] || exit 0


RETVAL=0

# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting bearer service (gateway kannel $ver): "
$START $BBOX -- $CONF
RETVAL1=$?
sleep 1 # Sleep for a while before we try to start smsbox
echo
echo -n "Starting smsbox service (gateway kannel $ver): "
$START $SBOX -- $CONF
RETVAL2=$?
echo
echo
[ $RETVAL1 -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/gateway ||\
RETVAL=1
;;
stop)
# Stop daemons.
echo -n "Shutting down smsbox (kannel $ver): "
$STOP $SBOX
RETVAL2=$?
echo
echo -n "Shutting down bearerbox (kannel $ver): "
$STOP $BBOX
RETVAL1=$?
echo
[ $RETVAL1 -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/gateway
echo ""
;;
status)
status bearerbox
status smsbox
exit $?
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: named {start|stop|status|restart}"
exit 1
esac
exit $RETVAL

Plug your mobilephone into your computers USB port and start kannel. Check your /var/log/kannel/kannel.log. If you can find several AT command lines and line where it says AT SMSC successfully opened. Then all is fine.