Skip to content

Instantly share code, notes, and snippets.

@bran921007
Created May 26, 2015 11:26
Show Gist options
  • Save bran921007/d973a8623b6a6beae86e to your computer and use it in GitHub Desktop.
Save bran921007/d973a8623b6a6beae86e to your computer and use it in GitHub Desktop.
Twilio function backend
Backend:
1) Alternativa
public function twilio($carpeta, $sonido){
$twiml = new Services_Twilio_Twiml();
// $twiml->say('hola', array('voice' => 'alice'));
$twiml->play('http://104.236.236.57/sounds/'.$carpeta.'/'.$sonido.'.mp3');
$response = Response::make($twiml, 200);
$response->header('Content-Type', 'text/xml');
return $response;
}
-----------------------------------------------------
2) Alternativa
Route::match(array('GET', 'POST'), '/incoming', function()
{
$twiml = new Services_Twilio_Twiml();
$twiml->say('Hello - your app just answered the phone. Neat, eh?', array('voice' => 'alice'));
$response = Response::make($twiml, 200);
$response->header('Content-Type', 'text/xml');
return $response;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment