SD SMS Master is an SMS-sending server that allows clients to send one-way SMS’s using multiple remote machines and their connected phones.
SD SMS Master consists of three parts:
- lib(rary) contains the logic.
- web contains web server scripts and is needed on the server.
- A WordPress plugin which can and should be used to configure and monitor the master.
SD SMS Master is free software, as per the License
How it works
The web server (master) contains the SMS Master itself. Clients (users) connect to the master and create orders. Orders contain a text to send and a list of numbers to send to.
The master then connects to remote machines (slaves) and distributes the order numbers (+text) to all enabled phones on the slaves.
The communication is one-way: incoming SMS’s are not read.
- SQL server (one)
- Web server (one – called the master)
- Shell on the web server for running cron.php.
- Slave (one+)
- SSH on both the master and slave(s)
- Phone that gnokii supports (one+ per slave)
The database abstraction layer (Doctrine) should work with most common database servers. Only mysql has been tested.
The phones should communicate via USB, in order to bypass BlueTooth weirdness.
Phones that work well are old SonyEricssons that have USB data/charge cables, for example the K550 or Z530.
Communication between the master and the slaves is acheived using SSH public keys.
For extra security, why not put the whole system on its own VPN?
Any old webserver with PHP + openssl + ssh support should work just fine. Only nginx has been tested.
Installation, although possible manually, is easiest accomplished by using the WordPress plugin, which can be found on the SD SMS Master site. This installation assumes that the plugin is installed and activated on some webserver that can reach the master’s web server.
Installation of the master
Create a database for the master.
Install the master files onto a web server. In the lib directory, download the lib files.
Copy config/config.dist.php to config/config.local.php and change whatever settings necessary. At a bare minimum the URL and database settings will need changing.
Start a shell on the server and run cron.sh, which loops running cron.php. The first time master is run it will create config/sms_master.public.key.php, which contains the master’s public key. We’ll need this key for the WordPress plugin. This file can be read by pointing your browser to
The master is now ready to be initialized and configured by the WordPress plugin.
Installation of WordPress plugin
Download and activate the plugin. Click on the plugin’s menu option and you will be presented with an option to have git automatically download the latest lib. If this does not work you will have to manually download and copy the SMS Master lib package into the plugin’s lib subdirectory.
Once the lib directory is ready, visiting the SD SMS Master menu in the admin panel will result in an error message. This is because neither the plugin nor the masters is yet configured.
Configuration is as follows:
- Visit the Tools submenu.
- Generate an SSH keypair.
- Visit the Settings submenu.
- Enter the URL to the server.
- Enter the masters’s public key.
- Enter this client’s private and public keys.
- Update the settings.
- Click on the Install to SMS Master button.
- Test the settings.
If all has gone well, the SMS Master should have taken the client’s public key and created a new administrator user. The Test button should reply with the current time.
After configuring a slave, you can use the menu items to add slaves and phones and then test them.
Debugging this procedure:
- Is the URL reachable?
- Have the tables in the SD SMS Master database been created?
- Has a user been created in the database?
Installation of a slave
A slave is nothing but a machine, with a gnokii phone, that the master connects to and uses to send the SMS’s. The only software necessary is an openssh-server and a configured gnokii.
Configuration is as follows:
- Create a user. The username
- Give the user access to
/dev/ttyACM*. Try adding the user to the
- Generate an SSH keypair for the user using
- Add the public key into the
.ssh/authorized_keysfile, so that the master can connect to this slave.
[global] model = AT port = /dev/ttyACM0 connection = serial
[phone_1] port = /dev/ttyACM0 model = AT connection = serial
The above config works for USB-connected SonyEricsson phones in ”phone mode”.
- Connect the phone.
- Check the phone connection:
su -l smsslave -c "gnokii --phone 1 --identify". You should see some text identifying the phone.
Configuration of the slave is complete. The master has to be configured with this new slave. I suggest using the WordPress plugin for that. Use the above settings and SSH keypair and press the
Identify slave button to test the connection.
After adding the slave to the master, add the phone. The above example shows that the phone index is 1.
- Have you edited the
- Does the master have a valid keypair in
- Is the cron.sh loop running?
- Are there any slaves?
- Have you identified the slaves?
- Do the slaves have any phones?
- Have you identified each phone?
- Do you see the phone in
- Have you created gnokii’s config file for the smsslave user?
- Can gnokii identify the phone?
- Can you send an SMS as the smsslave user?
- WordPress plugin
- Have you downloaded / copied the lib into the lib directory of the plugin? There’s a button for that, if your git works…
- Have you filled in the settings?
- Does a user exist in the database corresponding with your settings?
- Have you enabled the master from the overview?
You need to program the clients to talk to the master. Luckily, the SMS Master is well documented. Use doxygen to create the documentation in the
For examples of how to connect to a master and create orders and what not, see the WordPress plugin.
Some phone store incoming and outgoing messages which can fill up the message storage and cause sending errors. Cleaning / emptying deletes all stored SMS’s, optionally sending a report to any administrators.
- 1.0 2013-03-14
The github repository contains the three packages: lib, web and WordPress.
The project author welcomes translations.
SD SMS Master uses the following libraries:
The lib directory is licensed under the GPL, version 3.
Subdirectories are licensed under whatever is in the subdirectory.