how to check metadata of inbound call, i am using ...
# ask-ai
g
how to check metadata of inbound call, i am using livekit self hosted one, i also have livekit cli,
t
Thanks for reaching out, vishnu. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’ll walk you through how to check metadata (attributes) for an inbound SIP call on a self‑hosted LiveKit instance using the LiveKit CLI. Quick summary of the flow: • SIP providers send metadata in SIP headers (often custom
X-
headers). • LiveKit can map those headers to participant attributes via
headers_to_attributes
on your inbound trunk. • Use the LiveKit CLI to list participants in the room — the participant
attributes
field holds the metadata. 1) Confirm headers are mapped to attributes on your trunk • In your inbound SIP trunk config, ensure you map the SIP headers to attributes. Example mapping:
Copy code
{
  "trunk": {
    "headers_to_attributes": {
      "X-CallANI": "caller.ani",
      "X-CallDNIS": "caller.dnis",
      "X-CallID": "caller.call_id"
    }
  }
}
• With this mapping, those header values become the SIP participant’s attributes in the room. 2) Use LiveKit CLI to inspect participant metadata • List participants in the room where the inbound call landed:
Copy code
lk room participants list --room <room-name>
• Check the
attributes
field in the JSON output for the SIP participant. Example snippet you’ll see:
Copy code
{
  "identity": "+1234567890",
  "attributes": {
    "caller.ani": "+15551000123",
    "caller.dnis": "+15552000456",
    "caller.call_id": "abc123xyz"
  }
}
3) (Optional) Watch events in real time • If you want to see participant joins (with attributes) as they happen:
Copy code
lk event tunnel
• The
participant_joined
events will include the participant info and
attributes
at join time. 4) Verify trunks via CLI (optional debugging) • List inbound trunks:
Copy code
lk sip inbound list
• Inspect a specific trunk:
Copy code
lk sip inbound get <trunk-id>
If anything isn’t showing up: • Confirm your SIP provider is sending the headers (ask them or inspect SIP INVITE/headers). • Confirm the header names match exactly in
headers_to_attributes
. • Confirm the inbound call did join the expected LiveKit room (check room name/ID). Would you like help with any of these next steps? • I can show how to check a specific room if you share the room name. • I can help inspect a trunk config if you paste the
headers_to_attributes
portion (remove any secrets). Sources: How to do call transfers with Five9 | LiveKit | Job lifecycle | LiveKit Documentation