![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/vendor/aloha/twilio/src/Commands/ |
<?php namespace Aloha\Twilio\Commands; use Aloha\Twilio\TwilioInterface; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; class TwilioCallCommand extends Command { /** * The console command name. * * @var string */ protected $name = 'twilio:call'; /** * The console command description. * * @var string */ protected $description = 'Twilio command to test Twilio Call API Integration.'; /** * @var TwilioInterface */ protected $twilio; /** * Create a new command instance. * * @param TwilioInterface $twilio */ public function __construct(TwilioInterface $twilio) { parent::__construct(); $this->twilio = $twilio; } /** * Execute the console command. */ 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, [], $from); } /** * Proxy method for Laravel 5.1+ */ public function handle() { return $this->fire(); } /** * Get the console command arguments. * * @return array */ protected function getArguments() { return [ ['phone', InputArgument::REQUIRED, 'The phone number that will receive a test message.'], ]; } /** * Get the console command options. * * @return array */ protected function getOptions() { return [ ['url', null, InputOption::VALUE_OPTIONAL, 'Optional url that will be used to fetch xml for call.', null], ['from', null, InputOption::VALUE_OPTIONAL, 'Optional from number that will be used.', null], ]; } }