Unable to receive flash (Class 0) SMS on Modem - sms

I am experiencing with AT commands using a sim800 modem (Dinstar), I am unable to get the response of the STK command after STK send short message.
When using my phone, the process goes as follows:
Start the STK app
Navigate through the STK menu to the option I want
Input data (phone number, amount)
Confirm the choice
The phone then shows (Loading...), then after 5 seconds, the STK app shows a message informing the user if the operation was successful or not.
My problem is while using the modem, I am not able to see the message informing the user if the operation was successful or not.
Here are the AT commands used with the result of each one:
at+stktrs=00,01
OK
+STKPCI: 0,SELECT ITEM,2,526563686172676520636C69656E74
+STKPCI: 0,ITEM,1,01,526563686172676520636C61737369717565
+STKPCI: 0,ITEM,2,02,4175747265207363056E6172696F206465207265636861726765
at+stktrs=00,01
OK
+STKPCI: 1,TIMER MANAGEMENT,01
+STKPCI: 0,GET INPUT,4,04456E7472657A206C6520636F646520636F6E666964656E7469656C203A0D0A362063686966667265732028302D3929,06,06
at+stktrs=00,01313131313131
OK
+STKPCI: 1,TIMER MANAGEMENT,01,00,01,00
+STKPCI: 0,GET INPUT,0,04456E7472657A206C65206E756D05726F2064652074056C0570686F6E6520636C69656E74203A0D0A31302063686966667265732028302D3929,0A,0C
at+stktrs=00,0130363535353535353535
OK
+STKPCI: 0,GET INPUT,0,04456E7472657A206C65206D6F6E74616E74206465206C61207265636861726765203A0D0A28302D3929,01,05
at+stktrs=00,0135
OK
+STKPCI: 0,DISPLAY TEXT,129,04566F756C657A2D766F757320767261696D656E7420726563686172676572206C6520636C69656E7420363535353535353535207F2068617574657572206465202064697268616D73203F
at
OK
at+stktrs=00
OK
+STKPCI: 1,SEND SHORT MESSAGE,5472616974656D656E7420656E20636F7572732E2E2E,0,0101038154F5000410E18B8FBAC72115E05B54866E5C667593
at+stksms=0
OK
+STKPCI: 2
+STKPCI: 0,PLAY TONE
After this, nothing is sent from the modem even after a long time.
the +STKPCI SEND SHORT MESSAGE in my opinion sends the Short message. I also do not know what 0101038154F5000410E18B8FBAC72115E05B54866E5C667593 means, in the docs, this should be the SMS tpdu but I am not able to decode/parse it. I need to be able to send the STK SMS without browsing through the menu over and over again.
FYI, I am connecting to the modem via a TCP socket and not a serial connection, the modem I'm using is a Dinstar UC2000-VE.
EDIT: After using the at command AT+STKSMS=0, I am able to receive the topup on my phone, but nothing is shown on the gateway side. When I am using the phone, I am able to see a confirmation message after the tone stating if the operation was successful or not.
EDIT 2: I am adding another simple example which requires no user input but the confidential code: getting user balance, same problem the request is executed I am able to see the loading... message but nothing is returned after, while using the phone I am able to see my balance after the loading... message. Here are the AT commands executed:
at+stktrs=00,03
OK
+STKPCI: 1,"D00C810301270282028182240101"
+STKPCI: 0,"D03F8103012304820281828D3004456E7472657A206C6520636F646520636F6E666964656E7469656C203A0D0A362063686966667265732028302D392991020606"
at+stktrs=00,01313131313131
OK
+STKPCI: 1,"D0118103012700820281822401012503000100"
+STKPCI: 1,"D03C81030113008202818305165472616974656D656E7420656E20636F7572732E2E2E0B190101038154F5000410ED69EC90113BCA7F71B9E5ED07BB7935"
This string D03C81030113008202818305165472616974656D656E7420656E20636F7572732E2E2E0B190101038154F5000410ED69EC90113BCA7F71B9E5ED07BB7935 shows the Loading message but nothing is received after.

After thoroughly looking into this. I found a solution that is working as expected but a little bit weird.
After sending the STK short message and receiving the play tone STKPCI
at+stksms=0
OK
+STKPCI: 2
+STKPCI: 0,PLAY TONE
Sending an AT+STKTRS=10 seems to get the DISPLAY TEXT STKPCI, according to the manual, STKTRS '10' = Proactive SIM session terminated by the user.
Now it looks something like this:
at+stksms=0
OK
+STKPCI: 2
+STKPCI: 0,PLAY TONE
at+stktrs=10
OK
+STKPCI: 0,DISPLAY TEXT,129,046F7005726174696F6E200563686F7505653A20566575696C6C657A207205657373617965722E
The display text is the result of the operation, but I don't quite understand why do I need to close the session after the +STKPCI:2 is sent, which according to the manual means 2 No other command (end of session)

Related

How to send messages to server after having connected to a websocket as client using kdb+ q

I am building a websocket client in q with the aim of connecting to cryptocurrency exchanges to receive public market data feeds in json for parsing into kdb. At this point, using this guide from KX's official knowledge base, I have managed to create a persistent websocket connection from my q process to the Kraken exchange by using stunnel as verified by a successful connection/upgrade response. My q script just defines .z.ws to show incoming messages, then connects to my local port running stunnel.
.z.ws:{0N!.j.k(x);}
h:(`:ws://127.0.0.1:5103)"GET / HTTP/1.1\r\nHost: ws.kraken.com\r\n\r\n"
My stunnel configuration looks like this:
[kraken]
client = yes
sni = ws.kraken.com
accept = 127.0.0.1:5103
connect = 104.16.212.191:443
It all seems to work because as mentioned before, my q process receives the following successfull system status confirmation.
`connectionID`event`status`version!(9.223372e+18;"systemStatus";"online";"1.7.2")
The guide says "If successful it will return a 2-item list of (handle;HTTP response)" which I also do recieve. They look like this:
(6i ;"HTTP/1.1 101 Switching Protocols\r\nDate: Mon, 08 Feb 2021 22:52:53 GMT\r\nConnection: upgrade\r\nSet-Cookie: __cfduid=d8179f7ef5db4e4e7a164dd75a492c2141612824773; expires=Wed, 10-Mar-21 22:52:53 GMT; path=/; domain=.kraken.com;HttpOnly; SameSite=Lax\r\nUpgrade: websocket\r\nSec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=\r\nuWebSockets:17\r\nCF-Cache-Status: DYNAMIC\r\ncf-request-id: 082..)
I really thought that would be the tough part and I'm feeling somewhat proud to have succeeded thus far, but now I'm finding myself stuck again.
How do I interact with the websocket now? I want to send more messages ie. subscribe/unsubscribe to specific endpoints?
The guide cited above says very clearly "To send messages, use
q)neg[handle]"text" / a char vector"
but whenever I try
q)neg[6i].j.j(`ping)
I get the following error
'Cannot write to handle 6. OS reports: Bad file descriptor
I suspect maybe I need to subscribe to certain endpoints somehow in my initial GET request, but I'd still like to be able to subscribe and unsubscribe from different endpoints freely after having connected to the websocket.
Thanks for reading, and any insight is much appreciated. This is my first time posting on stackoverflow.
Best Regards,
Ross
That error could be related to your message getting rejected. I had a quick look at the python example and it looks to expect json like this:
{"event": "ping"}
So you'd need to send something like this:
q).j.j(1#`event)!1#`ping
"{\"event\":\"ping\"}"
https://support.kraken.com/hc/en-us/articles/360022327631-WebSocket-API-Public-Feeds-Python-Code-Examples
Aqua Q has a Crypto add-on for their TorQ kdb framework which could be useful:
https://www.aquaq.co.uk/q/torq-crypto-released/
https://github.com/AquaQAnalytics/TorQ-Crypto
(Disclaimer, I work for Aqua Q)

Problem Using SMS and Internet at the same time W Telit UL865 NAD

I have no problems sending SMS in text mode with the Telit UL865 NAD
Once initialized in Text mode I then try to connect to the APN
with;
AT+CGDCONT=1... which responds OK
Then I do a AT#SGACT=1,1 ... which also responds with and IP and OK
Next step AT#HTTPCFG=0, ... to connect to the URL root. Also OK
And finally an AT#HTTPQRY=0,0, .. to GET data, which also works.
But now, I can't send SMS anymore.
Do I have to Switch modes independently or deactivate (AT#SGACT=1,0 ..) the APN connectión
before sending SMS.
What is the method used for this?
This was resolved turning off flow control with the AT&K0 command after the AT#SGACT command.
Without it communications hung and wouldn't let the modem continue

We had some trouble connecting error when submitting slack dialog (Slack API)

I am building a slack app connected with a Symfony application that uses slash commands and dialogs as UI to create new users, accounts and projects and store them in a database.
I use a slash command to trigger a dialog with input fields and store the submitted data in a database, send a 'user successfully created' message to slack as well as a 200 response with an empty body, as described in the documentation.
However, when I fill in the input fields and press submit, I receive an error message with 'We had some trouble connecting. Try again?'. This error also prevents the dialog from closing.
The submitted data is still received correctly by my application and stored to the database and the 'user successfully created'-message is also send correctly to slack. So the whole process seems to work correctly, the only problem is that the dialog doesn't close and shows the error message.
I also tried to immediately send a http 200 response, without processing the submitted data first and this gives the same error message.
In Golang, the only thing that worked was responding with status 200 and empty body:
w.Write(nil).
I am not sure which lang are you using but try responding with an empty body.
Responding with 204 did not work for me.

Freeswitch "real" response to api chat?

I'm sending an sms message like this over esl (telnet, java client, various methods all yield the same results)(numbers are all dummies):
api chat sip|13215555555#6.50.120.201|internal/2395555555#6.50.120.200|test message
This works fine with valid numbers. If we put in an invalid number somewhere we may see something like this in the sip trace indicating a problem:
U +0.745829 6.50.120.200:5060 -> 6.50.120.201:5060
SIP/2.0 484 Address Incomplete.
...
...however over the esl socket we get the same response event no matter what, just "sent". Also, when we bind to the esl port and attempt to spit out every message possible (no filters), we see most of what comes through a sip trace, but again not this bad result sip packet for some reason. It's like freeswitch is filtering out this specific packet from esl.
Is there a way over esl to probe raw sip messages so that we can test for such a packet manually, or some other way of seeking the final async result?
Thanks in advance!

Cocoa asyncsocket class problem

Hey I am making server client system with asyncsocket class for cocoa, I really don't get it, do I have to send a message to the server in order to receive something, it seems so. Server should send me a message when I connect, but I won't get anything unless I send the server a message which goes pretty strange, same applies, I have to send another message to get a message?
Here is server code, as you see it should send a message when someone connects, which it doesn't do unless I send it a message from client. See code for server
Here is code for client where I send two messages to receive messages from the server.
See client code here: http:://pastebin.com/1B7qy9R2 remove other : from link as it's my first post so no 2 link allowed :(
I either have understood the asyncsocket wrongly or there is a bug, but if someone would help it would be appericiated.
You don’t have to send data before you can receive some. This happens in your code, because you are only calling readDataWithTimeout:tag: in your onSocket:didWriteDataWithTag: delegate method.

Resources