https://retellai.com/?utm_source=discord&utm_medium=seo logo
when I add a custom function for a single prompt v...
# ❓・ai-evy-support
p
@AI Evy when I add a custom function for a single prompt voice agent, how do I access data like the inbound phone number?
a
Thanks for tagging me @palctv. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Discord message from @miguelpinto7865 on 2024-11-17](https://discord.com/channels/1186424376300679209/1294891368505937952/1307827971595173961) [[3] Discord message from @manny_40662 on 2024-11-14](https://discord.com/channels/1186424376300679209/1294891368505937952/1306723741224538213) ​
### Answer When you add a custom function for a single prompt voice agent in Retell AI, the inbound phone number is provided in the call object sent to your custom function’s endpoint. You can access it via the from_number field inside the call object in the request payload. Example structure:
Copy code
json
{
  "call": {
    "call_type": "phone_call",
    "from_number": "+12137771234",
    "to_number": "+12137771235",
    ...
  },
  "name": "your_function_name",
  "args": {
    ...
  }
}
So, in your handler, use call.from_number to get the inbound caller’s phone number [(1) ]() [(2) ]() [(3) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy can the custom function reference dynamic variables
a
Thanks for the follow-up, @palctv. I'll get back to you soon.
### Answer Yes, a custom function in Retell AI can reference dynamic variables. When setting up your custom function, you can include dynamic variables in the URL, headers, or query parameters by using the {{variable_name}} syntax. This allows the function to receive personalized data for each call or session. Dynamic variables can be set at the agent level, provided via API, or extracted from user input, and are available for use in tool configurations, including custom function calls [(1) ]() [(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[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.
p
@AI Evy are dynamic variables passed along in the call_analyzed event?
a
Thanks for the follow-up, @palctv. I'll get back to you soon.
### Answer Yes, dynamic variables are included in the payload of the call_analyzed webhook event if they were provided during the call. The webhook sends a call object, and dynamic variables are part of this object and are only available after the call ends. If dynamic variables are not provided, they will be omitted from the webhook event payload [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy I see call_ended and call_analyzed events get sent in the middle of a call
a
Thanks for the follow-up, @palctv. I'll get back to you soon.
### Answer The call_ended event is designed to be sent when a call has actually ended, and the call_analyzed event is sent after post-call analysis is complete [(1) ]() [(2) ]() [(3) ]() [(4) ]() . If you are seeing these events triggered in the middle of a call, that would not align with the documented behavior. The documentation states that these events and their associated payloads (including analysis and dynamic variables) are only available after the call ends . If these events are being triggered before the call has ended, this is not documented as expected behavior. You may want to check for any disconnection reasons or error codes that could be causing the call to end prematurely, as described in the disconnection reasons documentation [(5) ]() . Check out these potentially useful sources: [Webhook Overview]() , [Get Call]() , [Debug call disconnection]() 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.
p
on the dashboard, where do I set the inbound webhook
@AI Evy on the dashboard, where do I set the inbound webhook
a
Thanks for the follow-up, @palctv. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Inbound webhook in create agent](https://discord.com/channels/1186424376300679209/1344300058291605554) [[3] Import Phone Number](https://docs.retellai.com/api-references/import-phone-number) [[4] List Phone Numbers](https://docs.retellai.com/api-references/list-phone-numbers) [[5] Get Phone Number](https://docs.retellai.com/api-references/get-phone-number) ​
### Answer Based on the available sources, the inbound webhook is set at the phone number level in your dashboard [(1) ]() . The inbound call webhook is part of your number configuration and works for numbers that you have purchased or imported . From the Discord discussion, it appears that the inbound webhook can be configured in the UI on the phone number settings [(2) ]() . However, there seems to be some confusion in the community discussion about where exactly this setting appears in the dashboard interface . The webhook is configured as the
inbound_webhook_url
field, which you can see in the API responses for phone number operations [(3) ]() [(4) ]() [(5) ]() . When set, this will send a webhook for inbound calls, where you can override agent id, set dynamic variables and other fields specific to that call [(4) ]() [(5) ]() . Check out these potentially useful sources: [Inbound call webhook]() , [List Phone Numbers]() , [Get Phone Number]() 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.
p
@AI Evy what languages can retellAI support
a
Thanks for the follow-up, @palctv. I'll get back to you soon.
### Answer Retell AI supports 31+ languages, including [(1) ]() : - English (US, India, UK, Australia, New Zealand) - Spanish (Spain, Latin America) - French - Chinese - German - Hindi [(1) ]() [(2) ]() - Japanese [(1) ]() - Portuguese (Portugal, Brazil) - Russian - Italian - Korean - Dutch - Dutch (Belgium) - Polish - Turkish - Vietnamese - Romanian - Danish - Finnish - Greek - Indonesian - Norwegian - Slovak - Swedish - Bulgarian - Hungarian - Malay - Catalan - Thai - Macedonian [(3) ]() Retell AI also offers automatic language detection for 10+ languages including English, Spanish, French, German, Hindi, Russian, Portuguese, Japanese, Italian, Dutch, and more [(4) ]() [(5) ]() . Note that some languages mentioned in community discussions may not be fully available yet. For example, Arabic support has been requested but is not currently available, while Russian is available [(6) ]() .
​ To learn more, see the sources I considered: [[1] Retell AI Supported Languages - AI for Multilingual Conversations | Retell AI](https://www.retellai.com/blog/how-to-use-ai-phone-agents-for-multilingual-communication) [[2] ](https://www.retellai.com/languages/hindi) [[3] ](https://www.retellai.com/languages/macedonian) [[4] The 8 Best AI Voice Agents with Multilingual Support | Retell AI](https://www.retellai.com/blog/8-leading-multilingual-ai-voice-agents) [[5] AI Cold Calling: Boost Sales with Retell AI | Retell AI](https://www.retellai.com/blog/retell-ai-voice-agents-transforms-ai-outbound-sales-calls) [[6] Arabic Language Support](https://discord.com/channels/1186424376300679209/1355077840789438555) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.