Last active
December 14, 2015 04:09
-
-
Save caseysoftware/5026167 to your computer and use it in GitHub Desktop.
You can view this file in context here: https://github.com/caseysoftware/upgrading-google-voice-with-Twilio
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 | |
| include 'functions.php'; | |
| header("Content-type: text/xml"); | |
| $filter = "!@#$^&%*()+=-[]\/{}|:<>?,."; | |
| $recording = preg_replace("/[$filter]/", "", $_POST['RecordingUrl']); | |
| $duration = (int) $_POST['RecordingDuration']; | |
| $from = preg_replace("/[^0-9]/", "", $_GET['From']); | |
| $subject = "You have a new voicemail from " . $from; | |
| $body = "You received a $duration second voicemail." . | |
| "\n\nHere is the recording: " . $recording; | |
| mail($toEmail, $subject, $body); | |
| $response = new Services_Twilio_Twiml(); | |
| $response->hangup(); | |
| print $response; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment