Overview:

    * This C++ sample code will allow a user to send an sms message from a cell phone to the iSMS device and the iSMS device will send it to the Apache Web Server via IP. The Apache Web Server will then call the C++ script to write the incoming sms message to a text file on the local hard drive.

Prerequisite:

    * Download and Install Visual C++ 2008 Express Edition at http://www.microsoft.com/express/Downloads/
    * Download and Install Apache Web Server httpd-2.2.15-win32-x86-no_ssl.msi at http://httpd.apache.org/download.cgi
    * Download the C++ sample source code iSMSSendAndReceive-Cplusplus.zip here

Modify the httpd.conf:

1. Find the 1st section:

Options +FollowSymLinks

Add +ExecCGI. So it looks like this:

Options +FollowSymLinks +ExecCGI

2. Find the second section:

Options Indexes FollowSymLinks

Edit it so it looks like: (add +ExecCGI)

Options Indexes FollowSymLinks +ExecCGI

3. Find the line:

#AddHandler cgi-script .cgi

Uncommented it. So, it should look like this:

AddHandler cgi-script .cgi

4. Save it and restart the Web Server.

Compiling the ismsResponse.cpp:

a. Go to folder ismsResponse and load the ismsResponse.sln into your Visual C++ 2008 Express Edition IDE, open up ismsResponse.cpp file and select Build -> Rebuild Solution. This will rebuild and create an .exe file in the Debug folder.

b. Go to the Debug folder and copy the ismsResponse.exe to your Apache /htdocs folder.

c. Go to the command prompt and cd to your Apache /htdocs folder and rename the ismsResponse.exe to ismsResponse.cgi by typing:

rename ismsResponse.exe ismsResponse.cgi

iSMS device setup:

    * Go to your SMS finder -> SMS Service -> SMS API:
    * HTTP API status: Checked.
    * HTTP port: 81.
    * Click on Save Button.
    * None polling Receive API status: Checked.
    * Protocol: HTTP.
    * Click on Save Button.
    * Server: xxx.xxx.xxx.xxx (Enter your Web server IP address here)
    * Port: 80.
    * Click on Save Button.
    * Server Default Page: ismsResponse.cgi
    * Click on Save Button.

Notes:

    * If you send an sms message from your cell phone to the iSMS device, the iSMS device will send that sms message to the Web Server and Web Server will call the ismsResponse.cgi to write the message to a text file named – receive.log.
    * ismsSend.html is an html form that allows you to send the sms message from your web browser.
    * You must also modify the ismsSend.cpp to point to your iSMS device before you can send the sms message to iSMS device via Web browser.

Modify and Compiling the ismsSend.cpp:

a. Go to folder ismsSend and load the ismsSend.sln into your Visual C++ 2008 Express Edition IDE, open up ismsSend.cpp file, find the line below and modify it so that it will points at your iSMS device and change the user name and password to match yours.

string url = "http://172.17.29.233:81/sendmsg?user=admin&passwd=admin&cat=1";

b. Save it.

c. Select Build -> Rebuild Solution. This will rebuild and create an .exe file in the Debug folder.

d. Go to the Debug folder and copy the ismsSend.exe to your Apache /htdocs folder.

e. Go to the command prompt and cd to your Apache /htdocs folder and rename the ismsSend.exe to ismsSend.cgi by typing:

rename ismsSend.exe ismsSend.cgi

Now, you should be able to send a SMS message to your iSMS device through the Web browser. Bring up your web browser (IE or FireFox) and go to http://localhost/ismsSend.html. You will get a Send Message Form.