I've developed a web that connect two persons into a call following this tutorial: https://www.twilio.com/docs/tutorials/click-to-call-node-express and everything is working fine.
Now I need to gather 1 digit of the callee in order to execute a command.
Reading the Twilio documentation it seems I can't use Gather until the Dial verb is over, but this way the call is closed and the callee can't digit anything.
I tried this without success, the dial works fine but the digits callback is never executed:
twimlResponse.say(
'Please wait for the other person to join the call'
);
twimlResponse.dial({
timeLimit: 30
})
twimlResponse.dial(to_number)
const gather = twimlResponse.gather({
input: 'dtmf',
timeout: 30,
numDigits: 1,
action: url // the url is the callback that should handle the digit entered
});
Is it a limitation of Twilio? any workaround or alternative call strategy?
I believe you need to send an
url
with thenumber
you dial and have that URL respond with the TwiML you want to drive the interaction with the callee. From https://www.twilio.com/docs/api/twiml/number:So something like this: