https://retellai.com/?utm_source=discord&utm_medium=seo logo
is there any command for the retell agent to get t...
# ❓・ai-evy-support
b
@AI Evy is there any command for the retell agent to get the caller number?
a
Thanks for tagging me @blcksmith__. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there isn't a built-in variable within the agent prompt to directly access the incoming caller's phone number [(1) ]() . However, you can access the caller's phone number through custom functions. When Retell calls your custom function endpoint, it passes a structure that includes the call details [(2) ]() :
Copy code
json
{
  "call": {
    "call_type": "phone_call",
    "from_number": "+12137771234",
    "to_number": "+12137771235",
    "direction": "inbound",
    "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
    "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
    "call_status": "registered",
    "metadata": {},
    "retell_llm_dynamic_variables": {
      "customer_name": "John Doe"
    },
    "opt_out_sensitive_data_storage": true
  },
  "name": "get_weather",
  "args": {
    "city": "New York"
  }
}
You can use the
call
field to determine the
from_number
and
to_number
. The
from_number
field contains the E.164 formatted phone number of the caller [(3) ]() [(4) ]() .
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] Accessing incoming callers phone number](https://discord.com/channels/1186424376300679209/1349398868822986846) [[2] Discord message from @manny_40662 on 2024-11-14](https://discord.com/channels/1186424376300679209/1294891368505937952/1306723741224538213) [[3] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[4] Get Call](https://docs.retellai.com/api-references/get-call) ​
b
@User Can I use this in my agent prompt?