Our SMS Gateway
For a while, John and I have been discussing an SMS to MessageBoard gateway. You can find out what John wrote about it in his article. However, I thought I'd also put a little page together to illustrate the somewhat gash process further. You can find the everything you need to set this up yourself here, including where to get all the supporting software.

John and I spent just a couple of hours hashing together a few bits of software with a little Visual Basic Script (vbs). John has worked with this far more than I have, so I let him drive and mainly pointed out where he'd made typos. Occasionally, I even added a bit to the process with an idea or two.

The software used for each stage is as follows:

Gnokii
This forms our interface to the phone. It can get and send data via command line.
Cygwin
Gnokii is a Un*x port, and requires at least the cygwin DLL's.
Coalesys HTTP Client Library
We call this DLL to perform the HTTP POST to the board. There were no other reasons for choosing this library other than the cost (free!) and that me found it in a google search.
WinCron
Originally, we were planning to use the built in Windows scheduler, but this isn't really up to running something every x minutes. We'd recommend WinCron instead.
sms2mds.vbs
This is the script that John and I worked on. I can't say "wrote" in all honesty, most of it come together from searching on Google and MSDN newsgroups. Well. Ok, so there was an ounce or two of originality here and there.

The process that the system follows for each message is as shown here:



                                           delete sms
                              +-----------------------------------------+
                              |                                         |
                              |                                         |
                              \/                                        |
    +-----------+       +-----------+        +-----------+        +-----------+
    |           |       |   8210    |        |   temp    |        |    HTTP   |
    |  sms_msg  | ----> |  Sim Card | -----> |  message  | -----> |  POST to  |
    |           |       |   memory  | getsms |   file    | script |   Maison  |
    +-----------+       +-----------+        +-----------+   /\   +-----------+
                              |                              |
                              |                              |
                              |                              |
                              |                         +-----------+
                              |                         | name and  |
                              +-----------------------> |  number   |
                                      download          | database  |
                                                        +-----------+

As John put it in his article:
We knocked up a visual basic script that is ran on a regular basis. When the script runs, it uses the rather good gnokii to connect to the phone over the serial cable, retrieve all the SMS messages and write them into a file. Our script then parses this file, extracting the index, date/time, sender's number and the message's actual text. We also use gnokii to generate a text file of the phone's phonebook. So then, we do a lookup on the sender's number and turn it into a readable name. With all the information now assembled, we log it locally just to be on the safe side, and then use an ActiveX control to do an HTTP post to the normal message board perl script. Finally the script uses the index number we extracted to delete the message from the phone's SIM card and it's all done. Robert is, indeed, your aunty's live-in lover.
To build your own you'll need the following hardware:

  • Spare Nokia phone with charger.
  • Spare SIM Card. A pay-as-you-talk with no credit left will be fine.
  • A suitable data-cable for your phone. You could probably try searching ebay. I got our cable for £4.99 as a guide.

    You really have to be willing to forget about the phone and SIM card and leave it on.

    Warning! Recycled SIM cards could be the cause of embarrasment. Someone you didn't bank on may text your message board!

    You'll also need this software:

  • Gnokii
  • Cygwin
  • Coalesce HTTP Library
  • sms2mds VBS script

    You can download this here. (415Kb)
    Note: It is set up to run from c:\gnokii, so extract to there!

    We also suggest:

  • WinCron
  • The nerve-centre of the sms gateway, Tom's old canabalised Nokia 8210.. John. The master of copy and paste coding...

    [327]