Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

304
Visualizações
Twilio Phone Calling - Fetch User's Keypad Input from a node.js application (not web server)
const args = message.content.split(' ')
const phNumber = args[1]
const ttsMessage = args.slice(2).join(' ')

            if (phNumber) {
                // Call phNumber and say ttsMessage and collect keypad input code
                const call = await TwilioClient.calls.create({
                    url: 'http://demo.twilio.com/docs/voice.xml',
                    to: phNumber,
                    from: process.env.TWILIO_PHONE_NUMBER,
                })
            }

           // somehow get the input the user entered and do something with it here. Maybe by using await or Promises etc...

I want to get the number the user entered and do some stuff with it!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When you create a call resource in the Twilio API, it will initiate a phone call between the two numbers you specified, and also send a webhook request to the url you specified.

This url should point to your webserver where you can handle the webhook request and respond with TwiML instructions. These instructions are how you manage the phone call. One of the TwiML verbs is <Gather> where you can ask for input using DTMF (digits on the phone dialer) or voice.

The user response will be posted back to you with another webhook request, this time to the URL specified in the action attribute from the <Gather> verb.

You cannot provide TwiML instructions using the Twilio API or get the input back, you have to use webhooks.

It's not easy, but you technically could use a websocket connection (or some other way of communication) to connect your webhook server and your node.js app, so that your webhook server can stream the data to your node.js app, and your node.js app could send information back. This way you could exchange information from the call in realtime between the node.js app that created the call, and the webhook server that is managing the call.

I recommend checking out this tutorial on responding to phone calls using node.js.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda