Created
June 21, 2014 14:19
-
-
Save swalberg/c2950b8b6d679b07919b to your computer and use it in GitHub Desktop.
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 | |
// From http://ertw.com/blog/2013/11/05/using-an-ip-phone-with-twilio/ | |
// Connect an incoming call to your SIP phone through Twilio | |
$called = preg_replace('/sip:1?(.*?)@.*/', '{$1}', $_POST['Called']); | |
header("content-type: text/xml"); | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
?> | |
<Response> | |
<Dial timeout="10" record="false" callerId="YOURTWILIONUMBER"><?= $called ?></Dial> | |
</Response> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment