https://retellai.com/?utm_source=discord&utm_medium=seo logo
Can Retell receive the raw incoming Diversion head...
# ❓・ai-evy-support
v
@AI Evy Can Retell receive the raw incoming Diversion headers from Twilio/LiveKit SIP and expose them inside the call webhook or dynamic variables?
a
Thanks for tagging me @Vako-SV. I'll look through relevant sources and get back to you shortly.
### Answer Yes, Retell can receive and expose raw incoming Diversion headers from SIP providers like Twilio. [(1) ]() Retell extracts any header starting with
sip.h.x-
, along with common SIP headers like
Diversion
,
History-Info
,
User-To-User
, and
P-Asserted-Identity
, and converts each into a dynamic variable by stripping the
sip.h.
prefix. For example,
sip.h.diversion: <sip:2000@192.168.254.254>;privacy=off;reason=no-answer;counter=1;screen=no
becomes
diversion: <sip:2000@192.168.254.254>;privacy=off;reason=no-answer;counter=1;screen=no
as a dynamic variable. These extracted headers are available as dynamic variables that you can use within your agent configuration and access through webhooks.
​ To learn more, see the sources I considered: [[1] Receive calls](https://docs.retellai.com/deploy/inbound-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
v
@AI Evy I tested both call_started and call_analyzed webhooks. Retell docs say common SIP headers like Diversion should be extracted into dynamic variables. But my call_started webhook does not include diversion, even though the Twilio PCAP for this type of call contains Diversion headers. Can you confirm whether Diversion header extraction is supported for Twilio SIP trunk → LiveKit → Retell phone calls? If yes, what configuration must be enabled so that
diversion
appears in
retell_llm_dynamic_variables
during call_started or the inbound call webhook?
a
Thanks for the follow-up, @Vako-SV. I'll get back to you soon.
### Answer Based on the available documentation, I can confirm that webhook payloads include
retell_llm_dynamic_variables
in their structure [(1) ]() [(2) ]() [(3) ]() . The webhook payload contains the call details with this field available in events like
call_started
,
call_ended
, and
call_analyzed
[(1) ]() [(4) ]() . However, the specific documentation about Diversion header extraction and how SIP headers are automatically converted into dynamic variables for Twilio SIP trunk → LiveKit → Retell configurations is not present in the sources I have access to. What I can confirm from the documentation: Dynamic variables in webhooks: - The
retell_llm_dynamic_variables
object appears in webhook payloads [(1) ]() [(2) ]() [(3) ]() - Dynamic variables can be set when creating calls via the API [(2) ]() [(3) ]() - Variables can also be collected during the call and appear in
collected_dynamic_variables
Custom SIP headers: - You can send custom SIP headers when creating outbound calls using the
custom_sip_headers
parameter [(2) ]() - These appear in the call object as
custom_sip_headers
[(2) ]() [(3) ]() I don't have docum
entation confirming automatic extraction of inbound Diversion headers into
retell_llm_dynamic_variables
for your specific setup. I'd recommend checking: 1. [Documentation]() for SIP header handling specifics 2. [Hire certified Retell partner]() for implementation assistance Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[3] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[4] Setup guide](https://docs.retellai.com/features/register-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.