Prompt
How do I play a prompt, collect keypad input, and transfer the call to an agent?
Latest observation
Nov 16, 2026
OpenAI APIWeb search: off
If you’re building a basic IVR flow, the standard sequence is:
- Answer the call
- Play a prompt
- Collect DTMF/keypad input
- Decide what to do with the input
- Transfer/connect the caller to an agent
The exact implementation depends on your telephony platform, but the flow is usually the same.
Example call flow
- “Press 1 for Sales”
- “Press 2 for Support”
- If caller presses 1, route to a sales agent
- If caller presses 2, route to support
- If no input or invalid input, repeat or route to an operator
Typical components
You usually need:
- a prompt/audio file or TTS text
- a DTMF gather step
- a routing/decision step
- a transfer/bridge step to the agent
Example in common terms
Pseudocode
answer_call()
play("welcome_message.wav")
digit = gather_keypad_input(timeout=5, max_digits=1)
if digit == "1":
transfer_to_agent("sales_queue")
elif digit == "2":
transfer_to_agent("support_queue")
else:
play("invalid_input.wav")
transfer_to_operator()
If you’re using a voice API
Look for these kinds of actions or methods:
play/saygather/collectDigits/waitForDTMFtransfer/dial/bridge
Common best practices
- Keep prompts short
- Give clear options
- Set a timeout for input
- Handle invalid input and no input
- Confirm transfer if needed
- Add a fallback to voicemail or an operator
If you want, I can give you a platform-specific example for Twilio, Nexmo/Vonage, Plivo, Asterisk, FreeSWITCH, or Amazon Connect.