https://retellai.com/?utm_source=discord&utm_medium=seo logo
I need to extract a variable during the call
# ❓・ai-evy-support
c
@AI Evy I need to extract a variable during the call. We receive calls from different numbers, transferred from different numbers. Is there any way to get the number that transferred the call? not the patient or customer. Can the agent see this during the variable extraction?
a
Thanks for tagging me @carlo_98907. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, Retell AI provides system default variables for phone calls that include
{{user_number}}
(the user's phone number) and
{{agent_number}}
(the agent's phone number) [(1) ]() . However, the sources don't explicitly document a system variable that captures the transferring number (the number that initiated the transfer to your agent) . The available phone call variables are : -
{{user_number}}
- User's phone number (from_number for inbound, to_number for outbound) -
{{agent_number}}
- Agent's phone number (to_number for inbound, from_number for outbound) -
{{call_id}}
- Current call session id -
{{direction}}
- Call direction (inbound or outbound) -
{{call_type}}
- Call type (web_call or phone_call) For extracting custom variables during a call, you can use the Extract Dynamic Variables tool [(2) ]() . This tool allows you to extract values from a user's response and save them as dynamic variables by configuring variable names, descriptions, and types (Text, Number, Enum, or Boolean) . If you need to capture the transferring number specifically, you may need to have the caller verbally provide this information, which you could then extract using the Extract Dynamic Variables tool . Alternatively, this might require custom implementation through webhooks or your telephony provider's transfer metadata. For specific guidance on capturing transfer metadata not covered in the documentation, I recommend reaching out through [Contact Sales]() or [) .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy so the agent that generates the post-call variables can only see the transcript? if a variable in here depends on a dynamic variable, it won't have access to this?
a
Thanks for the follow-up, @carlo_98907. I'll get back to you soon.
### Answer Based on the available sources, I don't have explicit documentation about whether post-call analysis has access to dynamic variables or only the transcript [(1) ]() [(2) ]() [(3) ]() [(4) ]() . However, the sources show that when you retrieve call information, the response includes both
retell_llm_dynamic_variables
(the dynamic variables set at call start) and
collected_dynamic_variables
(variables collected during the call) as separate fields from the transcript [(1) ]() . This suggests these are stored as distinct data points. For post-call analysis configuration, you define the data you want extracted using
post_call_analysis_data
in your agent configuration [(2) ]() [(3) ]() [(4) ]() . The sources don't explicitly state whether the analysis model can reference dynamic variables or is limited to transcript content only. If your post-call analysis needs to reference dynamic variables that were set during the call, I recommend reaching out through [Contact Sales]() or [) for clarification on whether the post-call analysis model has access to both the transcript and the dynamic variables context.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.