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
---- Setting up this script ---- | |
1) Upload these files to a location that is publicly accessible on the internet. | |
2) Enter the URL of the file named "index.xml" into the Voice Request URL of the number you want to setup. |
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 script requires a Twilio Account and the Twilio PHP Helper Library, | |
* which can be found at http://www.twilio.com/docs/libraries | |
*/ | |
// Require Twilio Helper Library | |
require('Services/Twilio.php'); |
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 function will take a number in a variety of formats and reformat | |
* the number to be in E.164 format. Currently this is really, really ugly, | |
* but it works. substr() based function might also work. Currently US only. | |
*/ | |
function normalizeNumber($number) { | |
$number = trim($number); | |
$number = preg_replace("/[^A-Za-z0-9]/", '', $number); |
NewerOlder