Sunday, March 15, 2009

SMS Gateway Released

We've just completed our first SMS gateway (with some help from Ron DuPlain at Espresso Labs). We've been thinking about and working on this for awhile now. The main thing we wanted in our gateway was the ability for patrons to text their library at a real phone number, as opposed to using a shortcode technique such as the AIM hack.

We have been able to achieve this goal by working with Google's Android phone (T-Mobile G1). Since it has an open architecture and allows applications to run in the background, Eric has been able to write an application that is installed directly on the phone. The application intercepts SMS messages sent to the phone and redirects them to a LibraryH3lp queue, where they are then delivered just like other IMs on the system.

We like a few things about this:

Patrons text a phone number and don't need to remember any shortcode tricks.

Libraries are fully responsible for their phone and texting package, which means...

LibraryH3lp fees do not need to increase one bit. This is just another gateway.

The phone's mobile number can be redirected to another line, such as a reference desk line, for voice communications, in case someone tries to call it rather than text it.

If you staff your service with our web client, you get a character countdown when replying to texts, which is helpful in reducing the number of messages sent. (A long message will be broken down and sent as multiple SMS messages.)

Of course, libraries will need to secure the phone and make sure it doesn't run out of power.

We believe the application works well, but this is our beta release. Currently, text messages sent when a gateway's queue is offline will not be delivered; these offline messages will get delivered soon, after a bit more work. The application is available for free in the Android Market now.

To setup an SMS gateway, start by installing the LibraryH3lp application on your G1. Go to the menu, click Settings, and give it a password (which can be anything). Then, go to the LibraryH3lp admin web site to define the gateway. This step is just like setting up any other gateway, just choose "sms", enter your ten-digit phone number as the username, and give it the same password you gave the phone. Finally, go back to your phone and click the "Start" button, and you're ready to start texting.

Source code freely available on Eric's Github. The code will work with any Jabber server; it is not LibraryH3lp-specific.

Two questions, as we are concerned about our patron privacy. (1) Is the patron phone number kept private/made anonymous when the SMS arrives as an IM, or is the number stored in the chat transcript? (2) Does the original SMS message still appear on the physical phone (i.e., do patron phone numbers have to be purged from that device as well)?

I'm using an HTC Magic, which is the same as the MyTouch 3G. There was no problem downloading the application to the phone. I've tried specifying the queue with and without the country code, but it hasn't made any difference.

Big update: Thanks to someone very kindly physically sending us their phone, we've been able to debug the problems with the new model Android phones, G2 (Mytouch 3G). This should fix recent mysterious issues, at least for 10 digit phone numbers as in the US.

The app has been updated on the Android Market. Your phone may even notice and ask you to upgrade.

There are a few other tweaks in the app, including new code to support international phone numbers. There may still be a little extra work to get that part fully functional.

Bottom line: Try again with the updated app. If it still doesn't work, let us know!