ancient-umbrella-90337
07/23/2025, 4:56 AMtall-airline-16756
07/23/2025, 4:56 AMtall-airline-16756
07/23/2025, 4:56 AMsip.trunkPhoneNumber – The number associated with your LiveKit SIP Trunk (the called number)
• sip.phoneNumber – The external caller's number (for inbound calls)
These attributes are available on the participant object when the agent joins the room, so your agent can directly access sip.trunkPhoneNumber to determine which number was called.
If you need to pass additional or custom metadata, you can configure your SIP dispatch rule or inbound trunk to set participant metadata. For example, in your dispatch rule, you can add a metadata field that will be inherited by all SIP participants created by that rule. You can also use the roomConfig.agents field to pass metadata to agents when dispatching them for SIP calls.
In summary, to ensure the called number is available to the agent as metadata:
1. Access the sip.trunkPhoneNumber attribute on the participant object when the agent joins the room.
2. Optionally, configure your dispatch rule or trunk to set custom metadata if you need to pass additional context.
This approach ensures the agent receives the called number and any other relevant information as soon as they join the room.
Sources: Agent dispatch | LiveKit Docs | SIP inbound trunk | LiveKit Docs | protobufs/livekit_sip.proto | SIP dispatch rule | LiveKit Docs