To send a command to a unit, use the request unit/exec_cmd:
svc=unit/exec_cmd¶ms={"itemId":<long>, "commandName":<text>, "linkType":<text>, "param":<text>, "timeout":<uint>, "flags":<uint>}
Name | Description |
---|---|
itemId | unit ID |
commandName | command name |
linkType | link type (see Commands: create, edit, delete) |
param | parameters (if necessary) |
timeout | timeout for command to wait in commands queue, in seconds |
flags | flags for choosing phone number to execute command: 0 - use any (primary, then secondary), 0x1 - use primary, 0x2 - use secondary. 0x10 - send param in JSON format |
{} /* empty object if execution successful, if not - error code */
|