SMS Server Tools

SM initiated SQL queries

You can find an demo script in examples/sql_demo. This script will not be installed when you run "make install".

The demo shows you how to execute SQL queries by short messages using a mobile phone.

mysql> select * from demo;
+--------------+----------+--------+
| msisdn       | password | amount |
+--------------+----------+--------+
| 491722056395 | hell     |    812 |
| 491721234567 | cat      |    300 |
| 491722056395 | dog      |     43 |
+--------------+----------+--------+

This database stores the passwords an accounts of customers from a bank. As you can see one customer has two accounts but different passwords. This is not problem, the customer can query both.

1) The customer sends an SM to your server that contains only his password.
2) Smsd receives the SM and executes the demo script.
3) The demo script reads the SMS file and executes an SQL query to get the amount.
4) Then the script creates an answer SM.
5) Smsd send the answer back to the customer.

Note: This example may be unsecure. I tried to give you an easy example and I did not spend much time to make it secure and stable.