https://retellai.com/?utm_source=discord&utm_medium=seo logo
is there a way to trigger the call transfer functi...
# ❓・ai-evy-support
d
@AI Evy is there a way to trigger the call transfer function only during the business hour? can the voice agent understsand the current time real time and refuse to trasnfer the call outside of office hour?
a
Thanks for tagging me @dzei2234. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can control call transfer based on business hours using dynamic variables and prompt instructions [(1) ]() . The voice agent can access current time through the
{{current_time}}
dynamic variable . Here's the approach suggested by Retell AI staff: 1. Check the
{{current_time}}
2. If the time is between 9:00 AM and 5:00 PM: Proceed to transfer the call using the function transfer_call 3. If the time is outside of these hours: Inform the user that call transfers are only available between 9 AM and 5 PM However, there's an important limitation to consider. As noted in the community discussion, relying solely on prompt instructions for business hour restrictions may not be completely reliable since "it will always be breakable which does not make sense for something so rule-based" . For both Agent Transfer [(2) ]() [(3) ]() and Call Transfer [(4) ]() [(5) ]() , you can implement this time-based logic in your agent's prompt to check current time before executing the transfer function. The agent will have access to the full conversation history regardless of which transfer method you use [(2) ]() [(3) ]() . The
{{current_time}}
dynamic variable provides real-time access to the current time, allowing your agent to make time-based decisions about whether to proceed with transfers [(1) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.