public function client(Client $client) { parent::client($client); $func = 'sendSms'; if ($this->option('pdu')) { $func = 'sendPdu'; } call_user_func([$this, $func]); }
public function client(Client $client) { parent::client($client); $this->info('starting listen ami'); if ($this->option('monitor')) { $client->on('event', [$this, 'eventMonitor']); } $client->on('close', function () { // the connection to the AMI just closed $this->info('closed listen ami'); }); $client->on('event', [$this, 'eventEmitter']); $this->dispatcher->fire('ami.listen.started', [$this, $client]); }
public function client(Client $client) { parent::client($client); $arguments = $this->option('arguments'); $arguments = is_array($arguments) ? $arguments : []; $options = []; foreach ($arguments as $value) { $array = explode(':', $value); if ($key = Arr::get($array, 0, null)) { $value = Arr::get($array, 1, ''); $options[$key] = $value; } } $this->request($this->argument('action'), $options)->then([$this, 'writeResponse'], [$this, 'writeException']); }
public function client(Client $client) { parent::client($client); // client connected and authenticated $this->info('starting ami cli interface'); $command = $this->argument('cli'); if (!empty($command)) { $this->sendCommand($command); } else { $this->writeInterface(); } $client->on('close', function () { // the connection to the AMI just closed $this->info('closed ami cli'); }); }