Created
February 25, 2013 18:43
-
-
Save caseysoftware/5032171 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'; | |
| /** | |
| * Now we'll combine Revision 3 with an interface to put some fine-grained | |
| * control of the white and blacklists via SMS. | |
| */ | |
| $from = preg_replace("/[^0-9]/", "", $_POST['From']); | |
| $body = preg_replace("/[^a-z0-9\ ]/", "", trim(strtolower($_POST['Body']))); | |
| $message = process_command($body); | |
| $response = new Services_Twilio_Twiml(); | |
| if ($toPhone == $from) { | |
| $response->sms($message); | |
| } | |
| print $response; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment