bogkonstantin / android_income_sms_gateway_webhook Goto Github PK
View Code? Open in Web Editor NEWSimple Android incoming SMS to URL forwarder
License: MIT License
Simple Android incoming SMS to URL forwarder
License: MIT License
Latest version of the app on the Android 12 sends pretty clear headers but the "Body" is empty (payload)
The app could also become an outgoing SMS gateway for local setups (local WiFi network) by proposing a HTTP(s) socket interface to send an SMS.
For security this functionnality could be secured by:
In what format gateway send data to server?
$_POST, $_GET etc are all empty.
I'm using PHP on server side, and this apk loads PHP file when there is new SMS in phone.
But I can't get message text out from reguest.
If these informations are somewhere in documents ... I couldn't find it ..
Like #48, add a button to test the settings to ensure the JSON parameters are set correctly
It would be great to be able to configure MAX_ATTEMPT in the settings.
If 0 is defined it will try indefinitely. The data: receivedStamp and sentStamp can be used to filter out stale messages in the backend.
It would be handy for some use cases when not only SMS, but also the notifications could be forwarded in the same manner.
Hello Sir,
I just tested your app and I appreciate your effort for the community .
I am creating my college project and this is the what i was looking for.
Can you please share PHP script file to access the msg data we get on website ?
I will really thankful to you.
Regards.
Hi bro,
I want to send an SMS if some time internet disconnect. or app closed, or mobile OFF. any case message will be not missed, when we open the app again, the previous SMS will developer as soon as possible. and some time you send SMS to web but, website can be temporary close, that's why get response from website also.
Can we customize or allow for different type of date?
With my other app they only access date format as follow: YYYY-MM-DD HH:MM:SS
Currently the App is using Unix time which is good but I can't seem to convert it to a different format (ie. the above format).
PS: Thank you for creating this App!
Thank a lot for the app, it's pretty cool!
That would be very useful if we could filter on sender and/or on SMS content.
Ex: forward all SMS containing keyword XYZ
Ex forward SMS from sender ABC and containing keyword XYZ
Could you add that?
Hi bogkonstantin,
first of all, thanks for creating this wonderful tool, I use it daily.
Recently, I have been trying to use your app with Microsoft Teams Webhook API. I found that this API and other APIs as well as some HTTP servers (Apache) have issue with Transfer-Encoding: chunked.
In my case, Microsoft's servers simply respond with: 400 Invalid webhook request - Empty Payload.
If it is not too complicated, I think a simple change could make the app compatible with even more server configs and solutions:
Removal of Transfer-Encoding: Chunked, inclusion of Content-Length header.
Footnotes:
Apache issue: https://www.jeffgeerling.com/blog/2017/apache-fastcgi-proxyfcgi-and-empty-post-bodies-chunked-transfer
How to set up a webhook in Teams: https://sankalpit.com/plugins/documentation/how-to-get-channel-webhook-url/
Curl snippet that is closer to the actual request the app sends:
curl -ivsS --trace --request POST 'http://testurl/path' --header 'Content-Type: application/json; charset=utf-8' -H 'Transfer-Encoding: chunked' --data '{"text":"sms text"}'
Thanks,
Peter
Not sure if this is a bug, intended, or App permission restriction but the %from% use Phone Number only. Can you add in a %contactname% or something similar?
Thank you.
Took me a while to understand why my post var was empty, it is because of the json type! I think would be nice to add in the doc that you have to decode it manually in php script. Or include an example:
<?php
$_POST = json_decode(file_get_contents('php://input'), true);
$text = "N/A";
if(isset($_POST["text"])){
$text = $_POST["text"];
}
$from = "N/A";
if(isset($_POST["from"])){
$from = $_POST["from"];
}
mail ( "[email protected]", "from ".$from, $text);
echo "OK";
?>
It would be useful to have a way of referring to the phone number or message in the URL used for the webhook (something like $PHONE and $MESSAGE). This way it would be trivial to make it send a message to something like Telegram messenger.
Both variables should create URL encoded data so they're usable.
Oppe A54s as phone, dual sim slot
Sim 1 forwards perfectly incl the payload in the settings
Sim 2 does not do any request to the webserver at all
The messages are visible on the phone message app for both sims.
@bogkonstantin any ideas?
When I run this apk it works fine upto 10-20 minutes..
But it should run continue in background process..
Hi,
The program works quite stable for me. Good work!
It would be very appreciated to implement CONTACTS lookup for the sender Name, and provide %fromName% placeholder for Payload Template.
Please provide PHP API file
Hi, thanks for your app, it solved my 'pain'.
There is a question/suggestion.
Is it possible to add interception of Push notifications?
I know IFTTT can do this, but it's really annoying that the data is pulled through their servers.
I understand that this does not fit the name of the application, but it seems to me it is possible to add this feature optional.
Would help a lot if beside the DELETE button, we'd have a TEST button which would send dummy data to the webhook. Otherwise great work, thanks!
Summary: I am not getting the notifications, everything seems to be set up correctly
Can outgoing SMS be forward as well?
that would be cool if the webhook could've been edited.
if i type the webhook url wrong, for example, i have to delete it and create it again, that would be great if an edit button existed.
Hi, would it be possible to add an option to only forward sms from a speicifc sms card (1 or 2)?
Thank you
Hi,
I have configured the webhook URL as per your instructions but still not getting any data on the URL.
Can you please help me
how to receive at webserver
hi
your json format on multi line text is not valid
please review it
%text%
for example this is wrong
"first line
second line"
it should be like this :
"first line\nsecond line" ( this is true )
Hi, thanks for open sourcing this.
I have an endpoint on Supabase Edge Functions and it is secured by an auth token. What do you think about adding an optional Authorization
header field to the modal?
Thanks
Once we add a webhook by clicking the blue + plus button, it shows a red DELETE text to delete it. Please add a similar PAUSE text which, on clicked, will keep the webhook data but will not send any data until it is clicked again.
On clicking the PAUSE, the webhook is paused & button text is changed to RESUME.
It should ask for confirmation on each click.
Do you want to pause sending SMSs to this webhook? | Do you want to resume sending SMSs to this webhook?
I've developed PHP backend that works perfectly with curl test, but when I'm trying with an Android Phone, nothing occurs on SMS arrival.
What can I check?
When "Chat features" for messages app is on in the source device, some messages may be recieved this way.
Some details on how to do this:
https://stackoverflow.com/questions/75482120/how-to-retrieve-rcs-messages-from-android-devices
If possible, please add methods for adding custom JSON fields and headers for sending security tokens and id information, like:
{
from: "Bob",
text: "Received text",
token: "f4398fqp9384urpa984", // this is custom field set by user
someid: "2345293845298347502987" // another one field set by user
}
also possibility of setting POST or GET type will not be superfluous
On an Android 7 platform at every ~two days, the app stop working (the tablet is permanently plugged in so there aren't battery issues). SMS are received by the tablet but the app doesn't forward it. Do you have any idea how to debug this behavior and how to fix it?
If for some reason my phone does not have a network, then when the network comes, the messages that have not been forwarded should be forwarded.
I used to have this working on my old Samsung Galaxy phone. I tried it on a new Walmart Tracfone Samsung A13 (which, instead of SMS and MMS, it has now this new RCS technology), and it's not forwarding. I tried the webhook.site like you recommended for troubleshooting, and doublechecked the sending URL, and that didn't help. I also rebooted my phone and did more tests and it's not sending anything.
The APK attached to releases lacks Jar signatures (v1 signing). Up to Android 7 (SdkVer 24), only v1 signing was known โ so this APK cannot installed on such devices despite having minSdk set to 19. So when signing (I assume you're using v2 or v3 sigs), please make sure to include "lower" signatures as well โ at least down to what's available at the specified minSdk.
If you could replace the latest APK with a properly signed one, that would be very much appreciated. Thanks in advance!
I love this app and it's simplicity, thank you for your work. I run it on multiple devices and I can't tell which device messages were sent to. It would be nice to have a to field included in the JSON message. If it is difficult to get the information from android, then it could be a config value instead. Just a suggestion. Thanks again.
Hi
I used this program: https://sms.envaya.org/serverapi/, but because the old Android version 2.3 can't handle SSL anymore I have tried your program. It works great.
Could you implement more data points?
version:
To monitor when an update is due.
network:
Whether the phone is connected to WiFI or mobile.
battery:
The current battery percentage.
power:
What power source. To monitor if the power has been disabled.
If this could be combined with the this request: #31 then monitoring of the devices health is easy. My proposal to use HEAD would not suffice though. A specific monitoring endpoint would needed to be provided.
When adding two configurations with different chat_id, only the last one is triggered.
#config1
number: +123456789
https://api.telegram.org/botXXXXXX/sendMessage?chat_id=XXXXXX
{"text":"%text%"}
#config2
number: +123456789
https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY
{"text":"%text%"}
I need to send sms through one bot to different bot users. How to fix it? (version 2.2.3)
According to a quick google search, google really dislikes the idea of http requests so by default they're blocked and require some manifest changes to work, this is the long from logcat:
06-08 16:13:11.725 17927 20254 E SmsGateway: Exception java.io.IOException: Cleartext HTTP traffic to redacted_ip not permitted
Would be nice - if possible - mute all matched SMS messagages, so the mobile does not beep, and optionally delete them upon forwarding. Thanks!
I didn't find docs on this, but other apps have done this.
It'd be nice if information about which SIM received an SMS.
It'd be great if json payload key names can be customisable instead of the default {"from":"1234567890","text":"Test"}
.
A lot of existing webhooks require different json key names, e.g. {"key1":"1234567890","key2":"Test"}
Or accept only one key-value pair , e.g. {"key":"value"}
Normally, a sms consist of 160 characters, for carrier sms counting purposes, and also in old phones. But all new phones are capable of displaying longer than 160+ characters sms as one msg.
This app should also not split the msg at 160 characters length; & instead should send all complete sms as one request.
For longer msgs, I receive multiple requests from app to my server, all with text at maximum 160 characters length.
Note that many Unicode characters are counted as 2+ character.
When I receive a message in Arabic, it splits the message and sends it to the API into several messages and not as a single message
To add more fields with other data from SMS arrival:
Sent date/time
Received date/time
SIM/Recipient number
from an android 11 device I am only able to receive the following payload but it seems to come with no body
{
"headers": {
"Connection": "Keep-Alive",
"Transfer-Encoding": "chunked",
"Accept-Encoding": "gzip",
"Host": "myurl.com",
"User-Agent": "SMS,Forwarder,App",
"Content-Type": "application/json; charset=utf-8",
"Content-Length": "0"
}
}
any help would be amazing!
As i see you have implement 10 retries after 10 retries please show,
400 SMS Failed,
Click here try again failed message.
When we will click on the button, all failed messages will resend.
SMS should never fail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.