12 ms·
Turn your Android phone into SMS API gateway
- 2Gkashmiri 5y agoi am willing to try this but the readme is terribly empty of information. oh well, i am going to download the apk and try it out
- andrewxdiamond 5y agoNeat! Pushbullet also does something like this, and more! https://www.pushbullet.com/ https://www.pushbullet.com/
- notRobot 5y agoThis project, Traccar SMS Gateway: https://github.com/traccar/traccar-sms-gateway https://github.com/traccar/traccar-sms-gateway It's based on QKSMS: https://github.com/moezbhatti/qksms https://github.com/moezbhatti/qksms QKSMS makes use of smsmms: https://github.com/klinker41/android-smsmms https://github.com/klinker41/android-smsmms I love GPL and FOSS :D
- malikNF 5y agoSo has anyone ever used something like this on a unlimited sms plan for use with 2fa or something for their sites ? Im guessing "unlimited" sms, is also similar to "unlimited internet", you start sending more than a 1000 sms messages a day you might get throttled?
- tiernano 5y agoMost Irish providers now say unlimited ams is 40k a month... So 1000 a day is doable...
- busymom0 5y agoWhat does throttled mean in SMS context? I can see why internet would need to be throttled but SMS is very infrequent and low data for it to be required to be throttled.
- mgarciaisaia 5y agoIf you try sending many SMS really quick, maybe the 5th or 6th you send in a minute will get blocked by the telco instead of being delivered. This is usually (at least marketed as) a spam prevention system, so you don't blast people with a really cheap, disposable SIM card.
- franga2000 5y agoI know someone who did and it worked for a while until the provider contacted them to ask about the unusually high activity. They explained the situation, but since their package was a B2C package and they were using it for their company, the provider told them to either stop doing it or switch to a B2B package. There was no unlimited text B2B package available at the time and all of them were quite a bit more expensive than B2C. The latter has changed since, but I'm not sure about the rest.
- jqpabc123 5y agoYes, most ordinary service contracts are "unlimited" for personal use. A "person" can't reasonably compose and send more than 3 or 4 messages per minute on average. Send "too many" as defined by the carrier and you will likely be cut off.
- Lukas_Skywalker 5y agoI once sent 10k sms messages per month for about a year before my plan got cancelled. The plan officially allowed for unlimited sms. It was about 50$ per month, which was much cheaper than 0.1$ per message at Twilio (in Europe). I received the bill at the end of the month stating the timestamp and recipient of every message. The PDF was regularly around 100 pages long.
- mgarciaisaia 5y agoStandard SMS plans usually have a human-typing-in-a-keyboard rate limit, around a handful per minute - you can manually try this, I've got blocked a couple of times by spamming a friend with "a", "b", "c"... Were I work, we've implemented a couple of nation-wide general population surveys regarding non-communicable diseases (working with those countries health authorities, of course). For the actual surveys, we get SMPP contracts with the local telcos because of this limit (and to get a vanity shortcode, reverse billing...). We started thinking it would also be cheaper, too (due to the scale pricing) - but the human time required for working out contracts with developing-world telcos for a project involving state actors can easily counter that. The throttling is something we need to take into account for the tiny-scale pre-tests we ran (while working out the contract) using an SMS Gateway App[0] we've built, similar to the one from this thread. The main difference is ours uses a queue-based protocol to exchange messages with a controlling server. [0] https://github.com/instedd/mobile-gateway https://github.com/instedd/mobile-gateway
- Roritharr 5y agoWhat are the security downsides to using this for, for example, 2FA SMS? The cost of cloud providers in this space is neglible, but I'd still like to think about this as an exercise.
- ffritz 5y agoActually for Germany, the costs for sending an SMS with Twilio is 9 ct. If I’m not mistaken, that is 10x more than what it costs in the US.
- edoceo 5y agoTwilio and Plivo are sub-penny (USD$0.01) per message - for most of NA. International gets a bit more but in USA is cheap.
- ljf 5y agoIsn't that because in the US the receiver of the SMS also pays?
- kuschku 5y agoThat’s actually relatively cheap, considering SMS prices used to be much higher than that until the EU enforced a hard limit of 10ct per SMS as maximum price.
- mellavora 5y agoConfirming the EU costs as circa 10c per SMS. Varies slightly by provider (twillio, AWS, ..), country, and perhaps exchange rate (if you pay in USD, billing may be fixed in EUR)
- spotijk 5y agoThat looks really great! We've also built something similar but not quite the same for use with the Auron SMS Server: http://www.auronsoftware.com/products/auron-sms-agent-for-android/ http://www.auronsoftware.com/products/auron-sms-agent-for-an... In our case we chose to built a custom IMAP-like protocol for integrating with the Android app so 2 way communication would work without any extra steps. But this project is definitely something that I'll look into supporting as well. The point of our software is to make integration as easy as possible by supporting as many protocols and devices as possible.
- noduerme 5y agoHaven't looked into this in a long time, but every cell carrier used to have a gateway address where you could send an email, using the destination phone number as part of the address, and the gateway would dispatch an SMS with pretty much arbitrary envelope information. You just needed a list of active gateways. I think I even have some old php code lying around that I used to spoof my friends' phone numbers to each other and generate a text thread where one came out and said he'd left his wife because he was secretly in love with the other dude. I know, real mature use of technology.
- notRobot 5y agoThis was a lot of fun! I've definitely done the PHP spoof haha, if I can find the code I'll link it here. However, last I checked, those email-to-SMS gateways were shut down to prevent spam :(
- noduerme 5y agoDunno how old you are but back in the analog cellphone days I had my mom's clunky old flip phone lying around, I was 14 or so and followed some instructions off a BBS. If you put a piece of tin foil between two of the battery contacts you could get the phone into debug mode and you could punch in any channel number and just listen in on it. I lived near a freeway, so I would spend hours in the backyard eavesdropping on people's conversations as they drove by and faded in and out of range. You had to be quiet, because if they were close enough to pick up your signal they could hear you too. Dudes arguing with their wives, drug deals, it was quite an education. The shortwave radio receiver my parents bought me as a birthday present gathered dust in the closet.
- terrage 5y agoThat is a life-changing hack right there! Reminds me of an old glitch I experienced in the early Nokias that allowed the receiver of a call to listen-in on the line before answering.
- 5y ago
- deleted 5y ago[deleted]
- andrewshadura 5y agoAlternatively: https://matrix.org/docs/projects/bridge/matrix-sms-bridge https://matrix.org/docs/projects/bridge/matrix-sms-bridge
- notRobot 5y agoOoh, neat!
- andrewshadura 5y agoAnd also a direct alternative to the OP: https://github.com/RebekkaMa/android-sms-gateway-server https://github.com/RebekkaMa/android-sms-gateway-server
- motiejus 5y agoI've been using this for a while now. It works so well I forgot about it, until I need it: then sms is in my (desktop) element instance. This was a totally unexpected +1 when onboarding to matrix for personal use.
- usrlocal1023 5y agoIt would be nice if it would integrate with a 3G/4G dongle. Huawei dongles (maybe ZTE as well?) already have an HTTP endpoint to get SMS and also their USB dongles have no battery, so it is much safer to leave it plugged into a wall 24/7 than a phone. Most phones these days do have battery charging cut off, so they should be safe but still prefer to have one without battery for leaving it plugged in 24/7.
- bigiain 5y agoA simple PowerPoint timer set to be on 1 hour out of every 12 works pretty well to stop wall mounted iPads from doing that “swell up the battery until the screen pops out” thing.
- BiteCode_dev 5y agoOr pulsesms if one wants a zero config solution, albeit proprietary: https://home.pulsesms.app/overview/ https://home.pulsesms.app/overview/
- cbg0 5y agoMake sure to check your contract or your carrier's ToS to see whether you're allowed to do this, some have terms specifically against this stuff.
- jqpabc123 5y agoYou may not find this specifically addressed in a contract. Instead, there may be a generic statement about personal use. "Personal" use implies limits of some sort imposed by the carrier --- often as they see fit. A person can't reasonably compose and send SMS at a rate of more than 3 or 4 per minute on average.
- lotsofpulp 5y ago> A person can't reasonably compose and send SMS at a rate of more than 3 or 4 per minute. I have mobile network bills from when my sister was a teenager and people used SMS to text that show this is reasonable.
- dagw 5y agoperson can't reasonably compose and send SMS at a rate of more than 3 or 4 per minute. People at least used to use SMS as essentially a chat protocol, with each message often being only 1 or 2 words. 10+ messages pr minutes could easily be reached if you where having a conversation with someone.
- jqpabc123 5y ago10+ messages per minute might be reasonable in a conversation with a single individual/phone number. The same with all different numbers may not. The point is that the actual definition for "personal" use may vary by carrier but be aware there is one. If you are sending "too many" messages to "too many" different numbers, you are likely to be cut off.
- abcdabcd987 5y agoI use Automate[1] to do this. Just draw an infinite loop that does sms_received[2] and email_send[3]. [1] https://play.google.com/store/apps/details?id=com.llamalab.automate https://play.google.com/store/apps/details?id=com.llamalab.a... [2] https://llamalab.com/automate/doc/block/sms_received.html https://llamalab.com/automate/doc/block/sms_received.html [3] https://llamalab.com/automate/doc/block/email_send.html https://llamalab.com/automate/doc/block/email_send.html
- franga2000 5y agoCan you receive SMS from apps that aren't the default SMS handler on modern versions of Android? I seem to recall Google putting a bunch of silly restrictions on it to the point where there wasn't even a permission you could grant if you wanted to.
- Cox562 5y agoTurn your Android Phone into a SMS Gateway, Using our API to send messages programmatically or to receive messages programmatically using our Restful API. https://www.peryourhealth.us/ https://www.peryourhealth.us/
- kaivi 5y agoSlightly off-topic, but has anyone managed to automate receiving and replying to so-called "flash SMS" or "Class 0 SMS"? In Norway, there is a thing called "BankID on mobile", which is used for 2FA by government services, along with any companies requiring authentication with person's ID. Examples: banking, insurance, health and vehicle registration: you initiate a log in using either your personal ID or a combo of phone number+birthdate, and you receive this interactive, full-screen flash SMS asking you to ensure that a certain word combo matches, and to confirm the action with your PIN. To be clear, the interactive part does not come with some app, but it's a feature built into most smartphones. This thing drives me nuts when traveling: it is slow when abroad and costs money. What's worse, is that it only works with a physical SIM, so I can't easily use a local SIM abroad. There is an alternative way of authenticating using a code-generating unit, but it is not perfect - you can only have one of them at a time, they're really fragile and non-waterproof. What I'd like would be to leave my SIM at home, preferable inside of a hardware SIP gateway from Aliexpress, and proxy those prompts through a Telegram bot.
- ponas 5y agoYou might want to take a look at the BankID app, which doesn't depend on functionality in the SIM card. Link in Norwegian: https://www.bankid.no/privat/bankid-app/ https://www.bankid.no/privat/bankid-app/
- kaivi 5y agoIt doesn't work with my bank unfortunately, and it does not seem to replace "BankID on mobile".
- sgt 5y agoOh, thought all the banks supported that :)
- codetrotter 5y agoIf you get another bank to issue BankID to you, then you may be able to ask your current bank that you may log in using that BankID. And this way you may perhaps be able to use the app instead. Maybe.
- villgax 5y agoMore than this what I want is complete control over sending audio to my mic. Apart from the Phone app I don't think there's any way to intercept a call with a default message or anything else. Only the Pixels with that Assistant can do this on Android AFAIK.
- eric4smith 5y agoVery neat - we were looking for something like this for a while now.
- tangoalpha 5y agoI had once run a campaign where we had published a number, and we had to collect all responses to an advertisement sent to that number, to be pushed to a web system. Didn't buy one of those phone numbers from an SMS API. Had good success with Tasker Android app. https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en_IN&gl=US https://play.google.com/store/apps/details?id=net.dinglisch.... (This was in 2012-13. Not sure if Tasker can do these things today what it could do in 2012, due to increased security limitations in Android) Had a rule configured in Tasker to call a HTTP end point with the sender details. received timestamp and the text message content, whenever a message was received on the android phone. Didn't have to write any code and could get it done in the Tasker app UI, as it had all the variables/tokens available and I just had to form the endpoint link to be pinged with those variables in the request. A similar thing might be possible with Tasker or similar apps to do the other way round (ie, having the phone send an SMS via mobile network in response to a ping from another device on the wifi network)
- ShakataGaNai 5y agoHeh. That sounds very familiar. In my IT department, about the same time, we wanted MFA on our admin accounts for services and generally SMS was the only way to do it. But how do you SMS MFA for a team of 5 or 10 people? Well, we used an android phone velcro'd to the wall running tasker and some custom server side scripts. Even though we could have used Twilio, we chose to do it this way because a lot of services filtered for VOIP numbers and refused to setup MFA on them. So we needed a real honest-to-god number which was extremely annoying. Team member wrote up a short blog entry about it: https://obviate.io/2015/04/16/making-of-the-mfa-phone-because-twilio-is-too-easy/ https://obviate.io/2015/04/16/making-of-the-mfa-phone-becaus...
- antirez 5y agoTo the authors: for the new user, your project is 90% your README, do this last 1% of work if you really care about your project.
- dheera 5y agoAlso it would be really nice if it intergrated with ngrok. Phone IP can change randomly.
- brtknr 5y agoIs there an Apple equivalent of this?
- waterglassFull 5y agoWithout a jailbroken deceive I don't believe the APIs would be available
- psanford 5y agoI was just looking for something like this. My primary phone # is a Google Voice number. There are a hand full of providers that (1) only offer sms 2fa and (2) refuse to send sms messages to my Google Voice number (cough _Apple_). Basically every service that refuses to send to GV also refuse to send to Twilio numbers. A programmable SMS gateway plus a cheap sms only sim card seems to be my best option. I was thinking about doing this with a usb 4g card, but this might be better. Now I'd really love to see something like this that also supported programmable voice.
- kilroy123 5y agoI agree. This is extremely frustrating. One work around I found, was to also use Google Fi. Then I would use my Google Fi number, which would route to Google Hangout. Then I could get the code from there. However, Google just killed my Google Fi account because I'm abroad to much. So now I need a new workaround. If you're in the US a lot this could work for you.
- jadbox 5y agoWhy does being abroad 'too much' matter to Google Fi?
- judge2020 5y agoDid you receive a message stating why your Fi connection was terminated? Unlimited plus’s entire point is for usage while traveling https://fi.google.com/about/international-rates https://fi.google.com/about/international-rates
- hi41 5y agoCan someone please explain what a gateway means i simple terms? When I think of a gateway, I generally visualize it as a door to a home. In software what is a gateway and what does it do?
- xethron 5y agoHi @hi41, this is almost the same in computer terms. This app opens up a "door" or a "path" for another application on the network to send and receive SMS's via your Android phone. So you could have software on your computer, that uses the gateway on your phone, to send and receive SMS's.
- hi41 5y agoThank you for your response. How is this different from a port which is used for communication over tcp/ip? Isn’t a port used for another client to connect.
- Moru 5y agoA port is a destination. The gateway is the program listening on this port and rerouting requests elsewhere. Usually after adjusting for something or simplifying talking to old/new equipment/services. Internet is just one way of communication. Often a gateway enables talking between different communication ways.
- godmode2019 5y agoThis is really great I have been looking for something like this, I built something similar but it used android debug bridge and a webserver on the laptop the device is tethered to. But I always wanted it as an android app. Anyone know any similar projects?
- nir 5y agoI built one, way back (I'm not an Android dev, kind of hacked it together but on the positive side it's extremely simple: https://github.com/niryariv/KalSMS https://github.com/niryariv/KalSMS ) At the time there were a lot of developing countries projects using SMS as their main interface (a lot of work with community health workers etc). Orgs like the UN would set up an SMS gateway by hooking a desktop with some hardware, and of course it would be very vulnerable to stuff like power outages, someone tripping over the wires etc and you had to get the technician to set it up again. With smartphones you had the all the required setup in one cheap, small and very durable package, no training required to operate.
- Jnr 5y agoThis looks nice. I have previously used Traccar GPS tracking system. Will definitely give this a try at some point. Currently I am using gammu-smsd with a simple forwarding script (through Pushover) to deliver messages for my 2nd number. For hardware I'm using older 3g/4g network USB stick plugged in my home server.
- Lukas_Skywalker 5y agoThere is also SMSHub (https://github.com/juancrescente/SMSHub https://github.com/juancrescente/SMSHub) which, as far as I see, does the same but additionally is able to deliver incoming messages to an API endpoint.
- simmo9000 5y ago'Back in the day' this was done by using a serial cable attached to a Nokia 3810 or similar handset and speaking AT commands. Gnokii was the tool... https://en.wikipedia.org/wiki/Gnokii https://en.wikipedia.org/wiki/Gnokii It was great for out-of-band network monitoring.
- markstos 5y agoI did this. Bought a Motorola RAZR on eBay, plugged into a FreeBSD box and called it a GSM modem. Since we were monitoring if the network was down among other things, the pages would go out through the "GSM modem" since the fiber connection couldn't be relied on to be up. Paid like $10/month for a text-only phone plan. Worked great. The USB connection to the FreeBSD server keep the "GSM modem" continuously charged as well.
- thepra 5y agoThere's something fishy: 1) at the download apk page it does talk about GPS tracking... 2) the apk in the file name has "noAnalytics" but when fired up there were found references to analytics and Google connections
- ransom1538 5y agoOk. I spent a lot of research doing this. You can use unlimited text plans and do quite well. Certain carriers will block you quicker than others. As long as you are sending out SMS with a link so you can monitor the click rate - then you can disable that device from sending. If you disable that device for a few hours the carriers will let you start sending again. There are carriers that do not require an id for pay as you go sim cards with cash. With android you can also read the messages to and even respond to STOPS or add response conversations. Verizon seemed to be the best. I was able to beat twilio for mass sms in pricing - but due to the carriers blocking a high percentage %10+ it isn't a good solution for 2fa etc. I have built apple labs too. Apple imessage used to allow quite a few messages before a block - but now they just block the entire device not the sim making it useless. I had the devices just use a get request to check a queue in mysql. my lab: https://i.imgur.com/gKknrJn.jpg https://i.imgur.com/gKknrJn.jpg
- rsync 5y agoI send more than half of my SMS from the UNIX command line and don't touch a phone at all. I have 'sms' shortcuts defined as shell aliases and those aliases call 'curl' commands that hit twilios endpoint and fire off the SMS from my "mobile number" which is, of course, a twilio number. So I can SMS people while flying on a plane or abroad without a proper SIM card ... or at my house where I have no mobile coverage.
- Livioso 5y agoBuilt something similar that runs on a Raspberry Pi: https://github.com/livioso/smack https://github.com/livioso/smack
- canada_dry 5y agoAs an aside: I use voip.ms sms api to send/recv text messages. Works great.
- binkHN 5y agoWhile this is neat, you’ll be in for an uphill battle with the Google Play Store if you need the permissions listed in its derived project at https://github.com/klinker41/android-smsmms https://github.com/klinker41/android-smsmms. I developed an app to automate SMS text messages and getting Google’s approval to send SMS messages was more difficult than writing the actual app.