https://retellai.com/?utm_source=discord&utm_medium=seo logo
I have question for the functions
# ❓・ai-evy-support
a
@AI Evy I have question for the functions. my functions send_sms, transfer_call, press_digit do not work. Is there a format to call them in prompt?
a
Thanks for tagging me @alikizil0055. I'll look through relevant sources and get back to you shortly.
### Answer Based on the sources, the pre-built functions like
send_sms
,
transfer_call
, and
press_digit
should be configured in the agent's Functions section in the dashboard, not called directly by name in the prompt [(1) ]() . For these functions to work properly, you need to: 1. Configure them in the dashboard under the agent's "Functions" section 2. Update your prompt with instructions on when to use them. For example, for transfer_call: "If the user is angry or frustrated, use the transfer_call tool to transfer the conversation to a human agent." [(2) ]() 3. **For send_sms**: Write a prompt to let the agent infer the SMS content, or use static SMS content with dynamic variable support [(3) ]() . Note that this only works for phone numbers with SMS enabled (currently only Retell Twilio numbers) . The agent decides when to invoke these functions based on conversation context rather than explicit function names in the prompt [(1) ]() . The LLM determines when a function is needed, extracts required parameters from the conversation, and Retell executes the function . If your functions still aren't working after configuring them in the dashboard and adding appropriate prompt instructions, you may want to check: - Whether your phone number has the necessary capabilities (e.g., SMS enabled for send_sms) [(3) ]() - Whether your prompt clearly describes the conditions for invoking each function [(2) ]() [(4) ](
unction)
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
@AI Evy check above file
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer I don't see a file attached to your message. Could you please upload the file you'd like me to review, or let me know what specific information you're looking for? If you're still experiencing issues with your
send_sms
,
transfer_call
, and
press_digit
functions not working, I can help troubleshoot based on the Retell AI documentation [(1) ]() [(2) ]() . The key steps are: 1. Configure the functions in your agent's dashboard under the "Functions" section [(1) ]() 2. Add clear instructions in your prompt about when to invoke each function [(2) ]() 3. Verify your phone number capabilities (e.g., SMS must be enabled for
send_sms
) Please share the file or provide more details about what you'd like me to check, and I'll be happy to help further.
​ To learn more, see the sources I considered: [[1] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[2] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy here i attach the file. What is wrong in my prompt as the functions do not get triggered? I have defined the functions https://cdn.discordapp.com/attachments/1445899058488148111/1445899931146784960/txt.txt?ex=693206bf&is=6930b53f&hm=8e816bbae63a9758174715ef88e7c3fa42ef3c32d5950aa7f4f2f828a6b1a1a6&
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer I don't see any file attached to your message. However, I can provide guidance on common issues that prevent functions from triggering in Retell AI. Based on the documentation, here are the key requirements for functions to work properly: 1. Explicit Instructions in Your Prompt Your prompt must explicitly state when to invoke each function [(1) ]() . For example: - For transfers: "When the user requests to speak to a human or expresses frustration, call the transfer function" - For SMS: "After booking an appointment, send a confirmation SMS using the send_sms function" - For press_digit: "When navigating an IVR system, use the press_digit function" 2. Function Configuration Ensure your functions are properly configured in the dashboard under the "Functions" section . Each function needs: - A clear name and description - Proper parameter definitions (if applicable) - Speech behavior settings configured correctly [(2) ]() 3. Common Issues The LLM decides when to call functions based on conversation context [(1) ]() . If functions aren't triggering: - Your prompt may lack explicit instructions about when to invoke the function [(2) ]() - The conversation context may not match the conditions described in your prompt - Speech behavior settings might need adjustment - check "Speak during execution" and "Speak after execution" settings Could you please share your prompt text or a screenshot so I can provide more specific guidance on what might be preventing your functions from triggering?
​ To learn more, see the sources I considered: [[1] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy I will divide my prompt to 2 parts: PART 1. (wait for part to before comment) GREETINGS AND FIRST INTERACTION Run "send_sms" function. Begin every call with a friendly, professional welcome: “Welcome to PikoTV. How can I help you today?” Determine the purpose of the call: Sales inquiry, Support request, or General question. Before continuing, ALWAYS collect: * Full name * Company name * Purpose of call GENERAL RULES * Use ONLY information available in the PikoTV KB. * Never guess, never invent technical or commercial details. * If any question falls outside of the knowledge base, direct the caller to human assistance: “I may not have enough details to answer that." and call "transfer_call" function. SALES ASSISTANT BEHAVIOR If the caller wants sales information: 1. Ask clarifying questions such as: * “Which PikoTV product or solution are you interested in?” * “Is this for OTT, IPTV, DVB-NIP, headend, or Android TV devices?” * “Is this for a new deployment or expansion of an existing system?” 2. Provide answers strictly based on KB content: * Headend encoders, transcoders, decoders * SatPlay DVB-NIP gateway * OTT/IPTV/VOD platform * Android TV / Google TV STBs & CTV apps * General company capabilities 3. If you cannot answer based on KB data, say: “I’ll connect you to our sales team.” and call "transfer_call" function. SUPPORT ASSISTANT BEHAVIOR If the caller needs product support: 1. Identify the issue by asking: * “Which product are you using?” * “What problem are you experiencing?” * “When did the issue start?” * "Is it an issue with critical severity?"
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer I see several issues with your prompt that would prevent functions from triggering properly: 1. Don't use function names directly in quotes Your prompt says
Run "send_sms" function
and
call "transfer_call" function
. This is incorrect [(1) ]() . The LLM determines when to invoke functions based on conversation context, not explicit function name references . 2. Incorrect instruction format Instead of
Run "send_sms" function
, you should describe when the agent should use the function [(2) ]() . For example: - For `send_sms`: "After collecting the caller's information, send them a confirmation SMS" - For `transfer_call`: "If the user is frustrated or the question is outside your knowledge, use the transfer_call tool to connect them to a human agent" 3. Immediate function execution at call start Starting with
Run "send_sms" function
at the very beginning is problematic. The agent needs conversation context to extract parameters before executing functions [(1) ]() . Recommended changes:
Copy code
GREETINGS AND FIRST INTERACTION

Begin every call with a friendly, professional welcome:
"Welcome to PikoTV. How can I help you today?"

Determine the purpose of the call: Sales inquiry, Support request, or General question.

Before continuing, ALWAYS collect:
* Full name
* Company name  
* Purpose of call

After collecting this information, send a confirmation SMS to the caller.

GENERAL RULES
* Use ONLY information available in the PikoTV KB.
* Never guess, never invent technical or commercial details.
* If any question falls outside of the knowledge base, say "I may not have enough details to answer that" and transfer the call to a human agent.
The key is to describe the conditions for using functions rather than directly calling them by name [(2) ]() [(1) ]() .
​ To learn more, see the sources I considered: [[1] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[2] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
PART 2: 2. Provide troubleshooting ONLY if the information exists in the KB. 3. If the answer is not available in the KB, say: “For technical assistance on this issue, please contact our support. I am directing you." and call "transfer_call" function. INFORMATION COLLECTION Before ending any call, always confirm: * Full name * Company * Phone number * Reason for the call * Interested products (if sales) * Issue summary (if support) CLOSING End the call professionally: “Thank you for contacting PikoTV. We appreciate your time." and call "end_call" function. NEVER DO * Never invent technical specifications. * Never provide pricing unless included in the KB. * Never guess product compatibility. * Never mention KB limitations or AI constraints. * Never apologize excessively; stay confident and professional. ------- what is wrong in my prompt as the functions do not get tirggered? functions are defined. @AI Evy
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer I've identified the main issues in Part 2 of your prompt: 1. Don't use quoted function names You're still using
call "transfer_call" function
and
call "end_call" function
[(1) ]() . The LLM determines when to invoke functions based on conversation context, not explicit function name references . 2. Incorrect closing instruction Your closing says:
"Thank you for contacting PikoTV. We appreciate your time." and call "end_call" function.
This should be rewritten to describe when to end the call [(2) ]() . For example: - "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation." 3. Missing function call conditions For
end_call
, you need to define specific termination conditions in your prompt . The documentation states you should "Define specific conditions under which the call should be terminated" . Recommended rewrite for Part 2:
Copy code
PART 2:

2. Provide troubleshooting ONLY if the information exists in the KB.

3. If the answer is not available in the KB, say:
   "For technical assistance on this issue, please contact our support. I am directing you." 
   Then transfer the call to a human agent.

INFORMATION COLLECTION
Before ending any call, always confirm:
* Full name
* Company
* Phone number
* Reason for the call
* Interested products (if sales)
* Issue summary (if support)

CLOSING
When the caller says "thank you", "goodbye", "bye", or indicates they're finished, say:
"Thank you for contacting PikoTV. We appreciate your time."
Then end the call.

NEVER DO
* Never invent technical specifications.
* Never provide pricing unless included in the KB.
* Never guess product compatibility.
* Never mention KB limitations or AI constraints.
* Never apologize excessively; stay confident and professional.
Additional tip from community: One Discord user suggested adding a number to function names in your prompt to help the AI identify them, like
end_call_152
[(3) ]() . However, the official approach is to describe conditions for function execution rather than calling functions by name [(1) ]() . The key principle: describe the scenario when functions should execute, not the function names themselves [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[2] End call](https://docs.retellai.com/build/single-multi-prompt/end-call) [[3] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171997744205925) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy for these 3 functions. Give me prompt text to add to my prompt.
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer --- ### Answer Here are the prompt texts to add for your three functions: For `send_sms`: [(1) ]()
Copy code
After collecting the caller's full name, company name, and phone number, send them a confirmation SMS with the collected information.
For `transfer_call`: [(2) ]()
Copy code
If the user requests to speak to a human agent, expresses frustration, or asks a question that falls outside the knowledge base, use the transfer_call tool to connect them to a human representative.
For `end_call`: [(3) ]()
Copy code
If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation.
Important notes: 1. Don't use quoted function names like
call "transfer_call" function
in your prompt [(2) ]() [(3) ]() . The LLM decides when to invoke functions based on conversation context and the conditions you describe [(2) ]() . 2. Define specific conditions for when each function should be triggered [(3) ]() . The agent needs clear instructions about the scenarios that warrant function execution [(2) ]() . 3. For
send_sms
, you can write a prompt to let the agent infer the SMS content, or use static SMS content with dynamic variable support [(1) ]() . Note that this only works for phone numbers with SMS enabled (currently only Retell Twilio numbers) . 4. Enhance the prompt by incorporating the function conditions directly into your agent's main instructions [(3) ]() . This helps the agent understand when to use each tool. The key principle is to describe the scenario when functions should execute, not the function names themselves [(2) ]() [(3) ]() . --- **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy my transfer_call function's "Transfer To" prompt is: "If the user wants to reach sales, transfer to +905425946651. If +905425946651 is not reachable, transfer to +90 536 565 52 09. If +90 536 565 52 09 is not reachable, transfer to +90 553 165 11 39. if the user wants to reach support, transfer to +905425946651 is not reachable, transfer to +90 536 565 52 09. If +90 536 565 52 09 is not reachable, transfer to +90 553 165 11 39. If +90 553 165 11 39 is not reachable, transfer to +90 507 067 02 37." does it work for conditional directions? is it in correct form? should I add wait duration for no answer before directing to alternative number?
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer Your "Transfer To" prompt approach won't work as intended for conditional fallback transfers. The
transfer_call
function doesn't support automatic retry logic or conditional fallback numbers within a single function call [(1) ]() . What actually happens: The
transfer_call
function transfers to one specific number per execution . If that transfer fails (no answer, busy, etc.) , the function returns a failure status, but it doesn't automatically try alternative numbers [(1) ]() [(2) ]() . Regarding wait duration: Yes, you should configure the ring timeout. For warm transfers, you can set the Agent detection timeout, which is the maximum time the AI agent will wait to determine whether the transfer target is a human [(1) ]() . The default timeout is 30 seconds . For general ring duration before considering a transfer failed, there's a
transfer_ring_timeout
setting you can configure in your agent [(3) ]() . One community member resolved a similar issue by adjusting the "Ring duration setting" under the agent's call settings . Recommended approach for fallback transfers: Instead of putting conditional logic in the "Transfer To" prompt, you should: 1. Configure the ring timeout in your agent settings to allow sufficient time for each transfer attempt 2. Handle fallback in your main agent prompt by instructing the agent what to do if a transfer fails:
Copy code
If the user wants to reach sales, transfer to +905425946651. If the transfer fails, try +90 536 565 52 09. If that also fails, try +90 553 165 11 39.

If the user wants to reach support, transfer to +905425946651. If the transfer fails, try +90 536 565 52 09. If that fails, try +90 553 165 11 39. If that fails, try +90 507 067 02 37.
This way, the agent can attempt multiple transfers sequentially based on the failure status returned by each
transfer_call
execution [(2) ]() . **
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] Debug call transfer failure](https://docs.retellai.com/reliability/call-performance) [[3] Hi team, I’m having trouble with the transfer_call function.](https://discord.com/channels/1186424376300679209/1384634772772360383) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy for send_sms, this is my prompt: "Send SMS to +905425946651 about the caller. Does send_sms can send message to this number as given in the prompt?
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer ### Answer No, the
send_sms
function does not work that way
. The
send_sms
tool is designed to send an SMS from the current agent number to the user's number (the caller) , not to an arbitrary third-party number like +905425946651 [(1) ]() . How
send_sms
actually works:
The
send_sms
function sends a one-way SMS from your agent's phone number to the person who is currently on the call with the agent . It only works during phone calls and requires that your phone number has SMS enabled (currently only Retell Twilio numbers support this) [(1) ]() [(2) ]() . Your current prompt issue: Your prompt
"Send SMS to +905425946651 about the caller"
is trying to send an SMS to a different number (+905425946651) rather than to the caller themselves. This is not what the built-in
send_sms
function does [(1) ]() . What you should do instead: If you want to send an SMS to the caller (the person on the phone) , your prompt should be:
Copy code
After collecting the caller's information, send them a confirmation SMS with the details we discussed.
The agent will automatically send the SMS to the caller's phone number . If you need to send SMS to a third-party number: If you truly need to send an SMS to +905425946651 (not the caller) , you'll need to create a custom function that integrates with Twilio or another SMS provider to send messages to arbitrary numbers [(3) ]() . The built-in
send_sms
function only supports sending to the current caller [(1) ]() . Additional requirements: - Your phone number must have SMS capabilities enabled [(1) ]() [(2) ]() - For Retell Twilio numbers, you need to complete A2P 10DLC registration for US numbers [(2) ]() - Currently, SMS functionality is primarily supported for USA numbers [(6) ]()
​ To learn more, see the sources I considered: [[1] Send SMS](https://docs.retellai.com/build/single-multi-prompt/send-sms) [[2] Send & receive SMS](https://docs.retellai.com/deploy/enable-sms) [[3] Discord message from @heavenly.rain on 2025-06-11](https://discord.com/channels/1186424376300679209/1294891368505937952/1382422402725843005) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy give me one prompt example to add in my agent's promot for press_digit
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer Based on the available sources, the
press_digit
function is specifically designed for navigating IVR (Interactive Voice Response) systems [(1) ]() . Here's a prompt example you can add to your agent's prompt:
Copy code
When you encounter an IVR menu or automated phone system, listen carefully to all available options. Press the appropriate digit to navigate to the correct department or menu option based on the user's needs. If the IVR menu repeats multiple times without progress, recognize that you may be stuck and take appropriate action.
Key points about
press_digit
behavior:
The agent will not speak when it's in the press digit node, but rather it will determine whether it should press a digit and which digit to press . The function evaluates whether to press a digit every time the user is done speaking . Configuration recommendations: You should set up IVR Navigation Instructions so that the agent knows whether and what digit to press . Additionally, configure a Detection Delay (recommended 1 second) to ensure the whole IVR menu is captured before the agent makes a decision, especially for IVR systems that speak slowly . The agent uses this information to intelligently navigate through IVR menus and reach the appropriate department or service [(2) ]() . **
​ To learn more, see the sources I considered: [[1] Press Digit Node](https://docs.retellai.com/build/conversation-flow/press-digit-node) [[2] How Can AI Navigate IVRs for Faster Customer Support? | Retell AI](https://www.retellai.com/blog/how-can-ai-navigate-ivrs) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy I want my caller to press a digit so I can naviaget him to another agent
a
Thanks for the follow-up, @alikizil0055. I'll get back to you soon.
### Answer I need to clarify an important distinction: the
press_digit
function in Retell AI is designed for the AI agent to press digits when navigating IVR systems, not for having the caller press digits to route to another agent [(1) ]() . What
press_digit
does:
The
press_digit
tool enables Retell AI agents to navigate IVR systems using DTMF (Dual-Tone Multi-Frequency) input . This is useful when your AI agent makes outbound calls and encounters automated phone systems that require digit input to reach the right department . What you're trying to achieve: Based on your question, you want the caller (the human) to press a digit to be routed to another agent. This is not what the
press_digit
function does
. What you should use instead: For routing callers based on their digit input, you should use the
transfer_call
function combined with conditional logic in your prompt [(2) ]() . Here's how: 1. Instruct the agent to ask the caller for input:
Copy code
Ask the caller: "Press 1 for sales, Press 2 for support, or Press 3 for general inquiries." 
Listen for the caller's response.
2. Add transfer logic based on their response:
Copy code
If the caller says they pressed 1 or mentions sales, transfer the call to +905425946651.
If the caller says they pressed 2 or mentions support, transfer the call to +90 536 565 52 09.
If the caller says they pressed 3 or mentions general inquiries, transfer the call to +90 553 165 11 39.
The agent will listen to the caller's verbal response (e.g., "I pressed 1" or "sales") and then use the
transfer_call
function to route them accordingly . Important note: The
press_digit
function only works with Call API v2 and is specifically for the AI agent to navigate IVR systems, not for collecting caller input [(1) ]() .
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] Press digit (IVR navigation)](https://docs.retellai.com/build/single-multi-prompt/press-digit) [[2] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​