How to install Kannel for playSMS in Ubuntu:
sudo apt install kannel sudo mkdir -p /var/log/kannel /var/run/kannel /var/spool/kannel/store sudo chown -R kannel /var/log/kannel /var/run/kannel /var/spool/kannel/store sudo usermod -a -G dialout kannel
/etc/default/kannel to activate smsbox, smsbox is part of Kannel, the daemon that handles SMS in Kannel:
sudo sed -i 's/#START_SMSBOX/START_SMSBOX/' /etc/default/kannel
I don’t need wapbox so I disable it:
sudo sed -i 's/START_WAPBOX/#START_WAPBOX/' /etc/default/kannel
sudo cp /etc/kannel/kannel.conf /etc/kannel/kannel.conf.dist
kannel.conf for testing purposes (for this article):
wget -c https://raw.githubusercontent.com/antonraharja/playSMS/master/contrib/kannel/kannel.conf sudo cp kannel.conf /etc/kannel/ ls -l /etc/kannel/
/etc/kannel/kannel.conf and change passwords, parts with CHANGE_THIS on the line.
/etc/init.d/kannel stop /etc/init.d/kannel start
I waited about 2-3 seconds after
start, I don’t use
kannel.conf for testing purposes pushed in github, here:
You can download and use it as your base and then modify it.
kannel.conf above as-is for your Kannel will provide 2 SMSC, smpp1 and smpp2.
Next, configure Kannel gateway plugin in playSMS
Go to Settings -> Manage gateway and SMSC and click Manage (the folder icon) on Gateway Kannel. Fill in with data form
If you see above on Bearerbox hostname or IP its an IP public, not
localhost, this is because my playSMS is using HTTPS and a domain name, its not accessible through
http://localhost. Therefore I need to set server’s IP address where requests from Kannel to playSMS logged as access from outside (read as remote IP with the same IP as the server accessing it self).
If you can access playSMS with
http://localhost then Bearerbox hostname or IP should be
On Operational tab, fill in the correct admin password or status password, sets in
You should see SMSC smpp1 and smpp2 are both online.
To route SMS to Kannel and those SMSC’s above you will need to add SMSC to playSMS, click the plus sign in Gateway Kannel in Settings -> Manage gateway and SMSC.
Add 2 SMSC to playSMS, first give name smpp1 and second give it name smpp2, example here:
Now we can route SMS for testing, go to Settings -> Route outgoing SMS:
See this article to give you understanding how playSMS handles gateway and SMSCs:
And perhaps googling you’ll find more example.