Gsmctl via JSON-RPC on RUT2xx

Hi Folks,

I came around some issues playing with “gsmctl” via “json-rpc” on RUT240 (FW 7.6.19) and RUT241 (FW 7.19.3):

Logging in with curl and getting a token works fine.

Checking sms-memory should be done via:
…{ “command”:“gsmctl”, “params”: [“-S -t”]}…

but only works when leaving out the space and - after -S:
…{ “command”:“gsmctl”, “params”: [“-St”]}…

Trying to send an SMS to xxxxxxxxxxxx should work via:
…“params”: [“-S -s \“xxxxxxxxxxxx Test-SMS\””] …

but it doesn’t. Also not according to the workaround above with:
…“params”: [“-Ss \“xxxxxxxxxxxx Test-SMS\””] …

What am I doing wrong?

Best regards and thanks in advance!

Hello,

If you’re passing multiple parameters (e.g.: -S, -t, etc.) - I believe the following needs to be used:

{
  "command": "gsmctl",
  "params": ["-S", "-t"]
}

Essentially, we’re treating -S and -t separately; therefore, we put them under separate quotes, divided by the comma.

Sames goes with the SMS, -S and -s together are treated as a single argument. For example, the gsmctl command would look like so:
gsmctl -S -s <number> <message>

So your JSON RPC would look like so:

{
  "command": "gsmctl",
  "params": [
    "-S",
    "-s",
    "<phone_number>",
    "Test-SMS"
  ]
}

Let me know if this helps,
M.

1 Like

Thanks Matas !

1 Like