问题
We're developing a Twilio programmable voice app that can select from a list of persons, and place an outbound call to their regular telephone number.
Once the call is connected, we want to be able to speak to the party and then gather dtmf input from the call recipient in order to trigger some specific TwiML code based on the dtmf code entered.
Twilio programmable voice docs don't specify how to gather dtmf input from a call recipient on an outbound call, but I would like to think this is in some way possible. Any advice or ideas would be appreciated!
回答1:
Twilio developer evangelist here.
Outbound calls with Twilio are actually very similar to inbound calls. When you get an inbound call, Twilio makes the webhook request to find out what to do next and you respond with TwiML, for example a <Gather> when you want to take information.
When you make an outbound call, you start the call with the REST API and then when the call connects Twilio makes a webhook request to your URL. At this stage, you respond with TwiML to tell Twilio what to do and you can respond with a <Gather>
at this stage too.
Does that help?
来源:https://stackoverflow.com/questions/53809214/how-to-gather-twilio-dtmf-input-from-call-recipient-on-outbound-call