How to decode the USSD response from 3G carrier on wAP LTE kit with r11e antenna?
All answers suggest using the Winbox sms utility but that is not what I want to do. I want to do it via the command window. Can anyone offer a solution?
I am able to send a ussd code to Vodacom in South Africa using
/interface lte at-chat lte1 input=“AT+CUSD=1,"*135#",15” wait=yes
and correctly receive an encoded response.
How can I decode that response in the command window or receive it back already decoded?
I get the same problem with Vodacom South Africa - unreadable output!
However, with MTN it works fine.
This may be an issue specific to the service provider.
My hardware is RB912 with R11e_LTE miniPCI-e card.
Sorry, in my previous post I forgot to mention that the MTN response was obtained using a different router.
That was done with a RB411u routerboard and Sierra 7710 mini PCIe LTE interface (both set to 3G only for this purpose).
When using the MTN SIM on the RB912 routerboard with R11e_LTE interface, I get the same unreadable response as with the Vodacom SIM.
Clearly this is not dependent on the Service Provider.
Both routers are running under RouterOS 6.45.1 (stable) with diitto firmware.
I have not swapped the LTE interfaces, so it could be either the routerboard or the interface…
Thanks for the reply. I cannot unfortunately confirm whether this is a carrier based issue as I have a Vodacom and a Rain sim card in the Mikrotik and Rain does not provide sms capabilities, only data connectivity.
I suspect that it is carrier based though as I am using a different rig to your setup and experience the same problem.
My setup is RBSXTR routerboard with 6.45.2 firmware, and R11e-LTE modem.
When I send the command, the response from Vodacom is:
output: OK +CUSD: 1,“31292042616c616e6365730a3229204275790a332920416c6c2034205
96f750a3429204a757374203420596f750a3529204d6f7265506f7765720a362920507
26f6d6f730a372920416476616e6365265472616e73666572730a38292053657276696
365730a39292046756e26526577617264730a3130292047657420313025206d6f72650
a31312920496e737572616e63650a2020”, 0
I do realize I’m late to the party, but do you need the Mikrotik itself to understand the USSD response (and maybe take some action based on the contents) or is it sufficient to make it human-readable?
Because the above is merely a hex-encoded ASCII, each pair of symbols 0..9,a..f represents one resulting symbol, so the translation done by any hex->ascii converter is
… do you need the Mikrotik itself to understand the USSD response (and maybe take some action based on the contents) or is it sufficient to make it human-readable?
I actually need both functions:
The Mik needs to understand the code to be able to respond to USSD message keywords correctly
The message contents need to be written to a log in human-readable form
Thanks for the pointer on the encoded ASCII, SIndy. Will see where that leads me in terms of a solution. Will also test with upgrade as Oceanmaster suggested.
Using the R11e-LTE modem with firmware version 13, and for Vodacom South Africa,
the following request gives my data balance summary without any further input required:
I have no experience with scripting - could you make a suitable script available?
A long-term solution would be to include automatic hex-ascii translation of CUSD call results in the next firmware upgrade for the R11e-LTE modem. Sierra can do it, so perhaps RB also?
I’m not a Mikrotik developer, but think about international markets. I.e. ASCII is not enough and you need Unicode, which would have to be handled by the modem (RouterOS seems to handle it already, I’ve seen comments in Arabic script in Winbox yesterday). So the hex is a safe choice. You often don’t need to actually convert the complete data from hex to ascii, you can search for a pattern in the string in hex and convert only few bytes carrying digits.
Thanks, this is better than using a conversion table!
But there is an error in the coding: It uses nested functions,
and to call another function its name must be declared.
I.e:
:global hexstr2chrstr do={
:global hex2chr;
:local hexstr $1
etc…