numerous-dentist-97418
09/16/2025, 7:01 PMtall-airline-16756
09/16/2025, 7:01 PMtall-airline-16756
09/16/2025, 7:02 PMFrom, P-Asserted-Identity, or Diversion in the forwarded call?
Getting these details will really help us figure out if the existing SIP participant attributes or transfer methods can support what you’re aiming to do. I’m here to assist every step of the way!
Sources: SIP participant | LiveKit Docs | Preserving Caller ID During SIP Transfers in LiveKit Agentsnumerous-dentist-97418
09/16/2025, 7:04 PMtall-airline-16756
09/16/2025, 7:04 PMFrom, P-Asserted-Identity, or Diversion, depending on how Telnyx handles forwarded calls.
Here’s what I suggest you try next:
• Reach out to Telnyx to see if they include these headers in forwarded calls.
• Set up your SIP trunk in LiveKit to capture headers by using headers_to_attributes or include_headers. This can help you map the relevant SIP headers to participant attributes for easier tracking.
If you’d like, I’m here to help you with configuring these SIP headers or if you have any other details to share, just let me know. We’ll work through this together!
Sources: Preserving Caller ID During SIP Transfers in LiveKit Agents | sip-refer/agent.py | protobufs/livekit_sip.protonumerous-dentist-97418
09/16/2025, 7:08 PMheaders_to_attributes or include_headers ?tall-airline-16756
09/16/2025, 7:08 PMheaders_to_attributes and include_headers in your LiveKit SIP trunk configuration. Here’s a friendly walkthrough:
1. Using headers_to_attributes
This lets you map specific SIP X-* headers to LiveKit participant attributes. For example:
{
"headers_to_attributes": {
"X-Custom-Id": "caller_id",
"X-Tenant": "tenant_name",
"X-Queue": "queue_id"
}
}
With this setup, the X-Custom-Id header from the SIP INVITE is captured and added as a participant attribute called caller_id. Pretty neat, right?
2. Using include_headers
This feature automatically maps SIP headers to sip.h.* participant attributes. Here’s how you can use it:
• To auto-map all X-* headers:
{
"include_headers": 1
}
• Or, to include all SIP headers:
{
"include_headers": 2
}
3. Example API Request
Here’s a sample Create SIP Inbound Trunk request to illustrate everything:
curl -X POST <https://your-livekit-url/twirp/livekit.SIP/CreateSIPInboundTrunk> \
-H "Authorization: Bearer <token>" \
-H 'Content-Type: application/json' \
-d '{
"name": "My Inbound Trunk",
"numbers": ["+15551234567"],
"headers_to_attributes": {
"X-User-ID": "user_id",
"X-Dept": "department"
},
"include_headers": 1
}'
If you have any questions or want to explore this further, please don’t hesitate to reach out. I’m here to help you every step of the way!
Sources: SIP APIs | LiveKit Docs | protobufs/livekit_sip.protonumerous-dentist-97418
09/16/2025, 7:27 PMtall-airline-16756
09/16/2025, 7:27 PM