https://retellai.com/?utm_source=discord&utm_medium=seo logo
how does the press_digit function work
# ❓・ai-evy-support
k
@AI Evy how does the press_digit function work?
a
Thanks for tagging me @K Rudy. I'll look through relevant sources and get back to you shortly.
Copy code
## IVR Navigation
When interacting with automated systems, menus, or IVR prompts:
Your goal is to reach the scheduling or appointments department.
Preferred navigation keywords:
• Scheduling
• Appointments
• New patients
• Front desk
Avoid:
• Billing
• Referrals
• Medical records
• Clinical departments
If you are unsure which IVR option is correct:
Choose the option most closely related to scheduling or appointments.
Alternatively, if you know the exact digit sequence:
Copy code
Press digit 1 to reach the support department.
## Important Notes - This feature is designed for the agent to navigate IVRs, not for capturing user keypad input [(4) ]() - You won't hear audible tones during testing, but the DTMF signals are sent to the IVR system [(5) ]() - The function only works with Call API v2 [(2) ]()
### Answer The
press_digit
function enables your AI agent to navigate IVR (Interactive Voice Response) systems by sending DTMF (Dual-Tone Multi-Frequency) tones—essentially pressing digits on the phone keypad. [(1) ]() [(2) ]() ## How It Works When making outbound calls, agents often encounter IVR systems that require pressing digits to reach the right department or enter information. [(2) ]() The
press_digit
function allows your agent to automatically send these keypad inputs. The process works as follows: [(1) ]() 1. **Agent Decision**: Based on conversation context, the LLM determines when a function is needed 2. **Parameter Extraction**: The agent extracts required information from the conversation 3. **Function Execution**: Retell calls your function with the extracted parameters 4. **Response Handling**: The function result is processed and incorporated into the conversation ## Setup Steps To enable this functionality: [(2) ]() [(3) ]() 1. Add the Press Digit Tool to your agent in the Functions section 2. Add Navigation Prompts with clear instructions on when and what digits to press [(2) ]() 3. Add Interaction Rules for handling edge cases Example prompt:
​ To learn more, see the sources I considered: [[1] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[2] Press digit (IVR navigation)](https://docs.retellai.com/build/single-multi-prompt/press-digit) [[3] How Can AI Navigate IVRs for Faster Customer Support? | Retell AI](https://www.retellai.com/blog/how-can-ai-navigate-ivrs) [[4] Solution Found — DTMF Keypad Input Workaround (Detailed Steps for Others)](https://community.retellai.com/t/solution-found-dtmf-keypad-input-workaround-detailed-steps-for-others/376) [[5] Press digit function for Single Prompt Agent not working](https://discord.com/channels/1186424376300679209/1332371398194106449) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy hey i was actually looking to cappture user keypad input, and make a transfer based on that
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer To capture user keypad input and make a transfer based on that, you'll need to configure DTMF capture at the agent level and then use the captured input to trigger a transfer. [(1) ]() ## Setup User Keypad Input Capture Configure DTMF settings in **Call Settings**: - Digit Limit (
user_dtmf_options.digit_limit
) : Maximum number of digits the user can enter - Termination Key (
user_dtmf_options.termination_key
) : A specific key like
#
or
*
that signals the end of input - Timeout (
user_dtmf_options.timeout_ms
) : Time in milliseconds to wait after the last digit before timing out Once configured, DTMF input is captured automatically and added to the call transcript. The agent can reference this value when generating responses. ## Example Prompt Your prompt should instruct users to enter digits via keypad:
Copy code
Please enter your PIN number using the keypad. You can finish by pressing the pound key.
## Transfer Based on DTMF Input After capturing the keypad input, you can use the Transfer Call function to route calls dynamically. [(2) ]() Set up the transfer tool and configure your prompt to trigger transfers based on the captured DTMF value. For example, you could prompt the agent:
Copy code
If the user pressed 1, use the transfer_call tool to transfer to the sales department.
If the user pressed 2, use the transfer_call tool to transfer to support.
The transfer number can be set to either a number in E.164 format or a SIP URI. ## Important Note The Press Digit node is designed for agents to navigate IVRs, not to capture user keypad input. [(3) ]() Use the agent-level DTMF settings described above for capturing user input.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Capture DTMF input from user](https://docs.retellai.com/build/user-dtmf) [[2] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[3] Solution Found — DTMF Keypad Input Workaround (Detailed Steps for Others)](https://community.retellai.com/t/solution-found-dtmf-keypad-input-workaround-detailed-steps-for-others/376) ​