Created
March 26, 2012 20:51
-
-
Save reneighbor/2209574 to your computer and use it in GitHub Desktop.
Calling Card App
This file contains 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 | |
header("content-type: text/xml"); | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
?> | |
<Response> | |
<Gather action="handle-input.php" method="POST"> | |
<Say>Thanks for using the phone card app. Please dial the number you'd like to call. Dial the area code and full seven digits.</Say> | |
</Gather> | |
</Response> |
This file contains 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 | |
if (preg_match('/^\d{10}$/', $_REQUEST['Digits'])) { | |
include("inbound-call.xml"); | |
} else { | |
include("dial-input.php"); | |
} |
This file contains 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 | |
header("content-type: text/xml"); | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
?> | |
<Response> | |
<Dial>$_REQUEST['Digits']</Dial> | |
<Say>The call failed or the called party hung up. Goodbye.</Say> | |
</Response> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment