https://retellai.com/?utm_source=discord&utm_medium=seo logo
can i set a dynamic variable for a specific phone ...
# ❓・ai-evy-support
e
@AI Evy can i set a dynamic variable for a specific phone number? i have multiple phone numbers pulling to the same agent, and i want to set a dynamic variable based on which number was called
a
Thanks for tagging me @eli. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can set dynamic variables for specific phone numbers using the inbound webhook feature [(1) ]() [(2) ]() . When you set an
inbound_webhook_url
on a phone number, Retell will send a webhook for inbound calls to that number, allowing you to override agent settings and set dynamic variables specific to that call . Here's how it works: 1. Configure each phone number with an
inbound_webhook_url
2. When a call comes in, Retell sends a webhook to that URL where you can identify which number was called 3. In your webhook response, you can set
retell_llm_dynamic_variables
with values specific to that phone number [(3) ]() The webhook allows you to override the agent id and set dynamic variables for each specific call [(1) ]() [(2) ]() , so you can differentiate between multiple phone numbers routing to the same agent.
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] Update Phone Number](https://docs.retellai.com/api-references/update-phone-number) [[2] Import Phone Number](https://docs.retellai.com/api-references/import-phone-number) [[3] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) ​
e
@AI Evy is there a way to do this in the config without a webhook?
a
Thanks for the follow-up, @eli. I'll get back to you soon.
### Answer Based on the available documentation, there isn't a direct way to set phone-number-specific dynamic variables without using the inbound webhook [(1) ]() [(2) ]() . The phone number configuration allows you to set an
inbound_agent_id
to bind a specific agent to each number [(2) ]() , but dynamic variables work differently. You can configure agent-level default dynamic variables [(3) ]() , but these would apply to all calls for that agent regardless of which phone number was called. The system variable
{{agent_number}}
is automatically available and contains the agent's phone number (the
to_number
for inbound calls) , so you could potentially use this in your agent prompt to handle different numbers differently. However, this requires logic in your prompt rather than pre-set dynamic variables. For truly phone-number-specific dynamic variables, the inbound webhook is the designed solution [(1) ]() [(2) ]() . The webhook receives the
to_number
field in its payload, allowing you to identify which number was called and return appropriate dynamic variables in your response [(1) ]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Create Phone Number](https://docs.retellai.com/api-references/create-phone-number) [[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.