Created
May 26, 2015 11:26
-
-
Save bran921007/d973a8623b6a6beae86e to your computer and use it in GitHub Desktop.
Twilio function backend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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