PHPDaemon\Clients\Asterisk\Connection::action PHP Method

action() public method

For almost any actions in Action: ListCommands Privilege: depends on $action
public action ( string $action, callable $cb, array $params = null, array $assertion = null ) : void
$action string Action
$cb callable Callback called when response received
$params array Parameters
$assertion array If more events may follow as response this is a main part or full an action complete event indicating that all data has been sent
return void
    public function action($action, $cb, array $params = null, array $assertion = null)
    {
        $action = trim($action);
        $this->command("Action: {$action}\r\n" . ($params ? $this->implodeParams($params) : ''), $cb, $assertion);
    }