0

I have been following a tutorial on twilio.com that walks you through setting up a browser phone. Here is the link https://www.twilio.com/docs/quickstart/php/client/incoming-calls

I know that you can use twiml to handle the flow of a call, but I am curious to know if there is a way to take a call that is in progress on the browser and forward that call to another number. Does anyone know how to do this or know if it is possible? Thanks in advance!

Cannon Moyer
  • 94
  • 1
  • 12
  • According to the documentation this should work perfect for my application. However, the API throws an error when the "To" and "From" parameter is not specified in the call update array. The documentation indicates that the call is transferred directly to a new Twiml, but in order for that Twiml to execute the phone that is being contacted via the forward process must answer. Upon answering, the Twiml executes. I am not sure what I am doing wrong. @philnash – Cannon Moyer Jun 11 '15 at 14:33

1 Answers1

1

Twilio developer evangelist here.

You can affect calls that are in progress using the REST API. By making a POST request to the call's endpoint you can redirect or hangup the call. You're looking to redirect, so you if you POST a URL parameter to that endpoint the call will be redirected to that URL. That should be another URL that serves TwiML and you can then forward the call onto a number with a <Dial>.

You can get the call SID from the connection object in the browser by calling parameters, or from the original call to the TwiML for an incoming call.

Let me know if this helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • According to the documentation this should work perfect for my application. However, the API throws an error when the "To" and "From" parameter is not specified in the call update array. The documentation indicates that the call is transferred directly to a new Twiml, but in order for that Twiml to execute the phone that is being contacted via the forward process must answer. Upon answering, the Twiml executes. I am not sure what I am doing wrong. @philnash – Cannon Moyer – Cannon Moyer Jun 12 '15 at 17:59
  • Please refer to this link. I have all the error and code documentation there. I have been trying to figure this out for hours. http://stackoverflow.com/questions/30809261/redirecting-a-call-to-a-new-twiml-url?noredirect=1#comment49676222_30809261 @philnash – Cannon Moyer Jun 13 '15 at 03:56
  • 1
    I'll take a look at that later when I get the opportunity, thanks for linking. – philnash Jun 13 '15 at 04:42
  • Thank you sir. Just as soon as you get a chance I would appreciate it because my job has me pressured on time for the project. – Cannon Moyer Jun 13 '15 at 12:15