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:
  1. Patrons text a phone number and don't need to remember any shortcode tricks.
  2. Libraries are fully responsible for their phone and texting package, which means...
  3. LibraryH3lp fees do not need to increase one bit. This is just another gateway.
  4. 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.
  5. 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.

Monday, March 2, 2009

Countdown!

There are a few unique challenges associated with trying to integrate a texting (SMS) service into an IM/chat reference workflow. Two of them are:
  1. Attempting to keep responses relatively short. SMS tops out at 160 7-bit characters or 140 8-bit characters.
  2. Training librarians to notice when they have an SMS patron in the first place.
Messages in excess of the character limits will be automatically split up into multiple messages, so going over the limit is not the end of the world, but SMS conversations flow more nicely if the librarian has an awareness of the limitations.

Eric just added a nifty feature to the webchat client to help out with patrons sending messages from cell phones.



When the librarian begins composing a message, a character countdown starting at 140 begins displaying in the top right corner of the window. You can also see from the normal routing information displayed in the top left corner that the patron is on a phone and contacted the pamq queue. If this wasn't a goofy test chat, you could have seen that they contacted your special reference queue, or your SMS queue, or whatever you've setup.

[edited to add: The webchat client automatically detects phone numbers and applies the countdown display only then. It will not display with routine chats and IMs.]

We're working on a new kind of SMS gateway, one that will let a patron text a phone number rather than using a short code like with the AIM hack. More news on that as it happens...