exec_cmd

To send a method to a unit, use the unit/exec_cmd request.

Copied!
svc=unit/exec_cmd&params={"itemId":<long>,
			  "commandName":<text>,
			  "linkType":<text>,
			  "param":<text>,
			  "timeout":<uint>,
			  "flags":<uint>}

Parameters

Name Description
itemId Unit ID.
commandName Command name.
linkType Link type (see update_command_definition).
param Parameters (if necessary).
timeout Timeout for the command to be in the command queue, in seconds.
flags Flags for selecting a phone number to execute the command:
  • 0 — use any (primary, then secondary);
  • 0x1 — use primary;
  • 0x2 — use secondary;
  • 0x10 — send param in JSON format.

Response

If the request is completed successfully, an empty response is returned.

Copied!
{}	

Otherwise, an error code is returned.

Error codes

Error code Description
5 Failed to execute the command.
7 Failed to fetch the unit because the user doesn’t have the required access right (ADF_ACL_AVL_UNIT_EXEC_CMDS).

If you find a mistake in the text, please select it and press Ctrl+Enter.

Report a mistake

Your message was sent. Thank you!

An error occurred while submitting the form

See also