I'm building a voice agent that needs to handle ca...
# ask-ai
f
I'm building a voice agent that needs to handle call forwarding scenarios. When a caller dials my client's personal phone number and the call goes unanswered, the carrier forwards the call to my LiveKit number with a SIP Diversion header containing the original called number. With LiveKit Phone Numbers (not a third-party SIP trunk like Twilio): 1. Are SIP headers like Diversion or History-Info accessible in participant.attributes? 2. Since LiveKit Phone Numbers don't require creating an inbound trunk, is there any way to configure headers_to_attributes mapping or include_headers to capture these forwarding headers? 3. Can I access sip.diversion or sip.h.diversion attributes for calls to LiveKit-purchased phone numbers? My use case requires knowing both the caller's number (sip.phoneNumber) AND the forwarded-from number (from the Diversion header) to load the correct agent prompts.
t
Thanks for reaching out, Andre. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking about accessing SIP Diversion/History-Info headers for calls forwarded to LiveKit-purchased phone numbers. I'll answer each question directly. 1) Are SIP headers like Diversion or History-Info accessible in participant.attributes? • SIP Diversion/History-Info headers are not documented as being accessible in
participant.attributes
for LiveKit Phone Numbers. 2) Can I configure headers_to_attributes mapping or include_headers for LiveKit Phone Numbers? • There is no documented method to configure
headers_to_attributes
mapping or
include_headers
for LiveKit Phone Numbers (they do not require creating an inbound trunk). 3) Can I access
sip.diversion
or
sip.h.diversion
attributes for calls to LiveKit-purchased numbers? • Access to
sip.diversion
or
sip.h.diversion
attributes for calls to LiveKit-purchased phone numbers is not documented. Next steps I can help with • If you’d like, I can suggest alternative approaches to detect forwarded-from numbers (examples: having the carrier rewrite a header you control, adding IVR prompts to confirm the target number, or using an inbound SIP trunk provider that lets you map headers to attributes). • Tell me which of those alternatives you prefer or share your carrier/trunk setup and I’ll give tailored steps. Sources: SIP participant | LiveKit docs | SIP inbound trunk | LiveKit docs