big-fall-29109
02/13/2026, 8:30 AMtall-airline-16756
02/13/2026, 8:30 AMtall-airline-16756
02/13/2026, 8:31 AMattributes_to_headers will be included.
Steps to implement this:
1. Configure your inbound trunk’s attributes_to_headers mapping
◦ Map the participant attribute keys to the SIP header names you want in the BYE. Example JSON:
{
"trunk": {
"name": "My SIP Trunk",
"numbers": [
"+15551234567"
],
"attributes_to_headers": {
"custom.reason": "X-Custom-Reason",
"custom.value": "X-Custom-Value",
"five9.route_type": "X-RouteType"
}
}
}
1. Set/update the SIP participant’s attributes in the room
◦ Before ending the session, update the participant attributes to the values you want to appear as headers:
await job_ctx.api.room.update_participant(
api.UpdateParticipantRequest(
room=job_ctx.room.name,
identity=sip_participant.identity,
attributes={
"custom.reason": "completed",
"custom.value": "success"
}
)
)
1. End the call (LiveKit sends the BYE)
◦ Call delete_room (or otherwise terminate the session). LiveKit will send the SIP BYE including the headers mapped from the participant attributes:
await job_ctx.api.room.delete_room(
api.DeleteRoomRequest(room=job_ctx.room.name)
)
Important notes
• You cannot manually craft the BYE through LiveKit; LiveKit handles SIP signaling internally.
• Only attributes defined in attributes_to_headers will be included as headers in the BYE.
• If the caller hangs up first, LiveKit will not include your custom headers in a BYE you intended to send, so ensure your flow sets attributes and initiates the end from the side that triggers LiveKit’s BYE.
If you’d like, tell me:
• Which SIP headers and attribute names you want to use, and
• Whether you need an example for a different language or for configuring a specific SIP provider,
and I’ll provide the exact examples you can drop into your setup.
Sources: How to do call transfers with Five9 | LiveKit