Last active
December 11, 2015 14:09
-
-
Save TMcManus/4612652 to your computer and use it in GitHub Desktop.
This script is meant to be placed at the target of Twilio's <Dial action="" record="true"> parameter. It will email you the recording of the call. It's the voice version of this script:
http://www.twilio.com/help/faq/sms/how-can-i-forward-sms-to-my-email-inbox
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
| <?php | |
| /** | |
| * This section ensures that Twilio gets a response. | |
| */ | |
| header('Content-type: text/xml'); | |
| echo '<?xml version="1.0" encoding="UTF-8"?>'; | |
| echo '<Response></Response>'; //Place the desired response (if any) here | |
| /** | |
| * This section actually sends the email. | |
| */ | |
| $to = "your-email@example.com"; // Your email address | |
| $subject = "Call from {$_REQUEST['From']} at {$_REQUEST['To']}"; | |
| $message = "You have received a message from {$_REQUEST['From']}. | |
| Recording: {$_REQUEST['RecordingUrl']}"; | |
| $headers = "From: webmaster@example.com"; // Who should it come from? | |
| mail($to, $subject, $message, $headers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment