Flylib.com

Books Software

 
 
 

Section 8.4. Server Architecture

Using a Smartphone as an SMS Modem > Server Architecture

8.4. Server Architecture

Setting up the SMS server with a smartphone is a bit of an unusual task in that you can't simply install some software on a web host's servers and be done with. You need physical access to the PC and the phone, so this will typically be run out of your home or office directly.

In addition, ActiveSync supports only one phone connection at a time. If you want to operate multiple numbers , you will have to run the software on multiple PCs.

When we built Slam, our group-centric SMS service, it was important to have multiple addressable numbers, which would allow users to have a separate number for each group they were a member of. We also provided a rich smartphone and PC web UI interface. This resulted in the architecture in Figure 8-2.

Figure 8-2. Microsoft Slam server set up

By using four different phones with four different phone numbers, we could allow each user to be a member of up to four groups. Which phone number corresponded to which group would vary from person to person (even if they were a member of the same group), we simply kept a mapping of phone servers and groups for each user .

 

 

Using a Smartphone as an SMS Modem > Tips and Tricks

8.5. Tips and Tricks

Having built several SMS services based on this architecture and operated one of them for several years , we learned a few things along the way.

  • Phones Leak :Microsoft is constantly improving the Windows Mobile platform, but as of Windows Mobile 5, there were still some significant memory leaks present in the OS. As a result, we typically ran into out of memory errors after several weeks of operation. Plan on rebooting the phones every week or so to ensure your service doesn't go down unexpectedly.

  • Scale: Using a smartphone SMS server implementation is intrinsically limited in scale. In my experience, the smartphone was able to send and receive approximately 30 messages per minute. Because SMS is a store and forward system, if the incoming messages get backed up, you needn't worry, they will flow down to your phone at the rate your phone can handle it. This should help you ride out any activity spikes as you scale your service up.

  • International: Sending SMS messages across national boundaries can be expensive and may not be covered by your standard SMS plan (even if it is unlimited). Save yourself an unexpected phone bill and decide whether you want to filter out international messages.

 

 

Using Email to SMS Gateways > The Basics

Chapter 9. Using Email to SMS Gateways

Because most U.S. carriers and many international carriers will convert emails to SMS messages and forward them on to their customers, email to SMS gateways present a highly accessible means of rapidly prototyping SMS services. However, in most cases they are not scalable solutions for a full-fledged service, because the carriers may arbitrarily block messages being sent from a particular service when volume reaches a certain point (perhaps as few as 50 messages in a day).

9.1. The Basics

Every major U.S. carrier and most international carriers provide a gateway to the Internet so that their customers can receive SMS messages sent via email. The sender addresses the message to an email address of the form ###########@carrier-sms-domain.com , it is converted by the carrier into an SMS and delivered. There are several lists online with the carrier to domain name mappings, including one at http://www.notepage.net/smtp.htm.

NOTE

One thing you'll learn quickly is that there is very little that is "standard" whe using email to SMS gateways. Each carrier has a few idiosyncrasies in how they send and receive messages. For example, while most carriers will fill in the From address with the phone number plus their domain (e.g., 2065551212@tmomail.net), a few don't. Verizon PCS, for example, allows its users to substitute a handle instead of the number, so a message sent to a Verizon PCS user with the address 2065551212@vtext.com" might be replied to with a From address of johnsmith@vtext.com. This makes it difficult to keep track of who you're receiving messages from.

You'll want to accommodate this in your service. For example, when you user registers, have them reply to the registration mail with a unique response code that will allow you to keep track of who is sending them message, then match that up with the address it's coming from.

Figure 9-1. Email to SMS architecture

To allow the receiver to reply via SMS and have the email user receive the reply, the carriers will assign a temporary response code to the sender's email address, and then forward any SMS messages sent by that user to that response code back to the appropriate email address (see Figure 9-1).

For example, let's say Bob is a T-Mobile subscriber with the phone number (333) 444-5555. Suppose you were to send an email to Bob as follows :

From: yourname@yourdomain.com
To: 3334445555@tmomail.net
Subject: This is the subject
This is the message

Bob would receive the following SMS message:

To: 3334445555
From: 501
yourname@yourdomain.com/This is the subject/This is the message

If he responded to that SMS (i.e., sent an SMS to 501), you would receive the following email:

To: yourname@yourdomain.com
From: 3334445555@tmomail.net
Subject: Re: This is the subject
Thanks!
------------
yourname@yourdomain.com /This is the subject /This is the body

Note that T-Mobile keeps track of the subject and copies back the text of the original message when forming a reply to a response code.This is not universal across carriers.

NOTE

T-Mobile @tmomail.net
Verizon @vtext.com
Cingular @cingularme.com
Sprint @messaging.sprintpcs.com
AT&T @mmode.com

Find lots more at http://www.notepage.net/smtp.htm!

9.1.1. Advantages and disadvantages

{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %}

The primary advantage of using an email to SMS gateway is that it's free (to you). There are some disadvantages, however.

First, you will need to know the carrier for each of your users in advance. If one of your users should change carriers, you will not be notified automatically.

Second, it may be a violation of some carrier's terms of use to operate a service against their email gateways. If they detect multiple messages coming from a particular SMTP server, they may block that server from addressing their customers for some period of time.

Carriers have at least two reasons to throttle incoming messages: 1) they do not want their customers to receive spam and 2) the email gateway is free, whereas they monetize their SMPP gateways (the gateways used by SMS aggregators).

Each carrier uses a different algorithm to detect abuse, so it is difficult to predict what will cause an interruption in your service and how to avoid it. Anecdotal evidence indicates that as few as 50 messages per day may trip the blacklist for some carriers. You may also find that sending from multiple addresses (even if it from the same mail server) is enough to mitigate this issue for some carriers.

Third, while most carriers allow their users to respond via SMS to email, many do not provide a means for a user to a conversation via email (i.e., they can only respond). This makes certain types of interactivity difficult or impossible . A look-up service, such as those described earlier, for example, are difficult to implement using an email to SMS gateway.

It is worth noting that the Dodgeball service began with a pure SMS ”email implementation. Dennis Crowley, the co-founder, has said that he believes that the service did suffer from throttling issues, but never received any user complaints. The lesson here is that certain services may be more resilient to temporary interruption than others, based on user expectation and need.

NOTE

During the 2004 Republican National Convention, protestors tried to use TxtMOB, a group -centric text messaging service, to coordinate their actions. On the critical day, though, they found their messages blocked. Evidence of political dirty tricks? Perhaps not. On September 7, 2004, a reader posted this message to the popular web site Boing Boing:

"I'm a network data analyst for T-Mobile. I've actually tested the network to see why those messages were blocked, and from the response our email-to-sms gateway is giving, apparently our immensely retarded spam filter thinks that txtmob's SMTP server is spamming us. Basically, if the network sees more than about a hundred messages coming from the same SMTP server within an hour , it just blacklists it. Stupid but true."