tags:

views:

75

answers:

2

I am about to start building an SMS alerting function in my web application. The aim is to provide two services:

  1. Host pays - e.g. to send an SMS alerting users to the cancellation of an event
  2. User pays - e.g. to alert that an Email has been sent with, say, details of a new event (apparently a requirement from users when they are away from their EMail systems!)

I also figure that there will be other user-pays scenarios such as if they have secondary mobile phones that they want alerting as the Host will only want to pay for a single phone per user.

From my research:

  1. I can use a 3rd party SMS Gateway provider. Cost is about GBP 0.05 per message. I can either send an EMail to [email protected] or I can use an HTTP request with suitable parameters in the URL.

  2. I can send an EMail to the user's network provider (I believe this is only available in the USA)

EDIT: There are variations on how the various providers will handle the From/Subject and Message, so presentation of actual message sent may be hard to predict.

  1. I can set up my own Gateway (which I think is way beyond my ability, and may give grief at our data centre!)

It strikes me that:

EMail we send sometimes get delayed in my server's SMTP queue, let alone any downstream queues. Sending an email to the network provider's SMS gateway seems to often be treated as low priority.

Therefore HTTP to a 3rd party SMS Gateway provider should give me shortest latency (important for "This afternoons event is cancelled because of bad weather")

When I send SMS Text from my mobile occasionally they take days to arrive - I presume this is something we just have to live with?

Having said that we will also have low priority informational messages and sending these by cheapest route is attractive! so I am planning to allow users to enter an EMail address for such messages - the intention being that they will use the email address for their mobile phone company's SMS redirect service, or similar (i.e. the email address of a device, not an inbox).

I also wonder whether allowing the users to enter IM, Twitter or other such is likely to be well used and efficient in practice?

From the 3rd party gateways I have looked at it seems:

Some use higher grade networks than others, this may impact performance? (or is it just marketing hogwash?)

Some provide better feedback than others. I need to keep the arguments over billing - and exactly how many "credits" the client has used up - to a minimum; getting an answerback of "OK" / "Phone number does not exist" therefore strikes me as important. One provider I found creates a text log file daily that can be downloaded and which I could reconcile with my outgoing log.

I would appreciate your opinions and experiences on:

Users will enter their mobile numbers as they know them. Do I need to enforce +9912345... so that I get the country code too?

What happens if the mobile is foreign (I'm based in the UK) Does the recipient pay the international part? or does the gateway provider perhaps have local transmission services?

What do I need to do with non alpha characters? The UK Pound sign "£" and CR / LF spring to mind. If these are encoded might that cause a message right on the length limit to exceed it once encoded (such that I need to build this in to the validation of the message creation form). Are new lines CR+LF or will just CR do?

Do any gateways have simulations? such that I could test my application without incurring any actual costs of SMS texts.

I plan to log the mobile numbers of any failed attempts and flag the user's record so that the next time they login I can encourage them to correct the number.

Any other gotchas and suggestions you have would be much appreciated. Thanks.

+3  A: 

The one big gotcha, that has happened to me, although this is not a programming question as such, its just an experience of it, that needs to be taken into account.

When someone sends you a message that is of an urgent meaning, and then the sender (owner of the handset) comes over to you and asked you did you get the message, and this is what irks me, a row can arise because you can claim to not have received it, thus making the sender somewhat feeling miffed/cross/angry that you have "ignored them" or "did not respond" when in fact it is down to the provider's network problems.

And funnily enough, after about an hour after having a row, your handset goes beep, and your message from the sender arrived!!!! This has happened to me several times! But what can I do without ever knowing what is happening on the sender's side of things (crisis, urgent query etc)

So be cautious if sending the message across from ethernet (internet) to the handset as ethernet is not exactly 100% stable (routers go down, dns disappearing, server outages etc) so it is worthwhile to keep this in mind. Like the question is how can you guarantee instant delivery of sms? That's a big question and reliability will have to come in, usually requiring extra effort to do so...

Handsets, most of them usually do, have what is known as a delivery report, some are switched on, some are switched off, that is a useful way of knowing if the recipient's handset is switched on or off, if it's on, you will get an instant delivery report indicating that it was delivered, likewise, if it's off, there will be a noticeable time delay in getting the delivery report, that is dependant on your providers' maximum time for delivery.

Sorry if this seems like a rambling...

Hope this gives you some food for thought, Best regards, Tom.

tommieb75
No surprise - SMS is by design quite unreliable. But since it's billed, telco's try to deliver late rather then never.
MSalters
Good point. We record all messages sent, and they can be viewed online, so time of sending etc would be visible in such a scenario
Kristen
+2  A: 

SMS is a telco service, not an Internet service. That comes with some different rules.

For starters, many endpoints are billed/billable, and have contracts with a single service provider. This will include all of your use cases.

Secondly, billing is a contract matter both on the sending and the receiving side. You simply cannot state as a sender that "Host pays", unless you restrict yourself to sending SMS to specific countries. USA is the most famous exception. "Receiver pays" is even worse. Due to SMS spam, telco's will usually allow this kind of traffic only when you have a contract with them.

Third-party SMS operators can deal with many of these problems. It's very easy for them to be more service-oriented than the average telco. They might even be able to deliver international SMS for you.

SMS tends to buffer in the network itself, not necessarily the email gateway. In individual cases, the difference is probably invisible to you. But you would still have delays even if you had a direct SS7 link to the telco.

Real telco's have test gateways, but the terms of use for those I can't give you. The idea though is definitely to be able to test you app at lower costs.

SMS uses its own alphabet, a rather nasty multi-septet encoding (7/14/21 bits!) The quoted 160 character limit comes from a 140 byte payload. This could also be coded as 70 UTF-16 characters.

MSalters
Very helpful, thanks. My host/user pays is just a case of whether the Host considers the message their responsibility to deliver, or whether its a luxury for the recipient so they should pay, but I take your point about USA or countries where recipient pays. The SMS Alphabet sounds horrid but maybe the gateway takes care of that if i just send them a POST that is URL-encoded
Kristen