Centos 7 Kannel 1.4.5 and MariaDB 10.3 Install and Configure 2018 SEP

How to install kannel in centos 7

https://redmine.kannel.org/issues/778 (patch)

yum update
yum groupinstall 'Development tools' -y
yum install openssl-devel openjade jadetex docbook-style-dsssl texlive-dvips transfig ImageMagick libxml2-devel bison-devel byacc texlive-collection-xetex -y

Kannel do not work with bison 3 error (important)

Use this patch from


To apply the attached patch file, cd to the top of the kannel source tree, and gunzip -c the patch into patch -p1. (The following examples assumes that you are starting from the kannel distribution file.)

[email protected]:~/src$ tar xf gateway-1.4.5.tar.bz2
[email protected]:~/src$ cd gateway-1.4.5
[email protected]:~/src/gateway-1.4.5$ gunzip -c ../gateway-1.4.5.patch.gz | patch -p1
patching file wmlscript/wsgram.y
patching file wmlscript/wsint.h
patching file wmlscript/wslexer.c

You can then ./configure, make and make install as usual.


or install bison version 2.7 as in http://geeksww.com/tutorials/miscellaneous/bison_gnu_parser_generator/installation/installing_bison_gnu_parser_generator_ubuntu_linux.php
Remember to redo the unzipping of the files and configure again.

cd /root
wget http://ftp.gnu.org/gnu/bison/bison-2.7.tar.gz
tar -xvzf bison-2.7.tar.gz
cd bison-2.7
./configure --prefix=/usr/local/bison --with-libiconv-prefix=/usr/local/libiconv/
make install

vi /etc/yum.repos.d/MariaDB10.repo
# MariaDB 10.3 CentOS repository list – created 2018-09-10 19:28 UTC
# http://downloads.mariadb.org/mariadb/repositories/
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64

yum remove -y MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared MariaDB-compat MariaDB-common
vi /etc/yum.repos.d/MariaDB10.repo
rm -rf /var/cache/yum/x86_64/7/mariadb/
yum update
yum install -y MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared MariaDB-compat MariaDB-common
vi /usr/lib/systemd/system/mariadb.service
systemctl daemon-reload
systemctl restart mariadb

if innodb error
vi /etc/my.cnf (add)

rpm -qa|grep MariaDB


yum install openssl-devel
yum install libxml2-devel
yum install bison-devel
yum install install texlive-*

vi /usr/share/texlive/texmf/web2c/texmf.cnf
hash_extra.jadetex = 15000
hash_extra.pdfjadetex = 15000
pool_size.jadetex = 500000
pool_size.pdfjadetex = 500000
string_vacancies.jadetex = 45000
string_vacancies.pdfjadetex = 45000
max_strings.jadetex = 55000
max_strings.pdfjadetex = 55000
pool_free.jadetex = 47500
pool_free.pdfjadetex = 47500
nest_size.jadetex = 500
nest_size.pdfjadetex = 500
param_size.jadetex = 1500
param_size.pdfjadetex = 1500
save_size.jadetex = 5000
save_size.pdfjadetex = 5000
stack_size.jadetex = 1500
stack_size.pdfjadetex = 1500

cd /root
wget -c https://redmine.kannel.org/attachments/download/322/gateway-1.4.5.tar.gz –no-check-certificate
tar -zxvf gateway-1.4.5.tar.gz
cd gateway-1.4.5
wget https://redmine.kannel.org/attachments/download/317/kannel-mariadb.patch –no-check-certificate
patch < kannel-mariadb.patch

any one option you required
./configure –with-mysql –disable-wap
./configure –prefix=/usr/local/kannel –with-mysql –disable-wap
./configure –prefix=/usr/local/kannel –with-mysql –with-mysql-dir=lib64 –disable-wap
./configure –prefix=/usr/local/kannel –with-mysql –with-mysql-dir=/usr/include/mysql –disable-wap


[After make command if you get Latex error like:
File ‘ulem.sty’ not found ]

To fix this error type the following command:-
yum install ‘tex(ulem.sty)’
yum install ‘tex(mlnames.sty)’

if other font error

yum install install texlive-*

chmod 0755 gw-config
make install

//Congrats your kannel 1.4.5 has been installed in the following directory (/usr/local/sbin)

Now make directory on /etc
#cd /etc
#mkdir kannel

Then Go to kannel directory
# cd /etc/kannel
Then create a kannel.conf file

Download the kannel.conf file from the link below:-


To start the kannel run the following command as follows:-

# /usr/local/sbin/bearerbox -v 0 /etc/kannel/kannel.conf
# /usr/local/sbin/smsbox -v 0 /etc/kannel/kannel.conf

firewall-cmd --permanent --zone=public --add-port=13000/tcp 
firewall-cmd --permanent --zone=public --add-port=13013/tcp 

To check if the kannel is running or not type the following command on your browser:-

To check if message is going through the kannel, hit the following url in your browser.


smsc=your name defined in kannel.conf

Congrats you setup your kannel-sms-gateway


vi /usr/bin/kannel.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
START=”/usr/sbin/start-stop-daemon –start –background –quiet –exec”
STOP=”/usr/sbin/start-stop-daemon –stop –quiet –oknodo –exec”
[ $# -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


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


Kannel SMS Gateway Delivery Reports in mySQL via sqlbox

Howto configure your Local SMS HTTP Gateway using KANNEL on Ubuntu


Sending Unicode SMS via Kannel


Being in Enterprise Messaging Business, we always have one common question in mind. How do I calculate throughput / TPS of my SMS/smpp application?

TPS (Throughput Per Second) is one of a very important aspect for any Enterprise Messaging Entity. Having high TPS is always desirable, however, many times we tend to make a mistake while calculating inbound and outbound TPS of our system.

Here I have shown an example explaining how TPS is exactly calculated for any smpp application in real scenario.

Mainly there are 3 parameters which define your overall throughput per sec / TPS.

1. Latency (in milliseconds): 

Round-trip delay time – the one-way time from the source (SMPP Client / ESME) sending a packet to the destination (SMPP Server / SMSC) receiving it plus the one-way time from the destination (SMPP Server / SMSC) sending a packet back to the source (SMPP Client / ESME) receiving it, including the amount of time that a destination system (SMPP Server / ESME) spent in processing the packet to SMSC.

2. Window Size: 

(is relevant for Asynchronous protocols (such as SMPP) and defines the max allowed number of unacknowledged operations).

3. Number of Sessions: 

In order to make use of the SMPP Protocol, a SMPP session must be established between the ESME and Message Centre or SMPP Routing Entity.

Let’s understand the flow of SMS again.

Step1: SMPP Client (ESME) sends out SMS traffic to an SMPP Server (SMSC).

Step2: SMS Application supplies SMS to the SMPP Client

Step3: SMPP Client sends out the SMS traffic with the help of SMPP Protocol (TCP / IP) via biding TCP/SMPP sessions connecting to SMPP Server

Here is a mathematical formula to design your application TPS:

TPS = Window Size * Number of Sessions / Latency 

Setting up following parameters will be able to generate a TPS of 500 SMS / Second.

Window Size = 10

Number of Sessions = 5

Latency = 100 milliseconds (0.1 seconds)

TPS = 10 * 5 / 0.1 = 500 SMS / Second 

According to individual needs, TPS can be set and monitored.