narrow-engineer-85614
09/29/2025, 6:55 PMtall-airline-16756
09/29/2025, 6:55 PMtall-airline-16756
09/29/2025, 6:56 PMsip.phoneNumber during a live room session. For instance, if you're using the Node.js SDK, you can check participants through the Room API to find details such as the caller's phone number.
• Dispatch Rule Metadata: The ListSIPDispatchRule API is a great tool to retrieve metadata defined in your dispatch rules. This metadata will be part of the participant attributes when the rule creates SIP participants.
• SIP Data: You can set up SIP header mappings using headers_to_attributes or SIPHeaderOptions to include SIP headers as attributes. Also, attributes like sip.callStatus and sip.trunkID can provide detailed call-level information.
If you'd like, I can share specific examples or guide you step-by-step through implementing these methods. Just let me know how I can assist you further!
Sources: SIP participant | LiveKit Docs | SIP APIs | LiveKit Docs | protobufs/rpc/io.proto | Docs::Telephonynarrow-engineer-85614
09/29/2025, 7:27 PMtall-airline-16756
09/29/2025, 7:28 PMfrom livekit import api
lkapi = api.LiveKitAPI()
# List participants in a room
participants = await lkapi.room.list_participants("your-room-name")
for participant in participants:
# Access caller phone number from SIP attributes
phone_number = participant.attributes.get("sip.phoneNumber")
print("Caller Phone Number:", phone_number)
• Retrieve Dispatch Rule Metadata:
from livekit import api
lkapi = api.LiveKitAPI()
# List SIP dispatch rules
dispatch_rules = await lkapi.sip.list_dispatch_rule()
for rule in dispatch_rules:
print("Dispatch Rule ID:", rule.sip_dispatch_rule_id)
print("Metadata:", rule.metadata)
• Retrieve SIP Data:
from livekit import api
lkapi = api.LiveKitAPI()
# List participants in a room
participants = await lkapi.room.list_participants("your-room-name")
for participant in participants:
# Access SIP attributes like call status and trunk ID
call_status = participant.attributes.get("sip.callStatus")
trunk_id = participant.attributes.get("sip.trunkID")
print("Call Status:", call_status)
print("Trunk ID:", trunk_id)
If you have any questions or need a bit more detail on any part, please don’t hesitate to ask. I’m here to help!