Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio call forwarding

I have a question about Twilio's call forwarding concept.

I want to create an application that lets users forward their existing numbers to Twilio, which processes the necessary information, and forwards the call back to the user.

However, when I try to implement this, an infinite loop happens: The call is forwarded to Twilio, which forwards the call back to the user, which forwards the call to twilio...

How would I implement this on the Twilio side, since it is difficult to implement any code on the user side?

Here is my code on Twilio that forwards the call back to the user.

<?php
    header("content-type: text/xml");
?>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Response>
  <Say>Hello User</Say>
  <Dial>+1973XXXXXXX</Dial>
</Response>
like image 568
Prajoth Avatar asked Nov 29 '11 23:11

Prajoth


People also ask

Can I forward Twilio number?

It's easy to forward your Twilio calls anywhere in the world. Whether you're an experienced developer, or have never written a line of code, we have a number of versatile products to help you get up and running quickly. Read on for more details and instructions to get your Twilio phone number configured.

How do I forward my Twilio phone?

Log into your Twilio account and navigate to the Studio Dashboard, then select Create new Flow or tap the + icon to create a new Flow. You can name your Flow anything you like, for example, "Call Forwarding". You'll notice that the Canvas comes with a Widget already in place.

Can I forward SMS like calls?

Having a quick and easy way to forward your mobile number (and SMS) to other numbers can make your mobile life a lot more efficient. Thankfully, the Android platform has free and inexpensive applications that can help — like SMS Forwarding (free) and Simple Call Forwarding ($0.99).

Can Twilio forward SMS to email?

Incoming Twilio Programmable SMS Messages can be forwarded to an email inbox with just a few lines of code.


2 Answers

This is tricky. How are users forwarding their existing numbers to Twilio?

The problem is that you want a rule for your cellphone like, "Forward all calls from my cellphone to my Twilio number, unless they are coming back to my cellphone from Twilio." I'm not sure if the call forwarding mechanism for your existing numbers is that sophisticated.

On the Twilio side, you could try returning different TwiML based on whether you've "seen" the call before (is it being forwarded for the first time, or the second time)? But you would have to forward the call to a third number, to avoid the forwarding problem you are already running into.

like image 156
Kevin Burke Avatar answered Oct 18 '22 03:10

Kevin Burke


It is not possible to forward calls to a Twilio number and have that number call you back if you've set up call forwarding on your phone. Conditional call forwarding can only be used for unanswered or busy calls, and for some providers, certain numbers. However, AT&T and Verizon do not allow "forward all numbers but one" for call forwarding.

like image 43
Prajoth Avatar answered Oct 18 '22 03:10

Prajoth