Domanda

I'm new to twilio and I'm struggling with one task. I want to do the following

  1. User A calls a twilio number
  2. User A is asked to type in a specific ID which he got assigned already beforehand by mail
  3. Twilio requests the URL www.mycompany.com/api/twilio/get_recipient_number.php?id=[here the typed in ID] to get the phone number of the recipient
  4. Twilio forwards the caller to the phone number which was provided by the script

Is it possible to do this with twilio? What would be the best way?

È stato utile?

Soluzione

Twilio employee here.

Yes, this is possible with Twilio. However you have to do step 3 slightly differently.

Allow me to explain the process step by step:

  1. User A calls your Twilio phone number.
  2. The phone number requests some TwiML that uses the < Gather > tag to gather the digits User A types. You will want to use some TwiML similar to this: <Response> <Gather action="/route_after_input.php" finishOnKey="*"> Please enter your 4 digit code and press enter </Gather> </Response>

  3. The action url will be called once the * key is pressed. At this URL (do change it from the example above to suit your needs) you can then get the digits type in by inspecting the incoming Twilio request parameter called "Digits"

  4. Use your own code to route the call correctly and return the correct TwiML response.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top