SMS text via DWR-921 4G LTE Router - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: SMS text via DWR-921 4G LTE Router (/showthread.php?tid=103) |
SMS text via DWR-921 4G LTE Router - gtsamis - 10.10.2015 Hello, Has anyone tryied to use the Dlink DWR-921 4G LTE Router as SMS gateway for LM? It only has a web interface and i haven't being able to find any API. RE: SMS text via DWR-921 4G LTE Router - admin - 12.10.2015 Sending SMS should be possible via a HTTP request from LM. You just need to know the correct URL and GET/POST variables. You can view the full request in your browser developer tools by pressing F12 and switching to Network tab. RE: SMS text via DWR-921 4G LTE Router - gtsamis - 14.10.2015 I am a bit stuck here I have managed to trace the login and send sms URLs but I can't replicate them outside the routers web interface. Is seems to authenticate with the login URL but when i post the send sms URL i got the OK reply but the message never sends. I have attached the HTTP posts/replies from routers web interface that used in order to login and send a test sms. Quote:Line 243 Any help would be much appreciated. RE: SMS text via DWR-921 4G LTE Router - admin - 15.10.2015 Have you tried sending these requests from your browser or from LM? RE: SMS text via DWR-921 4G LTE Router - gtsamis - 16.10.2015 (15.10.2015, 07:28)admin Wrote: Have you tried sending these requests from your browser or from LM? First off all i figure out that it needs a third post in order to send the sms (GET http://192.168.16.1/sms2.htm?Ncmd=2) I have tested it from several browsers and from LM and it works just for the first time. I think it has to do with cookies... On my http sniffer i get some changes everytime i login on routers web interface. The header has a definition "cookies" (AMSESSIONID) that changes in every session. Now I think i need a way to grab that AMSESSIONID and use it on further requests. Code: Accept: */* Code: Accept: */* RE: SMS text via DWR-921 4G LTE Router - admin - 16.10.2015 Your first request to login URL should look like this: Code: res, code, hdr = socket.http.request('http://...') All further requests must pass the cookie received from the first request: Code: res = socket.http.request({ |