0

I'm currently making a successful outbound call, with sendDigits already specified. I want to, some time later, during my call, be able to send more digits. Is this possible, perhaps with twiml? Note: I don't want to dial another number, simply enter digits, or other keypad options.

We don't necessarily want to do this at a specific time, but rather, enough time after the initial send digits are sent and processed. If we could add a time delay before sending additional digits, that is perfect. We tried adding random digits between the original send digits, and the extra stuff we want to send, but this didn't seem to work.

1 Answers1

1

Twilio developer evangelist here.

You can add pauses to the digits you send using the w character. Each w is a half second pause. So if you send "1234wwwwwwwwww5678" then Twilio will pause for 5 seconds between "1234" and "5678".

Alternatively, you can also play digits down the phone using the TwiML <Play> element. You can send digits with the digits attribute like this:

<Response>
  <Play digits="1234wwwwwwwwww5678"></Play>
</Response>

Let me know if that helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • 1
    Yep, that's exactly what I needed. Thank you! – Ryan Doherty Jul 11 '19 at 14:01
  • @philnash This isn't working for me. Trying to make it work for hours now but I don't know where am I making mistake. I am using this in webhook. ```const twiml = new VoiceResponse(); twiml.say('Hello, Please wait while we redirect your call'); const dial = twiml.dial(+12489****05); dial.number({ sendDigits: 'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww1' });``` – Vipulw Jan 07 '21 at 09:34
  • @Vipulw What isn't working? What happens? – philnash Jan 07 '21 at 09:36
  • @philnash This is my server code to receive webhooks. I am not getting sendDigit DTMF when I receive call from /getCallInfo to /answerIncomingCall. Am I doing something wrong. can you please have a look at it and help me. let me know if anything is not clear or you need more info. https://gist.github.com/vipulwairagade/0d88897b5dd1dabee95beb9d8205a722 – Vipulw Jan 07 '21 at 10:01
  • @philnash I have also left a comment on that gist and explained what I am doing. Thanks – Vipulw Jan 07 '21 at 10:05
  • @Vipulw I can't see anything obviously wrong with what you're doing. I can't see `sendOnPreanswer` in the docs at all. Also one `w` is 0.5 second. Your gist code seems to wait 10 seconds and your example in the comment here is even longer, could it be hitting the part where the call is redirecting back to answer again? Have you tried fewer `w`s? – philnash Jan 07 '21 at 10:19
  • @philnash I added that sendOnPreanswer after seeing some xml in one of the GitHub repo. But I tried without it enough times. And regarding w' s I tried with all wait timing less to more. But the key press in not happening and it's not going to gatherInput Route. I am stuck on this for hours now, couldn't proceed further before solving this – Vipulw Jan 07 '21 at 10:53
  • @Vipulw It might be best to get in touch with [Twilio Support](https://www.twilio.com/help/contact) who may know more about what is going on here. I do wonder whether the fact that it is Twilio to Twilio might be affecting it. – philnash Jan 07 '21 at 11:07