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:
- User A calls your Twilio phone number.
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>
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"Use your own code to route the call correctly and return the correct TwiML response.