I added the metadata field on a sip inbound trunk,...
# ask-ai
a
I added the metadata field on a sip inbound trunk, however, participant.metadata is empty
t
Thanks for reaching out, Ahron. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see you're asking why
participant.metadata
is empty after adding metadata on a SIP inbound trunk. You're right to expect that data to appear somewhere; the important distinction is where that data lives and how it's propagated. Short answer • Trunk-level metadata is NOT automatically copied into
participant.metadata
. That field must be set on the participant (via token or API) or you must map SIP headers into participant attributes. How to fix this (three options) 1. Map SIP headers to participant attributes ◦ Use the trunk's
headers_to_attributes
mapping so incoming SIP headers become
participant.attributes
. This is useful for caller ID, DNIS, or other header-based values. ◦ Note: those values appear on
participant.attributes
, not
participant.metadata
. 1. Set participant metadata when creating the participant/token ◦ Include metadata in the participant's token (use
setMetadata()
in the SDK) so
participant.metadata
is populated when they join. ◦ Or update the participant after join using the server API (
UpdateParticipant
) to set
metadata
. 1. Pass context via job/dispatch metadata (if using dispatch) ◦ If the data is part of the call context (for routing/agent jobs), provide it as job or dispatch metadata so the agent receives the structured context you need. What I recommend next • If the value originates from a SIP header, try option 1 and read it from
participant.attributes
. • If you want the value in
participant.metadata
, include it in the participant token or call
UpdateParticipant
after the participant joins. If you'd like, tell me: • Which specific field/value you set on the trunk (metadata or a SIP header), and • Whether you want that value available as
participant.metadata
or
participant.attributes
. I can then give the exact config snippet or the API/SDK call you'd need. Sources: How to do call transfers with Five9 | LiveKit | Server-side | livekit/livekit_composite | DeepWiki | server-sdk-kotlin | livekit/livekit_composite | DeepWiki | Agent dispatch | LiveKit Documentation