How to install and send SMS using Kannel on Centos 7
Installing kannel
Before we install kannel, let’s start by installing the dependencies.
$ sudo yum update
$ sudo yum groupinstall "Development tools" -y
$ sudo yum install libxml2-devel
Note, Kannel do not work with bison 3 very important.
So check the version of bison on your system if its bison 3 then you need to downgrade to bison 2.7
If you need to install bision 2.7 you can use the link http://geeksww.com/tutorials/miscellaneous/bison_gnu_parser_generator/in stallation/installing_bison_gnu_parser_generator_ubuntu_linux.php
Now download and extract kannel gateway:
$ cd /usr/local/src/
$ sudo wget http://www.kannel.org/download/1.4.4/gateway-1.4.4.tar.gz
$ sudo tar -zxvf gateway-1.4.4.tar.gz
After extracting the file, navigate to the directory
$ cd /usr/local/src/gateway-1.4.4
$ sudo ./configure
$ sudo make
$ sudo make install
The kannel will be installed in the following directory (/usr/local/sbin)
Now we need to create a path for our config file
$ sudo mkdir /etc/kannel
$ cd /etc/kannel
$ sudo touch kannel.conf
Download default kannel.conf file from below link and replace the one you created in /etc/kannel/kannel.conf
https://drive.google.com/open?id=1zlepZ6aLnle8SWrg4fVA1nzXB3JE30up
In the kannel.conf file edit the smscid,host,port,smsc-username and smsc-password as provided by your smpp.
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
You can verify kannel is running by calling the url
http://127.0.0.1:13000/status?password=bar
To send sms through the kannel, hit the following URL in your browser.
Note: replace receiver-phone with the phone number that will receive the SMS.