If you need to install openSMPP please have a look on “Install Kannel Addons”
OpenSMpp is Kannel addon; used to allow smpp clients to connect to kannel gateway and send SMS over SMPP protocol.
following are the steps for configuring openSMPP with mysql as storage of DLR.
Create a Mysql Database if you don’t have already one.
CREATE DATABASE `kannel` /*!40100 DEFAULT CHARACTER SET utf8 */;
Create table for dlr storage
USE `kannel`; CREATE TABLE `dlr1` ( `id` int(16) unsigned NOT NULL auto_increment, `smsc` varchar(64) default NULL, `boxc_id` varchar(16) default NULL, `ts` varchar(32) default NULL, `source` varchar(32) default NULL, `destination` varchar(32) default NULL, `service` varchar(16) default NULL, `url` varchar(2048) default NULL, `mask` varchar(4) default NULL, `status` varchar(8) default NULL, `timestamp` varchar(40) default NULL, `changed` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, KEY `id` (`id`), KEY `dlr_index` (`smsc`,`timestamp`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
grant some user access rights to above created table.
GRANT SELECT, INSERT, UPDATE, DELETE ON dlr1 TO 'opensmppbox'@'127.0.0.1' IDENTIFIED BY 'myPassword';
Now we need to create config file of opensmpp, lets call it “smpp.conf”
use your favrout editor, mine is nano,
nano /usr/local/kannel/smpp.conf
and paste the following in file. You need to change things according to your needs.
group = core dlr-storage = mysql ################################### group = mysql-connection id = dlr-db host = 127.0.0.1 username = opensmppbox password = "myPassword" database = kannel max-connections = 20 ################################### group = dlr-db id = dlr-db table = dlr1 field-smsc = smsc field-timestamp = ts field-destination = destination field-source = source field-service = service field-url = url field-mask = mask field-status = status field-boxc-id = boxc_id ################################### group = opensmppbox opensmppbox-id = smppbox1 opensmppbox-port = 8980 bearerbox-host = 127.0.0.1 bearerbox-port = 13002 log-level = 0 log-file = /var/log/kannel/opensmppbox.log our-system-id = fdi #route-to-smsc = hdroaming use-systemid-as-smsboxid = 1 smpp-logins = "/usr/local/kannel/clients.txt"
Please pay Attention to above Conf, and see the 2 highlighted lines.
bearerbox-port = 13002 (this should be the port of your SMSbox)
smpp-logins = “/usr/local/kannel/clients.txt”
this is plain text file from where the openSMPP do the authentication. here is the example clients.txt
goodclient secret remote*.*.*.* franchise ourpassword localbox 127.0.0.1;213.110.120.33
The first line defines a username (“goodclient”), a password (“secret”) and an smsbox-id (“remote”).People can log into this account, originating from any ip address.
The second line defines also a username (“franchise”), password(“ourpassword”) and an smsbox-id (“localbox”), but besides that there is a restriction on that user. It can only bind from the ip addresses 127.0.0.1 and 213.110.120.33. If ipaddress(es) is/are given, then only those ip addresses are allowed to connect. It works exactly like connect-allow-ip and connect-deny-ip in Kannel.conf. In that case, connect-deny-ip has a mask of “*.*.*.*”.
The third token in de smpp-logins file is the foreign system-type and is important in terms of Kannel’s sms routing rules. It is used as smsbox-id when connecting to bearerbox. This means that messages sent via that system-type will get corresponding dlr’s back. This also counts for MO messages. Also group =smsbox-route in Kannel.conf “listens” to this value. For this reason, it is important to use a different system-type for each different client unless they should receive each others’ messages. In caseuse-systemid-as-smsboxid = true, then in stead of system-type, system-id will be used as this”smsbox-id” value.
Hello, I have an enquiry. I’d like to know how the sending of messages with kannel and sqlbox (MySQL) works.
My specific problem is that I don’t know how it works. Should I insert a record in the DB so it sends the message, or should I send the sms from the /cgi-bin/sendsms web so it saves it in the DB?
Currently, none of those options is working.
Thanks.
you need to breakdown things to see why things are not working
the /cgi-bin/sendsms is core kannel send sms commad,
kannel configuration has three parts: bearerbox , smsbox and wapbox configurations (ignore the wapbox for now)
To understand the architecture of kannel see this image (i just grabbed it from google)
the first thing you need to do is to make /cgi-bin/sendsms command work. if this works this means that you have configured kannel core properly.
now Sqlbox, sqlbox is yet another SMSbox, you insert data in send_sms table of sqlbox, sqlbox handes over message to bearerbox and bearerbox pass it to some SMSC, if Sqlbox is successful in handing over message to bearerbox, it moves data from send_sms to sent_sms,
I will strongly recommend send email to “users [at] kannel.org” with your kannel conf file, and there good friends who always help.
regarding your question
Should I insert a record in the DB so it sends the message, or should I send the sms from the /cgi-bin/sendsms web so it saves it in the DB?
simple answer is , both are good for different scenarios, and both should work. if you need to send buld message like 100,000 with same text use sqlbox and insert all message in send_sms, sqlbox is good for one message even.
I hope this answers your question.
Thanks for your help!
Daniel.
not receiving dlr form opensmpp