Using Zapier's instructions for How to Build a Smarter International Phone with Twilio in Just 15 Minutes, I was able to set up voice forwarding that would be ready the instant my phone number ported in.
The 30 second version of those instructions is:
- Set up a Twilio account
- Apply to port in your phone number
- Modify your Geographic Permissions to allow international calling.
- Wait for Twilio to approve your request (this took 24 hours for me)
- Set up voice forwarding with a Twimlet
- Wait for the port to complete (3 business days)
When you view your porting in request, you can set up URLs to configure how to handle voice and SMS. Twilio will load that URL and it will do some action based on the response. For voice calls, the following response will forward a call:
<Response> <Dial action="/forward?Dial=true" timeout="20"> 33651xxxxxx </Dial> </Response>
It's silly to set up a web server just to serve a simple XML document. Even something simple like putting an XML file in an AWS S3 bucket is a a bit of work. So Twilio offers something called Twimlets, which are pre-made services that generate XML documents for basic phone tasks like forwarding, simultaneous ringing, or accepting voicemail. You use their configuration tool to generate a Twimlet URL, and you just paste that URL into your Voice configuration.
The phone number has the country code (33), followed by the number I want to forward to (6 51 xx xx xx). You can see the output this URL produces:
mbenza:~$ curl http://twimlets.com/forward?PhoneNumber=33651xxxxxx <?xml version="1.0" encoding="UTF-8"?> <Response><Dial action="/forward?Dial=true" timeout="20">33651xxxxxx</Dial></Response>
SMS forwarding is a different beast. Twilio doesn't offer a Twimlet for that. The main difference between voice and SMS forwarding is that there's a different behavior each time for SMS; the sender and message changes with every SMS. For voice calls, the "forward" command automatically encapsulates the caller into the process. For SMS, there's no forwarding command in Twilio, so you've got to build something to do that for you.
Previously: New Project: International Voice + SMS Forwarder
Next Update: SMS Forwarding Part I
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete