Last active
April 6, 2022 03:02
-
-
Save LTGIV/959d21115f26e2af31bb to your computer and use it in GitHub Desktop.
Twilio SIP Voice Receiver => Asterisk PBX
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 echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; | |
/** | |
* Twilio SIP Voice Receiver => Asterisk PBX (also works on FreePBX's Inbound Routes) | |
* (Constructive suggestions for improvement are certainly welcomed.) | |
* | |
* Based on dealing with Jonathan Gottfried's blog entry on Twilio re: Twilio => SIP => Asterisk: | |
* https://www.twilio.com/blog/2013/03/build-a-twilio-hard-phone-with-sip-from-twilio-raspberry-pi-asterisk-freepbx-and-the-obihai-obi100.html | |
* | |
* Point Twilio Voice Request URL to http://YOUR-SERVER.COM/path/call.php/###-###-#### | |
* | |
* -Louis T. Getterman IV | |
* https://twitter.com/LTGIV | |
* https://github.com/LTGIV | |
*/ | |
$reqNum = substr($_ENV["PATH_INFO"], 1); | |
$reqNum = str_replace("-", "", $reqNum); | |
?> | |
<Response> | |
<Dial> | |
<Sip> | |
<Uri username="twilio1" password="drawtheowl"><?php echo($reqNum);?>@YOUR-SIP-SERVER.COM</Uri> | |
<Uri username="twilio2" password="drawtheowl"><?php echo($reqNum);?>@YOUR-SIP-SERVER.COM</Uri> | |
<Uri username="twilio3" password="drawtheowl"><?php echo($reqNum);?>@YOUR-SIP-SERVER.COM</Uri> | |
</Sip> | |
</Dial> | |
</Response> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment