run_command2

March 26, 2020 Contributors

Name

run_command2 — Execute the console command referenced by a command_construct

Synopsis

#include "control.h"

| int **run_command2** ( | cc, |   |
|   | response, |   |
|   | session); |   |

command_construct * <var class="pdparam">cc</var>;
string * <var class="pdparam">response</var>;
Event * <var class="pdparam">session</var>;

Description

Execute the console command referenced by a command_construct. For a list of the available commands see Console Commands.

Parameters

cc

The command that you wish to execute. For a definition of this data type see command_construct.

response

The command response.

session

The session. For a description of this data type see event.

Return Values

Upon success this command returns EC_RUN_COMMAND_COMPLETED; upon failure, EC_RUN_COMMAND_FAILED. If session is not NULL, and some portion of the command execution needs to run asynchronously, then this function will return EC_RUN_COMMAND_AGAIN.

The complete list of return values is as follows:

#define EC_RUN_COMMAND_COMPLETED 0
#define EC_RUN_COMMAND_AGAIN     1
#define EC_RUN_COMMAND_FAILED    2
#define EC_RUN_COMMAND_NOT_AUTHZ 3
#define EC_RUN_COMMAND_NOT_AUTHN 4
#define EC_RUN_COMMAND_CONTINUE  5
#define EC_RUN_COMMAND_ASYNC     6

Threading

It is legal to call this function in the Scheduler thread.

See Also

run_command