Centos 7 Kannel 1.4.5 and MariaDB 10.3 Install and Configure 2018 SEP
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 ghostscript transfig ImageMagick libxml2-devel bison-devel byacc texlive-collection-xetex -y
transfig error
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/transfig-3.2.5d-13.el7.x86_64.rpm
rpm -Uvh transfig
======================================================
Kannel do not work with bison 3 error (important)
Use this patch from
https://redmine.kannel.org/issues/699
https://redmine.kannel.org/attachments/327/gateway-1.4.5.patch.gz
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.)
rici@rici-hp:~/src$ tar xf gateway-1.4.5.tar.bz2
rici@rici-hp:~/src$ cd gateway-1.4.5
rici@rici-hp:~/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
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/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
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
ProtectHome=false
systemctl daemon-reload
systemctl restart mariadb
if innodb error
vi /etc/my.cnf (add)
innodb_log_file_size=48M
rpm -qa|grep MariaDB
MariaDB-compat-10.3.9-1.el7.centos.x86_64
MariaDB-client-10.3.9-1.el7.centos.x86_64
MariaDB-shared-10.3.9-1.el7.centos.x86_64
MariaDB-devel-10.3.9-1.el7.centos.x86_64
MariaDB-common-10.3.9-1.el7.centos.x86_64
MariaDB-server-10.3.9-1.el7.centos.x86_64
======================================================
(verify)
yum install openssl-devel
yum install libxml2-devel
yum install bison-devel
rpm -Uvh http://mirror.centos.org/altarch/7/os/aarch64/Packages/texlive-t2-svn29349.0-45.el7.noarch.rpm
http://mirror.centos.org/altarch/7/os/aarch64/Packages/texlive-changepage-svn15878.1.0c-45.el7.noarch.rpm
rpm -Uvh https://download-ib01.fedoraproject.org/pub/epel/7/aarch64/Packages/t/texlive-eskdx-svn29235.0.98-56.el7.noarch.rpm
rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/texlive-epsf-svn21461.2.7.4-45.el7.noarch.rpm
rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/texlive-ec-doc-svn25033.1.0-45.el7.noarch.rpm
yum 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
make
[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 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
Command
#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:-
https://drive.google.com/open?id=1zlepZ6aLnle8SWrg4fVA1nzXB3JE30up
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:-
http://127.0.0.1:13000/status?password=bar
To check if message is going through the kannel, hit the following url in your browser.
http://localhost:13013/cgi-bin/sendsms?smsc=NepalGov&user=tester&pass=foobar&from=1234&to=9851117234&text=Test+Kannel
http://localhost:13013/cgi-bin/sendsms?smsc=1234&user=tester&pass=foobar&from=1234&to=9851117234&text=Test+Kannel
smsc=your name defined in kannel.conf
$ curl ‘http://X.X.X.X:14000/status?password=mypass’
Following is the URL to send SMS via Kannel:
$ curl ‘http://X.X.X.X:14013/cgi-bin/sendsms?smsc=1111&username=testuser&password=mypass&to=XXXXXXXX&from=XXXXXXX&text=testmessage&dlr-mask=31’
Congrats you setup your kannel-sms-gateway
sqlbox
create database opmcm_sms;
grant all privileges on opmcm_sms.* TO ‘user’@’localhost’ identified by ‘PPPPP’;
flush privileges;
wget -c https://www.kannel.org/~aguerrieri/SqlBox/Releases/sqlbox-latest.tar.gz
tar -zxvf sqlbox-latest.tar.gz
cd sqlbox-0.7.2
vi bootstrap
(add line no 27 )
amvers=””
./bootstrap
vi gw/sqlbox-cfg.def
SINGLE_GROUP(sqlbox,
OCTSTR(id)
OCTSTR(smsbox-id)
OCTSTR(global-sender)
OCTSTR(bearerbox-host)
OCTSTR(smsbox-port)
OCTSTR(smsbox-port-ssl)
OCTSTR(sql-log-table)
OCTSTR(sql-insert-table)
OCTSTR(log-file)
OCTSTR(log-level)
OCTSTR(bearerbox-port)
OCTSTR(limit-per-cycle)
OCTSTR(save-mo)
OCTSTR(save-mt)
OCTSTR(save-dlr)
OCTSTR(ssl-client-certkey-file)
OCTSTR(ssl-server-cert-file)
OCTSTR(ssl-server-key-file)
OCTSTR(ssl-trusted-ca-file)
OCTSTR(ssl-client-cipher-list)
OCTSTR(ssl-server-cipher-list)
./configure –with-kannel-dir=/usr/local/kannel
make
make install
vi /etc/kannel/sqlbox.conf
#SQL BOX CONFIG
group = sqlbox
id = sqlbox-db
smsbox-id = sqlbox
global-sender = “1234” # change this to SIM number
bearerbox-host = localhost
bearerbox-port = 13001
smsbox-port = 13005
smsbox-port-ssl = false
sql-log-table = sent_sms
sql-insert-table = send_sms
log-level = 0
log-file = “/tmp/kannel-sqlbox.log”
group = mysql-connection
id = sqlbox-db
host = localhost
username = “user”
password = “XXXXXXX”
database = “db”
sqlbox -v 0 /etc/kannel/sqlbox.conf &
#!/bin/bash # Download file wget -O ~/start-stop-daemon.tar.gz http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz # Extract the directory mkdir ~/start-stop-daemon tar zxvf ~/start-stop-daemon.tar.gz -C ~/start-stop-daemon # Compile and move executable gcc ~/start-stop-daemon/apps/sys-utils/start-stop-daemon-IR1_9_18-2/start-stop-daemon.c -o ~/start-stop-daemon/start-stop-daemon cp ~/start-stop-daemon/start-stop-daemon /usr/sbin/ # Clean up rm -rf ~/start-stop-daemon rm -f ~/start-stop-daemon.tar.gz
<code>
vi /usr/bin/kannel.sh
#!/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/kannel/kannel.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
</code>
Kannel SMS Gateway Delivery Reports in mySQL via sqlbox
Howto configure your Local SMS HTTP Gateway using KANNEL on Ubuntu
https://github.com/pruiz/kannel-sqlbox
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.