Receive SMS like a modem - sms

I have an application which can only send SMS to a serial AT modem, but I want to send this SMS via an web service.
My idea is to connect a virtual software modem to the (virtual) serial port of the application and receive the SMS in software, then I would pass this SMS to the web API.
My problem is, that i nether find a software which can recieve SMS like a modem nor find a library which offers ability to act like a modem.
Any ideas?

Your existing application expects to connect to a serial port. That means you need some kind of virtual serial port. Google will give you perfectly usable hits for that term. Any of those libs should give you a character stream.
Parsing this stream should be fairly straightforward. You can toss out all modem initialization, and just focus on the SMS command. In theory, there's a "write" and a "send" command, but you can safely assume that a PC application will send any SMS that it writes. It's not like PC's make typo's. Hence, you just need to parse the AT+CMGW command; all other commands can get a standard OK response.
Grab the phone number and message from the AT+CMGW command, and pass it to the webservice. Done!

Related

How to build an bulk sms sender or voip server?

I want to know how can I build my own Sms service provider?
In another say; What is needed to have a system to inject sms messages to the mobile network systems freely or is it possible at all?
with VoIP server we can do voice and video and text messaging through internet; but what about from internet to the land line or mobile network?
How Skype, smartvoip, etc. do this?
Please give me a direction that I could go through.
You need some sort of interface to the Mobile network to make this work. Your choices include:
build a system with a GSM/UMTS card or phone which you control to send SMS messages into the network. This will need a valid SIM and contract (and the small print may say that you are not allowed to use it to provide an IP to SMS service to others). If you google 'Asterix SMS Gateway' you can find several open source examples. You could also look at http://www.kannel.org/overview.shtml, although I am not sure how actively this is being maintained these days.
Build a front end for your SMS service and use an existing back end SMS service in whatever your target market is - i.e. connect directly to your local operators SMSC, most likely using SMPP protocol. This assumes the operator provides this service in your target network/market.
Use an SMS aggregator service such as MBlox or Clickatell

Shut down a system by sending an sms from my phone

I am currently working on a project where I need to shut down my PC by sending an SMS from my phone.
My idea is:
I have a my cellphone/USB modem with simcard connected to my laptop. So can I shutdown my laptop by sending a message "shutdown"? Here I need to have a program that reads what all sms coming to my phone which is connected to laptop. If the content of the message is "shutdown", then I can call a batch file where my shutdown command is written.
How can I achieve this?
Yes this is possible but much easier using a SMS service like Esendex (www.esendex.com there are loads of others).
You can host a webservice on the machine (or another on the same network). The webservice recieves the SMS and process it depending on the message it contaions. When you send an SMS to your Esendex account this webservice is called and if the message reads Shutdown (or whatever keyword you choose to look for) you can simply call the shutdown batch file.
if you want to do it without using something like esendex you will need to write some code that monitors the SMS's coming into the attached phone. How you do this will depend on the type of phone you have connected I believe.

connecting computer to a mobile phone - reading sms and use it?

I've absolutely no idea if this is possible and how it would work.
is it possible to give users a phonenumber where they should send an sms to.
e.g. the sms contains
name
some code
i want to track how many sms are sent to this number.
i want to read the sms text and use both nodes
they weird way i imagine this: i buy a prepaid simcard from any phone provider, i plug the simcard into any device (sim-reader :) ) connected to my computer. my computer is ONLINE. so my computer is kind of transformed to a mobile phone. some software is able to retrieve those sms and i can use the data in it.
is that even possible, if yes HOW?
You can use e.g. gammu to send and receive SMS from a cellphone connected to your computer - essentially creating a SMS gateway. I've succesfully used it in the past in this setup (newer phones have serial port emulation through USB, for older ones you need a model-specific serial-to-phone cable):
my program <-> database/textfiles <-> gammu <-> serial port <-> cellphone
The operation was as follows:
gammu ran in the command line/daemon mode, with a watchdog script restarting it (and the cellphone) if the cellphone became unresponsive (this was a really old phone; a watchdog is probably not necessary with anything > 2006)
gammu polled the cellphone for new messages, those were store into a "received" table in the database.
gammu also polled an "outgoing" table in the database for messages I wanted to send, and sent them through the cellphone.
my program was a web frontend for reading the incoming messages or inserting the outgoing ones.
(Gammu has an API to interface with the cellphone directly, without the database; I decided to keep the backend and frontend parts separate, and since the frontend was using the database for other things anyway, it was easiest to go that way; also, I was using an old phone for this, and needed the frontend to run even if the cellphone wasn't responding)
There are several possibilities listed here. But it depends on the phone you are using. Symbian, iOS, Android, Windows Mobile. But basically it is possible using a GSM Modem.

Replying to an SMS sent from a modem of SMS service?

I am trying to implement my own theoretical SMS web service (just to understand how this stuff works, I have posted a few other related questions, I think this is it).
Set up a PC. It takes requests from a website I make to send out SMS messages: a user-entered destination phone number, and a user-entered text message
I get a GSM modem, or just a GSM phone. I connect it to the computer.
I get a service plan from Verizon or whoever, some sort of unlimited SMS messaging plan.
They give me a SIM card, which has my unique phone # attached to it (ex: 555-5555). I stick this in the GSM modem.
I get some application (like Kannel) which handles interfacing with the modem and sending out the messages from my machine.
Now users can visit my theoretical website, enter a phone # and message. I grab that data, forward it to Kannel. Kannel interacts with the modem, passing it the data for the message. The modem interacts with the carrier network I signed up with, and broadcasts the actual SMS to it. The carrier network handles routing the message to the actual destination.
This is my understanding of how it works. Now the recipient of this text message will see this message pop up on their device from my modem's number (555-5555). In fact, all the thousands of people using my service will all see the same origin phone number.
If that's so, how do these 3rd party SMS applications give people unique #s for replying to messages they send out?
For example, when I sign up for one of these 'free' SMS services on iPhone, they assign me a unique user ID, like '123'. My friend is on a normal AT&T phone plan. He can send an SMS addressed to '123', and somehow I will get the message. How does AT&T know to route that to this third party service? I can't imagine that they would somehow get a new SIM card with a unique phone number per user that signs up for their service!
Thanks for all your help.
Thanks
The cell network carriers (e.g. AT&T, Verizon) actually rent out custom phone numbers (called "short codes") to 3rd parties to use.
You usually can't acquire these short codes directly from the carrier, but you can go through a 3rd party company to rent the short code. I've worked with companies like MBlox and OpenMarket to use carrier short codes. These companies are sometimes referred to as "SMS/MMS messaging aggregators," because they aggregate messaging services across multiple carriers and offer them to people/companies like you. Most of the time the aggregator will expose some sort of API (SOAP/XML or binary protocol) to access the messaging services to send and receive messages.
There may be other ways to do it, this is just my experience.
I think your comment at the bottom of your message is misleading.
Your friend probably doesn't send a message to "123" infact he probably sends "123 hello george" to a central number, which in turns routes "123" on to you, behind the scenes.
FWIW, mobile messages can appear as though they come from anything (including, for example, a word, and not a number).
Your general underlying assumption as to how gateways work (acquiring simcards) is accurate enough.

Sending an SMS myself

I'm taking shots in the dark here. I'd like to create a web service where eventually I send an SMS by using my own hardware. I'm not sure what I need in order to send an SMS myself. I don't want to use any of the existing SMS send services out there, I need to be able to send these SMS myself.
It looks like there's one opensource project in particular that deals with this, "Kannel":
http://www.kannel.org/
what I don't understand is, do I need to get a GSM modem to be able to send SMS? Do SMS gateways (like Kannel) eventually need to get to a GSM modem to send messages, or is there some other hardware you need to be able to actually send the messages?
Thanks
Just find an online SMS Gateway. These Gateway providers are your best bet since they have handled all the heavy lifting for you. Just utilize their API and you should be able to do whatever you want. Some of these gateways are free and some are not. I've included a short list below.
https://www.clickatell.com/pricing/message_cost.php
http://www.zeepmobile.com/
(Carrier based SMS transit)
http://en.wikipedia.org/wiki/List_of_carriers_providing_SMS_transit
I'm sure there are a ton more, but this will get you started.
You always need a GSM modem to send the SMS unless you use a provider that handles this for you (but they usually want money for this).
If you want to setup your own Hardware infrastructure, you have to get GSM Modem, A Sim card and use it to send SMS.
Other option, which I recommend, is to use SMS getways and use
SMPP protocol
XML or HTTP Apis
In later, you dont have to create any infrastructure and the starting cost will be very low compared to GSM Modem. You can get up and running in a day.
Note : to reduce the SMS costs, you should choose different getways for different countries. In India you can easily find getways who provides SMS at merely 3 paise
You will have to download an API that handles the sending and recieving of messages for you. I once used this in one project where i had my GSM Phone connected to my computer thru one of the COM ports. Configured the API to communicate thru the COM Port to listen to any incoming text messages also send messages thru my GSM Phone. Here is a great link to the resources i used for that project. I hope this will help. http://www.codeproject.com/KB/cs/SMS.aspx

Resources