コード例 #1
0
 /**
  * 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';
     }
     \Twilio::call($this->argument('phone'), $url, array(), $from);
 }
コード例 #2
0
ファイル: TwilioVerify.php プロジェクト: j42/laravel-twilio
 protected function sendCall($phone, array $token)
 {
     $responses = \Twilio::call(['to' => $phone, 'twiml' => Config::get('laravel-twilio::twiml') . '/twilio/verify/twiml?code=' . $token['token']]);
     // Update Model
     if ($responses[$phone]->status === 'queued') {
         $this->phone = Cookie::get('twilio::phone');
     }
     // Respond w/ 2 Minute TTL
     return $this->respond(['phone' => $phone, 'status' => isset($responses[$phone]) ? $responses[$phone]->status : null], 200)->withCookie($token['cookie']);
 }