node.jstwiliotwilio-twimltwilio-click-to-call

Does Twilio support DTMF recognition over a voice call?


I've been following the https://github.com/TwilioDevEd/browser-calls-node project code, and I have it successfully making calls from a browser to a cellular phone, but I can't for the life of me figure out if Twilio's supports DTMF inside that call from the Cell phone.

Calling their sales department just had them create a support ticket and I haven't gotten a response.

Has anyone successfully done this? And if so, how?

This is the code I've added is to call.js, in the /connect endpoint I added:

const gather = twiml.gather({
        input: 'dtmf',
        finishOnKey: 9,
        timeout: 1,
        action: '/call/completed'
    });

    gather.say('Welcome to Twilio, please tell us why you\'re calling');

    console.log(twiml.toString())

As well as added the route:

router.post('/completed', twilio.webhook({ validate: false }), function (req, res, next) {
    console.log(req.toString());
});

Solution

  • Their support team replied saying (tl;dr) they only support sendDigits(digits) in the SDK, and do not support recognizing DTMF in incoming audio stream.

    Their response:

    The Twilio Client SDK's sendDigits(digits) parameter can used to pass dtmf tones.

    The SDK only supports sending DTMF digits. It does not raise events if DTMF digits are present in the incoming audio stream.

    Ref:https://www.twilio.com/docs/voice/client/javascript/connection#sendDigits```