How do I implement an sms USSD app like this? - sms

I was wondering how to create an SMS app like this where you text something say "1GB" and get some response from server. https://imgur.com/zwFFhzz
Sorry I'm new to USSD so apologies if amateur question. 1) How does an app like this work? What do I need to know to implement this?

To implement a USSD style application you need to have buy in and assistance from the network operator.
There are API's in various toolsets that will allow you to issue USSD commands to the device, these API's simply just pass the request straight through to the GSM modem on the device as an AT command (I can't remember off the top of my head what it actually is), and the modem unit is responsible for actioning it.
Some commands are processed directly on the device. For example if you type in * 06# (or #06 *) i forget which, most devices will display thier IMEI number. Many mobile sites too, will often have lists of "Secret Manufacturer Commands Your Not Supposed to Know" or "Special Commands that get you Free Credit".... :-)
All these are, are fixed strings built into the modems firmware by the manufacturer of the modem, not the device.
Most USSD style SMS's however are actually parsed and acted upon inside the providers network, usually on some kind of application server that's attached to or works in tandem with the main network SMSC's
For example when I worked on the Yalla Bill pay system out in Qatar we routinely had to attend meetings at QTel (The state telcom provider) to explain our routing rules and test them to make sure they where implemented correctly.
When I worked as a network engineer for Orange UK, i would often have to take care of service requests from vending machine companies that used USSD in thier firmware to send messages to a router at the provider's SMSc center.
The other thing to consider too, is that many providers will charge you A LOT OF MONEY to undertake a project like this, even more if you want them to just intercept anything sent to a given number and be routed directly back to you for you to act on in your own servers.
Some providers do have SDK's that allow some kind of similar access, sometimes for free, sometimes for a cost. I remember when I worked for Orange, you could join the "Orange Partners Program" and that got you some nice SDK code and access to various inner network stuff (I built a big chunk of it :-D) that allowed you to do some interesting stuff, since the company became EE and now part of BT however, I honestly don't know if any of it is still in use.
You can also get a shortcode, and while that's not USSD style SMS, you can have SMS messages sent to the code and those messages will then get forwarded onto a TCP server endpoint that you control.
I believe Twilio have this feature available, and I know MBlox do beacuse that's who I use.
It's not genuine USSD, but you can easily set up a shortcode, have folks send SMS to it, then use an SMS send API to reply back to the sending number.
My MBlox account for example gives me a pay as you go HTTP SMS end point, where I send regular TCP based get requests with a set of parameters, and they turn those into SMS's and send them to the recipient. I pay roughly 2p UK per text inside the UK, and it cost me £50 UK to set it up.
On top of that, I got an inbound SMS number, which costs me a fixed £50 per year, and any SMS recieved by the number is sent to a TCP/WEB based endpoint I provide to them, and which I then do what's needed with the recieved SMS when it arrives.
My inbound is a normal full length number though, for a "shortcode" number which is what your picture shows, you'll likley have to pay extra for that.

That looks like it uses a short code for the interaction, the response is parsed to make a purchase of the 2GB via another API.

Related

How to enable SMS to existing landline?

Looks like you can add sms to existing toll free phone numbers but keep voice with the existing carrier. Is this possible with a regular landline without porting to Twilio? How can other companies do this (zipwhip)?
They work through an inter-carrier vendor like TNS, Aicent, or iQuall. These vendors basically all do the same thing - which is to provision and store SMS routing instructions for all US-based phone #s... these are all aggregated in one big central repository.
Example: if you're on T-mobile, whenever someone texts your phone # (from any carrier or platform) it hits this routing network that tells the message to get posted to t-mobile. Companies like zipwhip do the same thing, they just tell the network to enable SMS for that landline number, and the instructions just tell the network to point any messages back to their cloud.
This is only possible because the overall telecom industry agreed to support intercarrier messaging back in 2001. (source: CTIA)
Twilio has a private beta for routing SMS from toll-free numbers. You can DIY, just a little more work.
Updated answer: it is now possible to SMS host an existing landline, toll-free, or in some cases an existing VoIP phone number via Twilio. The voice routing and voice provider will not change.
Note that you cannot "roll your own" functionality today to make this happen because you need permission to write to the NetNumber database. And you're not going to be able to get permission to do so as an individual.

Responding to incoming SMS

I am new to Twilio and tasked with evaluating whether to switch from our current service which is CDyne.
We have an application that uses SMS to interact with clients on behalf of staff using two-way SMS. The app automatically launches SMSs at certain trigger events and based upon the responses from clients decides what to do next - including asking further questions of the client. The SMS gateway I use currently allows me to include a reference id in outgoing messages. This id is returned when someone replies to the message. This makes it dead easy to look up everything related to the incoming message and form a decision and reply. Twilio does not seem to have anything similar. In fact, it does not even return the SMS ID of the original message which seems to make it a pain to determine the relation. I understand you could potentially look up the FROM and TO and trace it back, but with multiple phone numbers being used for the same client (staff can send messages directly too using a different phone number and there are several numbers being used for mass text messages), this is potentially (very) hazardous.
Question 1: Is there any (good) solution to this issue in Twilio, and
Question 2: If not, why not??? (It seems pretty obvious and simple to include a reference to the initiating SMS in the reply)
This is one of the many features that CDYNE offers at no cost to their customers.
To my knowledge, Twilio doesn't offer this feature.
For additional information on SMS Notify!'s additional free features, check out CDYNE's wiki.

Dealing with SMS Spoofing

I'm working on a web service that would use an SMS gateway to receive instructions from customers. Since this would be a commercial product I would like to implement a safeguard to protect our system from SMS spoofs. I don't want people impersonating others by spoofing their number.
I've noticed that Twitter allows people to tweet through text messages, how can they make sure that messages are actually genuine?
Is this possible, and if so how do I accomplish this? Or should I ignore this and just deal with it through support should they get through.
How do users spoof their numbers? Every service I've seen that allows users to interact from their phone requires a validation process first (like this). And carriers won't let you send messages through their system from a device they don't know. SMS gateways also provide safeguards to prevent spoofing. So I'm not sure how big a problem this will be for you. I would worry about it once you start encountering it.
Unfortunately with services like Spoofcard it is sometimes possible for someone to spoof an sms message. Spoofcard even works in the US even though US carriers have historically been better at blocking spoofed text messages. You can try it yourself at their site. I was able to spoof a text message to/from a tmobile number.
The solution is to implement a verfication question/text for the user to answer but this will cost you/them an additional text message.
Fogmo, a popular SMS spoofing site, allow you to contact them and add any number to a 'blacklist'. This would ensure that your customers' phones won't be spoofed to, or from. It's well worth contacting them (and similar sites) to request this.

BULK SMS, Long Codes (VMN MSIDN), T-mobile?

Does any US wireless carrier offer individuals or companies with a direct connection to the SMSC?
The number is 747-772-3101 (repalce 7's with 6's)
This number is registered to t-mobile, also verified by t-mobile to be a valid subscriber sending 160,000+ text messages monthly and that all they have is an unlimited text messaging plan on top of the cheapest voice plan. This company of the number verified to me that they don't use gsm modems as they are too slow.
So I know it's possible but who would I contact, Sales or anyone else reachable through a 1-800 is ignorant to these services and developer.t-mobile is worthless and doesn't reply to emails.
Any info??
Most likely they are connected to an Aggregator (Sybase 365, Mblox, Netsize, Verisign, etc. Smaller guys like multimode and Clickatell are more open to this) that is connected to T-Mobile. As they have chosen to not use a shortcode they simply buy a regular T-Mobile SIM/MSISDN and use the full longcode as the origination address of the messages.
A lot of companies use aggregators to enable Oracle Applications Server to send SMS messages.
does anybody have more info on this????
i did a little investigation and here is what i have determined. the company that the long code is tied to is broadtexter.com. they offer a free service to people who want to follow bands/comedians/acts/ etc. you basically join their fan club.
when i text help to the phone number it immediately autoresponds from that same number. that means they are either using an agg with a dedicated vmn (totally possible) of they are using a mobile modem with a sim (totally possible as well, and probably cheaper), but basically all they are doing from this phone number is pushing traffic to their website.
once you go to their website and sign up to a fan club; ALL FUTURE COMMUNICATION is mo/mt thru the SMTP gateway. dead giveaway is that they ask for your carrier when you sign up. second dead givaway is the caller id is xxxxxxx#broadtexter.com every time.
so the simple answer is that they are only using the vmn (long code) to drive people to their website to sign up...then all future communication is over SMTP. so the 160K+ messages are occuring thru the SMTP gateway. since they appear to be non-commercial (no ads, no spamming, etc.) and they are somewhat of a peer to peer setup, they probably fly under the radar (or are accepted by) the carriers.
if anyone can offer more insight to this, i would love to read it!
I've got more info, and its kinda blowing my mind. I'm interested because I've got a social networking website and I'd like to set up an interactive SMS service without a shortcode. So I went to one of the profile pages on broadtexter.com and used their flash widget to join that bands club. I entered my mobile number and for provider I choose AT&T - option 1 (there were 3 options listed). Almost immediately I got a SMS asking me to reply with a Y to confirm. Here's the crazy thing: The number it was from was 1 (410) 000-001. At first I thought it was a regular cell number, then I realized it's missing a digit. Unless the area code is actually 141 and my iPhone is just formatting it weird. Except 141 isn't an area code?
Next, I replied with a Y and I got another text that asked me to reply with a photo for my profile (something that would be prefect for my site). This time the text from from 1 (410) 000-002.
So I sent back an MMS with a pic from my iPhone gallery, and I didn't get a reply yet. It's been about 15 minutes. It's kinda weird because to sign into their site, I need a username, which they never gave me. I haven't given them my email yet either. Anyway, I don't really care about that. I just wanna know what's going on with those numbers? How are they doing this?!

How can I send SMS messages like Twitter does?

Do all cell companies have open APIs that allow you to send SMS messages like Twitter does?
Do you have to pay to do this?
Many (most?) mobile companies have email gateways allowing you to send an SMS. For AT&T I believe it's phonenumber#text.att.net, but each provider will have a different address.
This wikipedia article summaries it pretty well. Some cell companies have easy formats. For example, Verizon uses number#vtext.com.
It depends what country you're in.
In the UK to pay to send - receiving is free.
Take a look at messagepub. They provide an easy API so that you can send SMS messages from your application.
If you want a reliable solution then yes you will have to pay for it, there are some limited free versions.
We used Clickatell with an earlier project http://www.clickatell.com/developers.php
It gets a bit more complicated. E-mail gateways may work for some carriers, but not others. As noted, it's based on your cell carrier, what we can the aggregator, and possibly a third-party "intercarrier". However, it also depends on volume. If you're just sending the occasional SMS via e-mail, it certainly can work, but, it's occasional in use, and you don't get the confirmations that your phone normally sees. For volume transfers of messages, you typically need to talk to your carrier about access to their "SMSC gateway". The SMSC gateway speaks an internet protocol (SMPP) to transfer messages from your app, into the carrier clouds. It it designed for volume, and you get response codes for your messages.

Resources