colossal-lock-10836
08/20/2025, 4:22 PMtall-airline-16756
08/20/2025, 4:22 PMtall-airline-16756
08/20/2025, 4:23 PMparticipant_metadata
parameter. This lets you attach your own info to the SIP participant right when you create them.
Using the Node.js SDK:
const sipClient = new SipClient(host, apiKey, secret);
await sipClient.createSipParticipant(
trunkId,
phoneNumber,
roomName,
{
participantMetadata: '{"custom_field": "value", "user_type": "external"}',
// other options...
}
);
Direct API Call:
Just include the participant_metadata
field in your request like this:
• Parameter: participant_metadata
• Type: String
• Description: Your own metadata attached to the participant you’re creating
Quick heads up: the metadata is usually stored as JSON, but you can use any string format you like. It’ll be visible to other participants in the room and you can access it through the participant object. Hope that helps!
Sources: SIP APIs | LiveKit Docs | protobufs/livekit_sip.proto | packages/livekit-server-sdk/src/SipClient.ts | SIP dispatch rule | LiveKit Docscolossal-lock-10836
08/20/2025, 4:23 PMtall-airline-16756
08/20/2025, 4:24 PMparticipant_metadata
parameter in the CreateSIPParticipantRequest
. Here's a quick example to get you started:
from livekit import api
# Create the request with custom metadata
response = await livekit_api.sip.create_sip_participant(
api.CreateSIPParticipantRequest(
sip_trunk_id="your_trunk_id",
sip_call_to="+1234567890",
room_name="your_room_name",
participant_identity="sip_participant",
participant_name="SIP Caller",
participant_metadata='{"custom_field": "value", "user_id": "12345"}', # Custom metadata as JSON string
participant_attributes={
"task": "customer_support",
"department": "sales"
}
)
)
Here are a few key things to keep in mind:
• Data Type: The participant_metadata
should be a string.
• Format: It can be any string, but it’s usually a JSON string to keep things organized.
• Usage: This is your chance to add any custom info that’s meaningful for your app.
If you have any questions or want to dive deeper, just let me know — I’m here to help!
Sources: livekit-rtc/livekit/rtc/participant.py | SIP APIs | LiveKit Docs | SIP dispatch rule | LiveKit Docs