Prompt
How do I collect keypad input during a phone call?
Latest observation
Oct 14, 2026
OpenAI APIWeb search: off
To collect keypad input during a phone call, you typically use DTMF tones — the tones generated when someone presses keys on a phone.
Common approach
-
Play a prompt
Example: “Press 1 for sales, 2 for support.” -
Listen for DTMF digits Your telephony platform should expose an event or API for keypad input.
-
Handle the digit(s) Route the call based on what the caller pressed.
If you’re using a voice API / telephony platform
Most platforms provide something like:
Gather/GetDigitscollect digitsinput="dtmf"- DTMF event callbacks/webhooks
Example flow
- Answer call
- Say “Press 1 for billing, 2 for tech support”
- Wait up to, say, 5 seconds for input
- If digit received, branch accordingly
- If no input, repeat or route to operator
Example in pseudocode
play("Press 1 for sales, 2 for support")
digit = wait_for_dtmf(timeout=5)
if digit == "1":
transfer_to_sales()
elif digit == "2":
transfer_to_support()
else:
play("Sorry, I didn't catch that.")
If you’re building with SIP / low-level telephony
You may receive DTMF in one of these ways:
- RFC 2833 / RFC 4733 (out-of-band RTP events)
- SIP INFO
- In-band audio tones (less reliable)
The best method is usually RFC 4733.
Important tips
- Set a timeout and max number of digits.
- Confirm whether your system collects:
- single digit
- fixed-length PIN
- “#” terminated input
- Make sure the call leg is in a state that can receive DTMF.
- If you also want spoken input, many systems let you combine speech + DTMF.
If you tell me what platform you’re using (Twilio, Asterisk, FreeSWITCH, SIP.js, Genesys, etc.), I can show the exact way to do it.