-
Notifications
You must be signed in to change notification settings - Fork 1
Home
TxtGate is a simple SMS gateway running entirely on an Android phone. It works wherever the phone can receive SMS messages and go online (via wifi or GPRS), so it can provide an SMS gateway anywhere the phone works without needing to install hardware, deal with service providers etc.
When TxtGate is launched, it listens for SMS starting with a user defined identifier string. When a message is received, its content & sender phone number are sent as an HTTP GET request to a user defined URL, for example http://example.com/sms?sender=1234&msg=itp+hello
Optionally, the target URL may reply with XML containing messages to be SMSed back to the sender phone or other phones
Here’s an example for creating a simple SMS weather service with TxtGate:
- TxtGate is configured to use identifier
weather
and URLhttp://qkhack.appspot.com/weather
- A user texts a message like
weather 10026
to the phone running TxtGate
- TxtGate sends the message contents and sender phone # to that URL, for example http://qkhack.appspot.com/weather?sender=6465551234&msg=Weather+10026
- The URL runs a short python (or any language) script retrieving the weather information for zip 10026 and rendering it in TxtGate’s ReplyXML format:
<reply> <sms-to-sender>Cloudy 74F today, Thunderstorms Early 78F tomorrow, Scattered Thunderstorms 74F Tuesday</sms-to-sender> </reply>
- Reading the URL’s response, TxtGate texts the weather information back to the user.
While there any number of ways a person in a developed nation can get the weather report, it’s not necessarily so for, say, a farmer in a remote region of a developing nation. A single Android phone with a local SIM card and TxtGate installed can allow users with no web connection to access this information when they need it, for the cost of an SMS message.
If you have an Android barcode scanner, simply scan this image:
Once the application is installed, launching it will display the following screen:
Pressing Menu will open the settings screen. There are two settings to configure:
- SMS Identifier: TxtGate will only handle SMS messages that begin with this string. If you wish to handle any incoming SMS, set this to an empty value.
- Target URL: Once an SMS is received, TxtGate will do an HTTP GET request to this URL, passing the contents in
msg
parameter and sender phone number insender
. If the response body contains text, TxtGate will SMS it back to the sender’s phone.
- If you respond with text to be sent back to the user, TxtGate expects it to be UTF-8. Other encodings may work, but they might cause unexpected behavior.
- Android enforces an outgoing limit of 100 SMS messages per hour. However, there are ways to override this
- At the moment TxtGate does not remove received SMS, which means you probably want to use one of Android’s SMS auto delete applications to clean them up periodically (if you have good/bad experience with a particular application please let us know and we’ll be happy to post it here)
- TxtGate is not meant for mission critical or high load applications in its current form. It works, but it’s a young codebase and yet to be tested in real use. Again, if you have feedback on real use we’d love to hear it.
On any feedback, questions, comments, etc please feel free to email [email protected]