Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

My needs are very simple but I don't know the terms I should be Googling for: I need to occasionally send a SMS to a machine and that machine is going to answer with another SMS to the number that did send the first SMS.

I've got no say as to how that machine works: it's closed and all it does is receive SMS and send SMS in reply to SMS received (and uniquely to the number that did send the first SMS) and there's no other way to interface with it.

Upon receiving the "response SMS", I need to update a server / DB (a regular Java webapp server + SQL DB) with the infos contained in the SMS.

There isn't going to be a lot of volume (only a few SMSes daily) and robustness isn't that important (a few SMSes can be missed).

What would be a possible architecture for something like that?

I was thinking about using two or three cheap smartphones and giving them SIM cards and then program them to regularly (once every height hours or so) send an SMS. Then these smartphones would receive an SMS back from the machine they contacted and I'd intercept that SMS and update my server/DB accordingly. (I'll have physical control on these smartphones so giving any permission needed to any app won't be an issue).

Is this something easily doable? Technically, if such a solution could work, how can I access the SMS functionalities of the phone? And how can I have the phone udpate my server/DB? (the phone can be hooked to the Internet, so I take it I can simply do an HTTP POST to my server). Or is there already some (preferrably free or open-source) offering a similar functionality? (maybe something not totally unlike what "zapier" of "ifttt" does, where I could create a rule saying: "If I receive a SMS containing the word xxx, then send the SMS using an HTTP POST to the URL yyy").

Note that I did configure the server(s) hosting the Webapp myself and develop the entire webapp myself: so the "programming" part ain't that much of a problem. My issue is that I don't know how to "create a bridge" between the SMS coming in response to another SMS and my webserver.

I hope I explained the issue simply enough: basically I need some guidance on the architecture to use here (which fits programmers.stackexchange as far as I can tell from just having read its FAQ).

share|improve this question
add comment

2 Answers

I think it will be far easier for you to just use on of the many services available online for this purpose, e.g. Nexmo. I am not aware whether they are the best in business, but you could google "SMS API" and you'll find plenty of other providers.

This way you can send SMS messages with a single RESTful API call and receive them by providing a callback URL at your own server.

What you gain is that you won't deal with broken phones, etc. and you can focus on your core product.

Even if you don't pick a provider that does this for you, I strongly urge you to at least not do this with Android phones. Not only will you waste money on touchscreen and camera, but a sophisticated OS like Android has a higher chance of a failing component.

I think you'd be far better with a specialized hardware (they are not that expensive) that is designed specifically for the purpose of sending messages. You can search for "GPRS modem" and you'll find proper hardware.

This site has some useful information, although it seems dated: http://www.developershome.com/sms/howToSendSMSFromPC.asp

share|improve this answer
    
the problem is that the "received and send" scenario that stuff like Nexmo suggest are basically the inverse of what I need to do. A "simple" SMS gateway ain't working in my case: I really need to send and then receive (at the very number that did the sending). From spending time reading nexmo's doc it's not clear if they support such a use case (but I'll ask them). Regarding a GPRS modem: it's interesting but the problem is that this stuff is going to be less known and less supported than, say, Android. I'd need special drivers (for Linux), probably a specific language, etc. –  Cedric Martin Feb 17 '13 at 19:20
    
Have a look at clickatell.com too. I can not tell how good they are but they were one of the first in that business. –  Marcel Mar 26 at 10:06
add comment

For your issue I suggest to you to create a routing rule in your SMS gateway. The routing rules help you to create a SMS route (inbound, outbound). With this route you can control the SMS messages you wish to receive / send.

You can find detailed information about routing rules on this website: http://www.ozekisms.com/index.php?owpn=138&info=configuration/inbound-routing

share|improve this answer
1  
The OP doesn't yet have a SMS gateway, I don't think. And what's your relationship with Ozeki NG? Isn't there a more generic resource about this kind of SMS routing? –  Martijn Pieters Mar 26 at 10:42
    
I am using this software. We set a rule to create an alert system. If 1 mobile receives a text with an exact content, the software sends it to the rest of the connected users. So i guess he can set the database and the phone numbers for this route. –  user124685 Mar 26 at 11:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.