https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hi Retell Support,We're using warm transfers, and ...
# ❓・ai-evy-support
v
@AI Evy Hi Retell Support, We're using warm transfers, and we’ve noticed that all failed transfers return the same generic tool result: {"status":"Transfer failed due to an error.. Please inform the customer that the transfer did not go through and offer to try again or assist them directly."} This happens whether the call is declined, reaches voicemail, or fails due to a technical issue. Issue: The main agent has no way to know why the transfer failed. We can't differentiate between voicemail, decline, or error in real time or in post-call analysis. This limits our ability to train agents and provide accurate responses to customers. Request: Could you provide a way to: Distinguish between failure types (declined, voicemail, error, etc.) Include the reason in the tool result or via webhook metadata, so agents can respond accordingly. This would help improve agent behavior and overall call experience. Thanks!Hi Retell Support, We're using warm transfers, and we’ve noticed that all failed transfers return the same generic tool result: {"status":"Transfer failed due to an error.. Please inform the customer that the transfer did not go through and offer to try again or assist them directly."} This happens whether the call is declined, reaches voicemail, or fails due to a technical issue. Issue: The main agent has no way to know why the transfer failed. We can't differentiate between voicemail, decline, or error in real time or in post-call analysis. This limits our ability to train agents and provide accurate responses to customers. Request: Could you provide a way to: Distinguish between failure types (declined, voicemail, error, etc.) Include the reason in the tool result or via webhook metadata, so agents can respond accordingly. This would help improve agent behavior and overall call experience. Thanks!
a
Thanks for tagging me @Vako-SV. I'll look through relevant sources and get back to you shortly.
s.retellai.com/features/webhook-overview) - [Post Call Analysis Overview]() Would you like me to provide a general answer about how transfer failure handling typically works in voice AI systems?
### Answer Based on the available documentation, I don't see a feature that provides granular failure reason codes for warm transfer failures (such as distinguishing between declined, voicemail, or technical error) . The documentation does describe warm transfer configuration options including: - **Agent Detection Timeout**: Configure how long the AI will wait for the agent to pick up before triggering fallback actions [(1) ]() [(2) ]() - **Human Detection**: Transfers include automatic human detection to confirm a human is on the receiving end [(2) ]() [(3) ]() However, the specific ability to receive differentiated failure reasons in the tool result or webhook metadata is not documented in the available sources. What you can currently do: - Use the
call_ended
webhook which provides a
disconnection_reason
field in the call object [(4) ]() - Use Post-Call Analysis to extract custom Boolean, Text, Number, or Selector data from calls [(5) ]() For your specific feature request (distinguishing transfer failure types in real-time tool results) , I'd recommend submitting this directly to the Retell team: - Visit [Contact Sales]() - Check [) Check out these potentially useful sources: - [Call Transfer Node]() - [Webhook Overview](
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @Vako-SV. I'll get back to you soon.
v
@AI Evy Hello Retell Support, I am building an agent that uses an Inbound Webhook (via Make.com) to inject dynamic data into the call. My webhook response passes a custom variable called department_ledger (containing a list of department names and their corresponding E.164 phone numbers for the current shift) into the dynamic_variables object. My Goal: I want to use the "Transfer Call" tool with Dynamic Routing to select the correct phone number from this variable, rather than hardcoding numbers in the tool definition. My Questions: Variable Access: Does the "Dynamic Routing" prompt in the Transfer Call tool have access to the dynamic_variables I passed via the inbound webhook? Can I reference {{department_ledger}} directly in that routing prompt? Prompt Logic: If I instruct the Dynamic Routing prompt to "Extract the phone number for the [Department] from the {{department_ledger}} variable and transfer the call," will it execute correctly? Best Practice: Is there a better way to dynamically pass a transfer destination (phone number) at runtime without the LLM hallucinating the number? Thank you for your help.
a
The LLM will parse the variable content and extract the appropriate number. ## 3. Best Practice to Avoid Hallucination To minimize the risk of the LLM hallucinating phone numbers: [(4) ]() - Use explicit trigger words and clear instructions in your prompt—list specific conditions that map to specific actions - Store the phone number in a dynamic variable before transfer and update it programmatically, then have the Call Transfer Node use that variable as the transfer target [(3) ]() - Ensure phone numbers are in E.164 format (e.g.,
+12137771234
) when setting the transfer target A more reliable approach is to use a custom function that looks up the department and returns the exact phone number, then stores it in a dynamic variable that the transfer node uses. This removes the LLM from the number selection process entirely.
### Answer --- Yes, dynamic variables passed via the inbound webhook can be used in your Transfer Call tool configuration, including in tool descriptions and transfer phone numbers. [(1) ]() ## 1. Variable Access Dynamic variables work in tool configurations, specifically in: - Tool descriptions - Property descriptions - Transfer call phone numbers So you can reference
{{department_ledger}}
in your Dynamic Routing prompt, provided you've correctly passed it through the inbound webhook. Important: For inbound webhooks, your Make.com response must structure the variables under
call_inbound
with the
dynamic_variables
key: [(2) ]()
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "department_ledger": "Sales: +12137771234, Support: +12137771235, Billing: +12137771236"
    }
  }
}
Using
retell_llm_dynamic_variables
at the top level won't work for inbound webhooks—it must be nested under
call_inbound
. ## 2. Prompt Logic You can instruct the Dynamic Routing prompt to select from the
{{department_ledger}}
variable. For example: [(3) ]()
Copy code
- If the caller wants Sales, transfer to the Sales number from {{department_ledger}}
- If the caller wants Support, transfer to the Support number from {{department_ledger}}
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Inbound webhook returns retell_llm_dynamic_variables but agent doesn't receive them](https://community.retellai.com/t/inbound-webhook-returns-retell-llm-dynamic-variables-but-agent-doesnt-receive-them/733) [[3] Routing Calls to Dynamic Number](https://discord.com/channels/1186424376300679209/1346575575963144273) [[4] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
v
@AI Evy You are a strict execution engine. Do not guess. Your ONLY source of truth is the variable: {{department_ledger}} INSTRUCTIONS: 1. Review the conversation history to find the specific Department Name the Agent just promised to transfer to (e.g., "I will connect you to HR"). 2. Search the {{department_ledger}} list for that exact Department Name. 3. Extract the E.164 phone number associated with that department. 4. Transfer the call to that exact phone number. CRITICAL: - If the ledger says "Status=Don't Transfer" for that department, DO NOT transfer. - If the phone number is missing, DO NOT transfer. - Only transfer if you find a valid "+1..." number. is this good prompt for transfer call tool if i use dynamic routing? if not which will be best?
a
Thanks for the follow-up, @Vako-SV. I'll get back to you soon.
### Answer Your prompt structure is reasonable for dynamic routing, but here are some refinements based on how dynamic variables work in transfer configurations: What works well in your prompt: - Using
{{department_ledger}}
as the single source of truth [(1) ]() - Including explicit conditions for when NOT to transfer - Requiring E.164 format validation Suggested improvements: Dynamic variables can be used in tool descriptions and transfer call phone numbers. For dynamic routing, the prompt should clearly map conditions to phone numbers. A more structured approach:
Copy code
Based on the department the caller requested, transfer to the matching phone number from {{department_ledger}}.

Rules:
- If dept = 'Sales', transfer to the Sales number in {{department_ledger}}
- If dept = 'Support', transfer to the Support number in {{department_ledger}}
- If dept = 'HR', transfer to the HR number in {{department_ledger}}

DO NOT transfer if:
- The department shows "Status=Don't Transfer"
- No valid +1 phone number exists for that department
[(2) ]() , [(3) ]() Key considerations: 1. Ensure phone numbers are in E.164 format (e.g.,
+12137771234
) when setting the transfer target [(2) ]() 2. For more reliability, consider using a custom function that looks up the department and returns the exact phone number, then stores it in a dynamic variable that the transfer node uses—this removes the LLM from the number selection process entirely 3. All values in dynamic variables must be strings [(1) ]() Your approach of having explicit validation rules is good practice to prevent hallucination of phone numbers.
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] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Routing Calls to Dynamic Number](https://discord.com/channels/1186424376300679209/1346575575963144273) [[3] Transfer the Caller directly on the vendor number found on Knowledge base..](https://discord.com/channels/1186424376300679209/1395497284510417036) ​
v
@AI Evy I am experiencing a critical issue with the call_transfer (Warm Transfer) flow where the outbound transfer leg persists even after the caller (User) has hung up. This is resulting in "Ghost Calls" to our staff. The Scenario: Main Agent initiates a Warm Transfer to a Human Representative. While the transfer is ringing (or connecting), the User hangs up (Leg A disconnects). The Issue: The Agent continues to ring the Human Representative (Leg B). The Human Rep answers the call. The Transfer Agent is active but goes silent or unresponsive because the User is no longer there to be connected. The Evidence (Logs): Main Call ID (User Leg): call_e15b29aee3aeb034f4a566b12f2 Warm Transfer Call ID (Outbound Leg): call_0edeb5296493f2bc929bdcee Impact: Our Nursing and HR teams are answering calls from the AI, only to find dead air or a confused Agent. This is wasting staff time and billing for unnecessary minutes. Request: Please investigate why the Outbound Transfer Leg is not terminating immediately upon the Inbound User Leg's disconnection. We need a configuration change or a fix to ensure that if the User hangs up, the Transfer attempt is aborted instantly. We are using a Single Prompt setup for the Main Agent and a separate Single Prompt for the Transfer Agent. Looking forward to your fix. Thanks
a
Thanks for the follow-up, @Vako-SV. I'll get back to you soon.
### Answer I don't have documentation that specifically addresses the behavior you're describing—where the outbound transfer leg continues ringing after the original caller (User) has hung up during a warm transfer. The available sources cover warm transfer configuration options like: - **Agent Detection Timeout**: The maximum time the AI will wait to determine whether the transfer target is a human [(1) ]() - **Human Detection**: Automatic verification that a human has answered before completing the transfer - Auto-greet settings and whisper messages for context delivery However, there's no documented configuration for handling the scenario where the original caller disconnects mid-transfer, nor is there documentation on whether the outbound leg should automatically terminate in that case. What you can check: You can retrieve detailed call information including
disconnection_reason
via the List Calls API, which may provide more insight into how each leg terminated: [(2) ]() The
disconnection_reason
field includes values like
user_hangup
,
agent_hangup
,
call_transfer
, and others that might help diagnose the timing. Recommended next steps: Since this appears to be a platform-level behavior question not covered in the available documentation, I'd recommend: - Visit [Contact Sales]() - Check [) Providing the call IDs you mentioned (
call_e15b29aee3aeb034f4a566b12f2
and
call_0edeb5296493f2bc929bdcee
) directly to the Retell team will help them investigate the specific behavior.
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] Warm Transfer vs Cold Transfer - The AI Advantage in Call Centers | Retell AI](https://www.retellai.com/blog/effortless-handoffs-with-retell-ais-warm-transfer-feature) [[2] List Calls](https://docs.retellai.com/api-references/list-calls) ​