Headwind SMS software products

About | Contact us

 
 

Integrate SMS server into the website

With Headwind GSM Modem Driver you can either send SMS from the website (for example, through a SMS sending form) or process received SMS on the website (for example, by writing SMS messages in a guest book).

To add SMS capability to the web portal, you need to setup a Windows-based SMS server connected with one or several GSM devices, where Headwind GSM Modem Driver is installed. The SMS server interacts with the web server through the HTTP protocol.

Sending SMS from the website

Sending SMS from the website

  • The table of a database is created, where the outgoing SMS are stored. Each message is identified by the text, the recipient phone number, and the sender phone number (not necessary if only one GSM device is used). The MySQL command for the creation of the table looks as follows.
    CREATE TABLE outbox(sender VARCHAR(255), rcpt VARCHAR(255), body VARCHAR(255));
  • The script for sending SMS writes the messages in that table. The example of such script is below.
  • The script "SMS source" is placed on the website. The URL of this script is downloaded by Headwind GSM Modem Driver once per several seconds. This script returns messages posted to the outbox table. The name of the script is smssource.php.
  • The SMS source "URL" needs to be setup in the program "Headwind GSM Modem Driver".
    • Open the control panel of Headwind GSM Modem Driver by double click, select the "Sources" tab and click "Add".
    • Select the type "URL" and click "OK".
    • Type http://your.host.com/smssource.php in the "Location" field (replace your.host.com to your domain name). Type the period of SMS source calling in seconds (60 seconds by default). To debug the SMS source, you can set a checkbox "View output in log". Click "OK".

Processing of received SMS on the website

Processing of received SMS on the website

  • The table of a database is created, where a special script stores the incoming SMS. Each message is identified by the text, the sender phone number, and the recipient phone number (not necessary if only one GSM device is used). The MySQL command for the creation of the table looks as follows.
    CREATE TABLE inbox(sender VARCHAR(255), rcpt VARCHAR(255), body VARCHAR(255));
  • The messages are stored in this table by the script downloaded by Headwind GSM Modem Driver when a SMS is received. The example of the script is below. The name of the script is smshandler.php.
  • The SMS handler "URL" needs to be setup in the program "Headwind GSM Modem Driver".
    • Open the control panel of Headwind GSM Modem Driver by double click, select the "Handlers" tab and click "Add".
    • Select the type "URL", event "Receive". To debug the SMS handler, you can set the checkbox "View output in log".
    • Type http://your.host.com/smshandler.php?from=_FROM_&body=_BODY_ in the "Location" field (replace your.host.com to your domain name). The template _FROM_ will be replaced by the sender phone number, and the template _BODY_ will be replaced by the message text. Click "OK".

You can download the scripts described in this manual here.