https://retellai.com/?utm_source=discord&utm_medium=seo logo
is it possible to override {{user_number}} via pro...
# ❓・ai-evy-support
g
@AI Evy is it possible to override {{user_number}} via prompting in a state or global prompt? I need to have the caller read out their preferred number on the call and want to update this global dynamic variable so any transfers recognize this as the ANI.
a
Thanks for tagging me @gharpe2. I'll look through relevant sources and get back to you shortly.
### Answer No, you cannot override
{{user_number}}
via prompting.
{{user_number}}
is a system default variable that automatically contains the user's phone number (from_number for inbound calls, to_number for outbound calls) [(1) ]() . System variables are automatically provided by Retell and cannot be modified through prompts . However, you can create a custom dynamic variable to store the caller's preferred number. You would: 1. Use the Extract Dynamic Variable function during the conversation to capture the number the caller reads out 2. Store this in a custom variable like
{{preferred_number}}
3. Use
{{preferred_number}}
in your transfer call phone number field instead of
{{user_number}}
Dynamic variables can be used in transfer call phone numbers , and you can dynamically define phone numbers for call transfers [(2) ]() . Just ensure you use the double curly brace syntax
{{variable_name}}
[(3) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Currently dynamic variables are not supported in the #Transfer To (the destination phone number)](https://discord.com/channels/1186424376300679209/1287253684492828733) [[3] Issue with Global Variables Not Passing in Query Parameters for Custom Function Tool](https://community.retellai.com/t/issue-with-global-variables-not-passing-in-query-parameters-for-custom-function-tool/773) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy so for a SIP transfer, where would I define my custom variable called {{preferred_number}} to use your example? All I see is Retell Agent’s Number or User’s Number available as the Displayed Caller ID or would I need to pass this as a custom SIP header key/value pair?
a
Thanks for the follow-up, @gharpe2. I'll get back to you soon.
### Answer For SIP transfers, you can pass your custom
{{preferred_number}}
variable as a custom SIP header key/value pair [(1) ]() . Custom SIP headers are used to pass information in telephony SIP scenarios and are available for phone calls . When configuring call transfers, you can add custom SIP headers as needed, and these headers must start with
X-
. You can use dynamic variables for your custom SIP header values, allowing you to pass information extracted from the call to the receiving party . For example, you could create a custom SIP header like: - **Header name**:
X-Preferred-Number
- **Header value**:
{{preferred_number}}
The custom SIP headers you set will be included in the transfer request . However, there's an important limitation: for cold transfer with transferee number using SIP REFER, different telephony providers may or may not honor the custom SIP headers in the REFER request . Specifically, Twilio does not honor custom SIP headers in the REFER request, so the SIP headers you set in the transfer call tool will not work for cold transfer with transferee number when using Twilio . The displayed Caller ID field you're seeing is separate from custom SIP headers and is limited to the predefined options (Retell Agent's Number or User's Number) . To pass your custom preferred number, custom SIP headers are the correct approach . **
​ To learn more, see the sources I considered: [[1] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the feedback, glad I was helpful.
g
Following up here @AI Evy, it looks like my cold transfer SIP refer is not saving my custom SIP header variable even though I’m using the correct key/value pair nomeclature (X-Confirmed-Caller-Number/{{confirmed_caller_number}}). Is this something I need to check my telephony provider for or is there another possible reason for this (Retell bug)?
a
Thanks for the follow-up, @gharpe2. I'll get back to you soon.
### Answer There are several known issues with custom SIP headers in transfers that could explain what you're experiencing: Known Issues with Custom SIP Headers in Transfers: 1. **Dynamic variable substitution not working**: There have been reported issues where custom SIP headers don't properly substitute dynamic variables in transfer scenarios [(1) ]() . One user reported that when setting a custom header like
X-AI-Tenant: {{tenant}}
, the header appeared in the SIP INVITE as
X-AI-Tenant: {{tenant}}
(literal text) rather than the actual variable value . 2. **Headers not saving in Multi-Prompt Agents**: There's a documented issue where custom SIP headers don't save when configured in the call_transfer function on Multi-Prompt Agents [(2) ]() . Users reported that after adding custom SIP headers, the next time they entered the function, the Custom SIP Headers part was empty, and logs showed
custom sip headers undefined
. 3. **Telephony provider compatibility**: For cold transfer with transferee number using SIP REFER, different telephony providers may or may not honor the custom SIP headers in the REFER request [(3) ]() . Twilio specifically does not honor custom SIP headers in the REFER request, so the SIP headers you set in the transfer call tool will not work for cold transfer with transferee number when using Twilio . What to check: - Verify your telephony provider supports custom SIP headers in SIP REFER requests [(3) ]() [(4) ]() - Confirm whether you're using a Multi-Prompt Agent (known issue) [(2) ](
.com/channels/1186424376300679209/1430166790079516762) - Check if the dynamic variable
{{confirmed_caller_number}}
is being properly collected before the transfer occurs [(5) ]() Based on the community reports, this appears to be a combination of both provider limitations and potential Retell platform issues with dynamic variable substitution in custom SIP headers during transfers [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic var in transfer header](https://community.retellai.com/t/dynamic-var-in-transfer-header/718) [[2] Call_transfer - Custom SIP headers not saving on Multi_Prompt Agent](https://discord.com/channels/1186424376300679209/1430166790079516762) [[3] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) [[4] Discord message from @ferchyi on 2025-02-20](https://discord.com/channels/1186424376300679209/1186462578310910112/1342146200677122152) [[5] 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.
g
My provider allows custom SIP headers. It’s not saving in the UI. Can you create a bug report for me, @AI Evy
a
Thanks for the follow-up, @gharpe2. I'll get back to you soon.
### Answer I can't create bug reports directly, but I can help you document this issue for Retell support. Based on the information available, there are documented cases of custom SIP headers not saving in the UI, particularly for Multi-Prompt Agents [(1) ]() [(2) ]() . One user reported that when using the call_transfer function on a Multi-Prompt Agent, custom SIP headers would not update, and the next time they entered the function, the Custom SIP Headers section was empty [(1) ]() . Logs showed
custom sip headers undefined
. **Important troubleshooting step**: Agent versioning is important for configuration changes [(1) ]() [(2) ]() . Make sure you're checking the correct agent version after making changes. To report this issue to Retell: Visit [Documentation]() or contact support through the appropriate channels. When reporting, include: - Your agent type (Conversation Flow or Multi-Prompt) - The specific custom SIP header configuration you're trying to save (e.g.,
X-Confirmed-Caller-Number: {{confirmed_caller_number}}
) - Whether this is happening with cold or warm transfers [(3) ]() [(4) ]() [(5) ]() - Your agent version number - Any error messages from call logs This will help Retell's team investigate whether this is the same issue reported by other users or a new variation.
​ To learn more, see the sources I considered: [[1] Call_transfer - Custom SIP headers not saving on Multi_Prompt Agent](https://discord.com/channels/1186424376300679209/1430166790079516762) [[2] Custom SIP headers not saving](https://discord.com/channels/1186424376300679209/1385338274075377755) [[3] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) [[4] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[5] Call Transfer Node](https://docs.retellai.com/build/conversation-flow/call-transfer-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.