Trying to test Twilio to migrate from Tropo, We alreaddy installed the libraries and tested sucessfully quickstart example https://www.twilio.com/docs/voice/quickstart/php. But got stuck trying to do a call and play a mp3 file.
Having next PHP function:
public function call_twilioAction(){
$account_sid = '******************************';
$auth_token = '*****************************';
$twilio_number = "NUMBER";
// call to my office
$to_number = "NUMBER";
$client = new Client($account_sid, $auth_token);
$client->account->calls->create(
$to_number,
$twilio_number,
array(
"url" => "https://arantec.smartyplanet.com/twilo/voice.xml"
);
return $this->render('::base.json.twig', array("data" => array()));
}
And inside the voice.xml file:
<Response>
<Play>https://arantec.smartyplanet.com/twilo/Smartyalert_es.mp3</Play>
</Response>
As you can check, both files (xml, mp3) are accessible from internet, and are in the same called function host, where is the problem?
Still getting the error:
Twilio\Exceptions\EnvironmentException: (uncaught exception) at Twilio/Http/CurlClient.php line 41
Thank you!!
NUMBER
values are just placeholders and you have valid phone numbers there? – Cody Caughlan<?xml version="1.0" encoding="UTF-8"?>
– Cody Caughlan