https://retellai.com/?utm_source=discord&utm_medium=seo logo
Does DTMF input work with Custom LLM via WebSocket
# ❓・ai-evy-support
u
@AI Evy Does DTMF input work with Custom LLM via WebSocket? Or is it only supported with Retell's built-in LLM? If it Is supported with Custom LLM. Where exactly should the DTMF digits appear in the WebSocket payload sent to my Custom LLM?
a
Thanks for tagging me @.mannankhan. I'll look through relevant sources and get back to you shortly.
### Answer --- Yes, DTMF input is supported with Custom LLM via WebSocket [(1) ]() . When using Custom LLM, DTMF digits appear in the
transcript_with_tool_calls
field within the WebSocket payload [(2) ]() . To receive DTMF input in your Custom LLM WebSocket events, you need to set
transcript_with_tool_calls
to
true
in the config event you send to Retell [(3) ]() [(2) ]() . Here's how to enable it: In your initial config event sent to Retell, include:
Copy code
json
{
  "response_type": "config",
  "config": {
    "transcript_with_tool_calls": true
  }
}
[(3) ]() Once enabled, Retell will populate the
transcript_with_tool_calls
field in the update only events, response required events, and reminder required events sent to your server . The DTMF digits will appear within this transcript structure [(2) ]() . The
transcript_with_tool_calls
field contains the transcript of the call weaved with tool call invocations, results, and DTMF input, precisely capturing when (at what utterance, which word) each event occurred [(3) ]() .
​ To learn more, see the sources I considered: [[1] DTMF - Custom LLM](https://discord.com/channels/1186424376300679209/1382952757803221002) [[2] DTMF Support with Custom LLM](https://discord.com/channels/1186424376300679209/1351879874259976202) [[3] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy 1. Does DTMF collection "lock in" after first
#
press, or should new keypresses generate new events with updated
time_sec
? 2. Is there a way to reset/restart DTMF collection from webhook response to allow retry? 3. Should I avoid using
#
terminator and just collect 6 digits via timeout instead? Currently using timestamp + content check to dedupe, but users can't retry because Retell keeps replaying the first failed attempt. Any insights?
a
Thanks for the follow-up, @.mannankhan. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] User Keypad Input Detection (User DTMF) 2.0](

https://www.youtube.com/watch?v=AKyGlHr-vAM▾

) [[3] Get Agent Versions](https://docs.retellai.com/api-references/get-agent-versions) [[4] User dtmf input issue / IIssue with IVR Node Keypress Handling](https://discord.com/channels/1186424376300679209/1397608688734175293) ​
This ensures any 6 digits are read immediately and triggers a transition without needing termination . Regarding Your Questions: While the sources don't explicitly detail the "lock in" behavior after first
#
press or webhook-based retry mechanisms, the configuration options suggest that using digit limit without a termination key (your option 3) may provide more predictable behavior for fixed-length inputs like 6-digit codes [(2) ](

▾

) [(4) ]() . The sources indicate that DTMF digits appear in the
transcript_with_tool_calls
field when using Custom LLM WebSocket [(1) ]() , but don't specifically address resetting DTMF collection state or handling retry scenarios from webhook responses. I don't have information about: - Whether DTMF collection "locks in" after the first termination key press - How to reset/restart DTMF collection from a webhook response - The exact behavior of replaying failed DTMF attempts For your specific retry scenario, I recommend reaching out to Retell support for clarification on DTMF state management and retry handling: - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge instead? **
### Answer Based on the available sources, I can provide some guidance on DTMF input handling with Custom LLM, though the sources don't explicitly address all aspects of your retry scenario [(1) ]() [(2) ](

▾

) . DTMF Configuration Options: You can configure DTMF input collection with multiple ending methods [(2) ](

▾

) : 1. Termination key (like
#
or
*
) - lets users press a key to finish entering input, useful for variable-length information 2. Fixed digit length - automatically ends input after a specific number of digits, perfect for fixed fields 3. Timeout-based ending - if no input is received after a short period, input collection ends automatically (enabled by default) Configuration in Agent Settings: The DTMF options can be configured in the agent settings with parameters like [(3) ]() :
Copy code
json
"user_dtmf_options": {
  "digit_limit": 25,
  "termination_key": "#",
  "timeout_ms": 8000
}
For your specific case where you need 6 digits, you could configure [(4) ]() :
Copy code
json
"user_dtmf_options": {
  "digit_limit": 6,
  "termination_key": "",
  "timeout_ms": 2000
}
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy After digit_limit=6 DTMF is collected and processed, how do I trigger a NEW DTMF collection session for retry? Do I need to set a specific flag in my webhook response, or is there an API call to reset DTMF state?
a
Thanks for the follow-up, @.mannankhan. I'll get back to you soon.
### Answer I don't have information about triggering a new DTMF collection session for retry after the initial collection is complete. The available sources explain how to configure DTMF input completion options (digit_limit, termination_key, timeout_ms) [(1) ]() [(2) ]() , but don't specifically address resetting DTMF state or initiating a new collection session from webhook responses or API calls. The sources show that DTMF input is captured and taken into account when the agent generates responses by default [(1) ]() , and you can configure collection parameters like:
Copy code
json
"user_dtmf_options": {
  "digit_limit": 6,
  "termination_key": "",
  "timeout_ms": 2000
}
[(2) ]() However, they don't document mechanisms for programmatically resetting DTMF collection state or triggering a fresh collection session after the first one completes. For your specific retry scenario, I recommend reaching out to Retell support for clarification on DTMF state management: - Visit [Contact Sales]() - Visit [) Check out these potentially useful sources: [Capture DTMF input from user]() , [User dtmf input issue / IIssue with IVR Node Keypress Handling]() Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Capture DTMF input from user](https://docs.retellai.com/build/user-dtmf) [[2] User dtmf input issue / IIssue with IVR Node Keypress Handling](https://discord.com/channels/1186424376300679209/1397608688734175293) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @.mannankhan. I'll get back to you soon.
u
@Omar Ashraf | Community Lead @shahretell @AI Evy Quick technical Q about DTMF retry handling: Setup: digit_limit=6, no termination_key, timeout_ms=10000 Issue: After first DTMF is processed, Retell keeps sending the SAME old DTMF (same time_sec timestamp) in subsequent webhook events, even when user enters new keypresses. Logs: [15:02:24] DTMF: "482115", time_sec: 12.209 ❌ Wrong code [15:02:24] Our response: "Incorrect, try again" (content_complete:true) [15:02:40] User enters NEW digits, but webhook shows: DTMF: "482115", time_sec: 12.209 ← SAME old input! All 3 retry attempts consumed by the same keypress. Question: How do we trigger a NEW DTMF collection session after processing the first one? Is there a webhook response parameter or API call to reset DTMF state? This is blocking our OTP verification flow. Thanks! 🙏
a
### Answer --- ### Answer I don't have information about triggering a new DTMF collection session or resetting DTMF state after the initial collection completes. The available sources explain how to configure DTMF input completion options through the agent settings [(1) ]() [(2) ]() [(3) ]() , but don't document mechanisms for programmatically resetting DTMF collection state or initiating fresh collection sessions from webhook responses or API calls. The sources show that DTMF input is captured and taken into account when the agent generates responses by default [(1) ]() , and you can configure the
user_dtmf_options
parameters like [(2) ]() [(4) ]() [(3) ]() :
Copy code
json
"user_dtmf_options": {
  "digit_limit": 25,
  "termination_key": "#",
  "timeout_ms": 8000
}
The DTMF configuration supports three completion methods [(1) ]() [(5) ](

▾

) : - Digit Limit (
user_dtmf_options.digit_limit
) : Maximum number of digits the user can enter [(1) ]() - Termination Key (
user_dtmf_options.termination_key
) : A specific key (such as
#
,
*
, or any digit) that signals the end of input - Timeout (
user_dtmf_options.timeout_ms
) : Time in milliseconds to wait after the last digit before timing out However, the sources don't address how to reset DTMF state mid-call or trigger multiple sequential DTMF collection sessions for retry scenarios like OTP verification. For your specific issue where the same DTMF input is being replayed despite new keypresses, I recommend reaching out to Retell support: - Visit [Contact Sales]() - Visit [) Check out these potentially useful sources: [Capture DTMF input from user]() , [User Keypad Input Detection (User DTMF) 2.0](

▾

) Would you like a general answer based on my knowledge instead? --- **
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] Get Agent](https://docs.retellai.com/api-references/get-agent) [[3] Update Agent](https://docs.retellai.com/api-references/update-agent) [[4] Get Agent Versions](https://docs.retellai.com/api-references/get-agent-versions) [[5] User Keypad Input Detection (User DTMF) 2.0](

https://www.youtube.com/watch?v=AKyGlHr-vAM▾

) ​