/** * Execute the console command. * * @param TwilioInterface $twilio * @param GitHubService $gitHubService * @param UserService $userService * @return mixed */ public function handle(TwilioInterface $twilio, GitHubService $gitHubService, UserService $userService) { $users = $userService->getUsers(); foreach ($users as $user) { if (!$gitHubService->checkContribution($user->name) && $user->phone_number !== 'tmp') { $twilio->call($user->phone_number, function ($message) { $message->play('http://saborunayo.sota1235.net/sounds/shinchoku.mp3', ['loop' => 2]); sleep(1); }); } } }
/** * Execute the console command. */ public function fire() { $this->line('Sending SMS via Twilio to: ' . $this->argument('phone')); // Grab the text option if specified $text = $this->option('text'); // If we havent specified a message, setup a default one if (is_null($text)) { $text = 'This is a test message sent from the artisan console'; } $this->line($text); $this->twilio->message($this->argument('phone'), $text); }
/** * Execute the console command. * * @return void */ public function fire() { $this->line('Creating a call via Twilio to: ' . $this->argument('phone')); // Grab options $from = $this->option('from'); $url = $this->option('url'); // Set a default URL if we havent specified one since is mandatory. if (is_null($url)) { $url = 'http://demo.twilio.com/docs/voice.xml'; } $this->twilio->call($this->argument('phone'), $url, array(), $from); }
/** * @param string $to * @param string|callable $message * @param array $options * @param string $from * * @return \Services_Twilio_Rest_Call */ public function call($to, $message, array $options = [], $from = null) { $this->logger->info(sprintf('Calling %s', $to), $options); return $this->wrapped->call($to, $message, $options, $from); }