https://retellai.com/?utm_source=discord&utm_medium=seo logo
I am trying to havea call tranfered during busines...
# ❓・ai-evy-support
d
@AI Evy I am trying to havea call tranfered during business hours. it tranfered a couple times and then doesnt.
a
Thanks for tagging me @Dropmuse. I'll look through relevant sources and get back to you shortly.
### Answer There are several reasons why call transfers might work intermittently. Here's what to check: 1. Check your call logs for the disconnection reason Review the call history and detailed logs in the Retell Dashboard to see the specific disconnection reason and any SIP error codes. [(1) ]() Common transfer failure reasons include: -
dial_busy
– The number dialed is busy -
dial_no_answer
– The number dialed did not answer -
dial_failed
– SIP error codes are not available or error is unknown 2. If using warm transfer, check these settings: - Agent detection timeout – This is the maximum time the AI will wait to determine if the transfer target is a human. The default is 30 seconds. If human detection doesn't succeed within this timeframe, the transfer is marked as failed. [(2) ]() - Human detection – When enabled, the caller is only connected once a human is detected on the receiving end. - Ensure you have the "transfer failed" edge connected to a node to handle failures. [(1) ]() 3. If using custom telephony (like Twilio SIP trunking) : Warm transfers require additional permissions from your telephony provider compared to cold transfers. [(3) ]() If cold transfers work but warm transfers fail, you may need to contact your provider about permissions. To help troubleshoot further, could you share: - A call ID from a failed transfer? - Are you using warm or cold transfer? - What telephony provider are you using (Retell numbers or custom SIP) ?
​ To learn more, see the sources I considered: [[1] Bridge transfer , call tranfer , Chat With Human , Call doesn't go through](https://community.retellai.com/t/bridge-transfer-call-tranfer-chat-with-human-call-doesnt-go-through/401) [[2] Call Transfer Node](https://docs.retellai.com/build/conversation-flow/call-transfer-node) [[3] Warm transfer](https://discord.com/channels/1186424376300679209/1436106645632450671) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
using cold ttranfer and custom SIP.
@AI Evy using cold ttranfer and custom SIP.
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer For cold transfers with custom SIP, there are a few key things to check: 1. SIP REFER Configuration Cold transfers use SIP REFER protocol. [(1) ]() Your telephony provider must properly support SIP REFER for cold transfers to work. [(1) ]() [(2) ]() If transfers are intermittent, try using the SIP REFER method instead of INVITE. [(3) ]() 2. Caller ID Override If you have "User's Number" configured as the caller ID, note that for cold transfers it's up to the telephony provider to support caller ID override for SIP REFER. [(1) ]() If caller ID override is not supported, the transfer will fail. Try switching to "Retell Agent's number" as the caller ID to see if that resolves the intermittent failures. [(4) ]() 3. Check Your Telephony Provider Logs The documentation recommends checking the logs in your telephony provider and potentially opening a ticket with them. [(2) ]() This can help identify if the issue is on their routing side. 4. Custom Telephony Method Matters If you're using the "Dial to SIP URI" method (not Elastic SIP Trunking) , you will not be able to utilize Retell's transfer call feature directly, as Retell doesn't have control over the telephony provider. [(2) ]() [(5) ]() You would need to implement custom transfer logic instead. [(5) ](
4376300679209/1416421362909843647) If you're using Elastic SIP Trunking, verify your termination settings are configured correctly. [(2) ]() [(6) ]() Could you share a call ID from a failed transfer so we can look at the specific error? Also, which custom telephony method are you using—Elastic SIP Trunking or Dial to SIP URI?
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) [[3] Discord message from @preetvadaliya on 2026-01-23](https://discord.com/channels/1186424376300679209/1186462578310910112/1464280697173839974) [[4] Call transfer failures](https://community.retellai.com/t/call-transfer-failures/600) [[5] Custom Telephony call transfer support](https://discord.com/channels/1186424376300679209/1416421362909843647) [[6] Agent transfers the calls to itself](https://community.retellai.com/t/agent-transfers-the-calls-to-itself/699) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy No error is coming back. its more the fact the agent just isnt using the function
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer If the agent isn't invoking the transfer_call function at all, the issue is likely with your prompt configuration rather than telephony. Update your prompt to include transfer conditions The documentation recommends enhancing the agent's understanding by incorporating the transfer call conditions into the prompt. [(1) ]() Include specific instructions such as: "If the user is angry or frustrated, use the transfer_call tool to transfer the conversation to a human agent." Verify the tool is properly added Make sure you've added the Transfer Call Tool by clicking "+ Add" in the tools section and selecting "Transfer Call" from the dropdown menu. Check your transfer conditions If you want transfers during business hours, make sure your prompt explicitly tells the agent when to use the transfer function. For example, include instructions like "During business hours (9am-5pm) , transfer the call to [number] when the user requests to speak with a human." Troubleshooting steps: 1. Review your agent's prompt to ensure transfer conditions are clearly defined 2. Confirm the transfer_call tool appears in your agent's Functions list [(2) ]() 3. Test with explicit trigger phrases that match your prompt instructions Could you share what instructions you've included in your prompt regarding when to transfer calls?
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] Not being able to transfer a call](https://community.retellai.com/t/not-being-able-to-transfer-a-call/225) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy SYSTEM BOOT ACTION When the call connects, immediately evaluate whether the call is within business hours in the Europe/London timezone. If the call is within business hours, you must call the transfer_call function immediately. Transfer the call to +447470144361 This action must happen at call start without waiting for the caller to speak. Do not send any spoken message before calling the transfer function. After calling transfer_call, do not continue the conversation. Only if the call is outside business hours should you continue and act as the receptionist. Business hours: Monday: 8:30am–6:30pm Tuesday: 8:30am–7:00pm Wednesday: 8:30am–6:30pm Thursday: 8:30am–6:30pm Friday: 8:30am–1:00pm Saturday: 8:30am–12:00pm Sunday: Closed
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer The issue is that the LLM cannot reliably determine the current time on its own—it doesn't have real-time clock access. Your prompt asks the agent to "evaluate whether the call is within business hours," but the LLM has no way to know what time it actually is. Solution: Use Dynamic Variables to pass the current time or business hours status You can use [dynamic variables]() to inject the current time or a pre-calculated "is_business_hours" flag at call start. [(1) ]() For example: 1. Before the call starts (via your backend when creating the call) , calculate whether it's currently business hours in Europe/London 2. Pass this as a dynamic variable like
{{is_business_hours}}
set to
true
or
false
3. Update your prompt to reference this variable:
Copy code
If {{is_business_hours}} is true, immediately call the transfer_call function to transfer to +447470144361.
If {{is_business_hours}} is false, act as the receptionist.
Alternative: Consider using Conversation Flow For this type of conditional logic at call start, Conversation Flow may be better suited than a single-prompt agent. [(2) ]() Conversation Flow provides a structured framework that can help with deterministic branching based on variables, reducing reliance on the LLM to make time-based decisions. [(3) ]() The key takeaway: the agent needs external data (passed via dynamic variables) to know the current time—it cannot calculate this itself.
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[3] Call Transfer Node](https://docs.retellai.com/build/conversation-flow/call-transfer-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy so what do i put as the dyamic varible and default value
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer You have two options for setting up the dynamic variable: Option 1: Use the built-in
{{current_time}}
system variable
Retell provides a default system variable
{{current_time_[timezone]}}
that gives you the current time in a specified timezone. [(1) ]() For your Europe/London timezone, use:
Copy code
{{current_time_Europe/London}}
This will return the current time formatted like:
"Thursday, March 28, 2024 at 11:46:04 PM GMT"
Then update your prompt to parse this time and check against your business hours. Option 2: Pass a pre-calculated
is_business_hours
variable
Create a custom dynamic variable (e.g.,
{{is_business_hours}}
) and calculate the value in your backend before the call. - Variable name:
is_business_hours
- Default value: You can set a default value at the agent level (e.g.,
"false"
) which will be used when the variable isn't provided in the call request. When creating the outbound call or responding to the inbound webhook, pass:
Copy code
json
{
  "is_business_hours": "true"
}
Important: All values in
retell_llm_dynamic_variables
must be strings—numbers, booleans, or other data types are not supported. For inbound calls, you can supply dynamic variables via the [Inbound Call Webhook]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy so how do i do option 1
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer To use the built-in
{{current_time_Europe/London}}
system variable: Step 1: Add the variable to your prompt Include
{{current_time_Europe/London}}
directly in your agent's prompt. [(1) ]() This will automatically return the current time formatted like:
"Thursday, March 28, 2024 at 11:46:04 PM GMT"
Step 2: Update your prompt to reference it Modify your prompt to something like:
Copy code
The current time is: {{current_time_Europe/London}}

Based on this time, determine if it falls within business hours:
- Monday: 8:30am–6:30pm
- Tuesday: 8:30am–7:00pm
- Wednesday: 8:30am–6:30pm
- Thursday: 8:30am–6:30pm
- Friday: 8:30am–1:00pm
- Saturday: 8:30am–12:00pm
- Sunday: Closed

If within business hours, immediately call transfer_call to +447470144361.
If outside business hours, act as the receptionist.
No configuration is required for system variables—they work automatically without needing to set default values. Note: The LLM will need to parse the time string and compare it against your business hours. Since this relies on the LLM's interpretation, results may occasionally be inconsistent. For more deterministic behavior, Option 2 (calculating
is_business_hours
in your backend and passing it as
"true"
or
"false"
) would be more reliable.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy explain option 2
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer For Option 2, you calculate whether it's business hours in your own backend code before the call, then pass that result as a dynamic variable. Step 1: Create your dynamic variable In your agent configuration, you can set a default value for the variable. Default dynamic variables are represented as key-value pairs of strings and are injected into your Retell LLM prompt when specific values are not provided in a request. [(1) ]() For example, set a default:
Copy code
json
{ "is_business_hours": "false" }
Step 2: Pass the variable when creating calls For outbound calls, when using the Create Phone Call API, set your variables in the
retell_llm_dynamic_variables
field. Note that all values must be strings: [(2) ]()
Copy code
json
{
  "is_business_hours": "true"
}
For inbound calls, you supply dynamic variables via the Inbound Call Webhook. [(3) ]() This webhook lets you use different agents or pass different variables based on conditions like the incoming phone number or time of day. Step 3: Update your prompt Reference the variable in your prompt:
Copy code
If {{is_business_hours}} is "true", immediately call transfer_call to +447470144361.
If {{is_business_hours}} is "false", act as the receptionist.
Your backend logic (outside of Retell) would: 1. Check the current time in Europe/London 2. Compare against your business hours schedule 3. Return
"true"
or
"false"
as a string in the webhook response or API call This approach is more deterministic because the time calculation happens in your code rather than relying on the LLM to interpret a time string.
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] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
d
@AI Evy go into more details and give me a setep by step
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer Here's a detailed step-by-step guide for Option 2 (passing a pre-calculated
is_business_hours
variable for inbound calls) : ## Step 1: Set Up the Inbound Call Webhook You need to configure a webhook endpoint that Retell will call when an inbound call comes in. This webhook allows you to pass dynamic variables based on conditions like time of day. [(1) ]() ## Step 2: Create Your Backend Logic In your backend code (Node.js, Python, etc.) , create an endpoint that: 1. Receives the webhook request from Retell 2. Gets the current time in Europe/London timezone 3. Compares it against your business hours 4. Returns the appropriate response with the dynamic variable Your webhook response should include the
call_inbound
object with
dynamic_variables
. [(2) ]() One community member noted that using this structure fixed issues with variables not being set:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "is_business_hours": "true"
    }
  }
}
## Step 3: Configure Agent-Level Default Dynamic Variables In your Retell dashboard, set a default value for
is_business_hours
. Default variables serve as a fallback and will only be used when specific variables aren't included in the call request. [(1) ]() Set the default to
"false"
so if your webhook fails, the agent defaults to acting as a receptionist. ## Step 4: Update Your Agent Prompt Reference the variable in your prompt:
Copy code
If {{is_business_hours}} is "true", immediately call transfer_call to +447470144361. Do not speak before transferring.
If {{is_business_hours}} is "false", act as the receptionist.
## Step 5: Test Your Dynamic Variables Before deploying, test your dynamic variables using the web interface. Important notes: - All values in
retell_llm_dynamic_variables
must be strings—numbers, booleans, or other data types are not supported. - The spaces around the variable name will be trimmed when evaluating the variable. - You can use the inbound webhook to check if it is business hours or not, then send a variable to let the agent know. [(3) ]()
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) [[3] Discord message from @omar.13. on 2025-08-14](https://discord.com/channels/1186424376300679209/1186462578310910112/1405622441702854696) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy i used option 1 and it worked the first time but when i called again it didnt
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer The inconsistent behavior you're experiencing with Option 1 (using
{{current_time_Europe/London}}
) is expected because the LLM must interpret the time string and compare it against your business hours schedule. This relies on the LLM's interpretation, which can be inconsistent. [(1) ]() Why Option 1 is unreliable for your use case: The system variable returns a formatted string like
"Thursday, March 28, 2024 at 11:46:04 PM GMT"
. The LLM then has to: 1. Parse this string 2. Extract the day and time 3. Compare against your business hours rules 4. Decide whether to transfer This multi-step reasoning can fail intermittently, especially with complex schedules like yours (different hours for each day) . Recommendation: Switch to Option 2 For deterministic behavior with business hours logic, calculating
is_business_hours
in your backend and passing it as
"true"
or
"false"
is more reliable. The key difference is that your backend code does the time calculation (which is 100% accurate) , and the LLM only needs to check a simple string comparison (
"true"
vs
"false"
) . If you want to continue with Option 1, you could try simplifying your prompt to make the LLM's job easier, but there's no guarantee of consistent results since the time parsing happens within the LLM's reasoning. Would you like help setting up Option 2 with your specific backend environment?
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy can it be done inside twillo flow?
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer Yes, you can calculate business hours inside Twilio Flow and pass the result to Retell as a dynamic variable. When using the "Dial to SIP URI" method with Twilio, you handle the inbound call webhook from Twilio and then dial to Retell's SIP URI. [(1) ]() Here's how it works: 1. In Twilio Flow, add logic to check the current time against your business hours schedule 2. Set a variable (e.g.,
is_business_hours
=
"true"
or
"false"
) 3. Call the Register Phone Call API with your dynamic variable in
retell_llm_dynamic_variables
4. Dial to the SIP URI returned by the API Here's the example code pattern from the documentation:
Copy code
javascript
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
server.app.post(
  "/voice-webhook",
  async (req: Request, res: Response) => {
    // Register the phone call to get call id
    const phoneCallResponse = await client.call.registerPhoneCall({
      agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
      from_number: "+12137771234", // optional
      to_number: "+12137771235", // optional
      direction: "inbound", // optional
    }) ;
    // Start phone call websocket
    const voiceResponse = new VoiceResponse() ;
    const dial = voiceResponse.dial() ;
    dial.sip(
      `sip:${phoneCallResponse.call_id}@sip.retellai.com`,
    ) ;
    res.set("Content-Type", "text/xml") ;
    res.send(voiceResponse.toString() ) ;
  },
) ;
You can add
retell_llm_dynamic_variables
to the
registerPhoneCall
request: [(2) ]()
Copy code
javascript
{
  "retell_llm_dynamic_variables": {
    "is_business_hours": "true"
  }
}
, [(3) ]() In Twilio Flow specifically, you'd use a "Run Function" widget or "Split Based On" widget to calculate business hours, then pass that value when making the API call to Retell.
​ To learn more, see the sources I considered: [[1] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy Retell and twillo is connected via SIP trunk is it still possible?
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer Yes, when using Elastic SIP Trunking with Twilio, you can still pass dynamic variables—but the method is different from the "Dial to SIP URI" approach. With Elastic SIP Trunking, use the Inbound Call Webhook For inbound calls via SIP trunking, you supply dynamic variables through the Inbound Call Webhook rather than the Register Phone Call API. [(1) ]() Your webhook endpoint receives the inbound call notification, calculates whether it's business hours, and returns the dynamic variable in your response. The webhook lets you pass different variables based on conditions like time of day. [(2) ]() Alternative: Use Custom SIP Headers For inbound calls with SIP trunking, custom SIP headers (headers starting with
X-
or
x-
) are automatically received, extracted, and available in the call. They're also automatically added to your collection of dynamic variables—you can access them by stripping the
X-
or
x-
prefix. [(3) ]() For example, if your Twilio Flow sends this SIP header:
Copy code
{
  "X-is-business-hours": "true"
}
Then in your Retell agent, you can reference it as
{{is-business-hours}}
in your prompt. This means you could configure Twilio Flow to calculate business hours and pass the result as a custom SIP header before forwarding the call to Retell via your SIP trunk.
​ To learn more, see the sources I considered: [[1] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[3] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy the twillo flow was just to decide to send the call to the business or send the number to retell
a
Thanks for the follow-up, @Dropmuse. I'll get back to you soon.
### Answer If Twilio Flow is handling the routing decision (send to business vs. send to Retell) , and you're using Elastic SIP Trunking, you have two options for passing the business hours status to Retell: Option 1: Use Custom SIP Headers When Twilio Flow decides to route the call to Retell, it can add a custom SIP header. For inbound calls, custom SIP headers (headers starting with
X-
or
x-
) are automatically received, extracted, and added to your dynamic variables—you can access them by stripping the
X-
or
x-
prefix. [(1) ]() For example, if Twilio sends:
Copy code
json
{
  "X-is-business-hours": "true"
}
Then in your Retell agent prompt, reference it as
{{is-business-hours}}
. Option 2: Use the Inbound Call Webhook Configure an Inbound Call Webhook in Retell. When a call arrives via your SIP trunk, Retell will POST to your webhook endpoint. [(2) ]() Your webhook response can include dynamic variables:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "is_business_hours": "true"
    }
  }
}
Since Twilio Flow already knows it's business hours (because it decided to send the call to Retell instead of the business) , you'd have your webhook return
"is_business_hours": "true"
for all calls that reach Retell. The simplest approach: If Twilio Flow only sends calls to Retell during off-hours, then every call reaching your Retell agent is automatically outside business hours—you may not even need the dynamic variable. Just configure your agent to always act as the receptionist.
​ To learn more, see the sources I considered: [[1] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) [[2] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.