gentle-dream-14103
09/12/2025, 11:58 AMtall-airline-16756
09/12/2025, 11:58 AMtall-airline-16756
09/12/2025, 11:59 AMsip.phoneNumber attribute, which is part of a SIP participant's attributes field when the participant type is SIP. Let’s walk through the steps together:
Steps to Retrieve the Caller’s Number:
1. First, check if the participant’s kind is SIP by using participant.kind == ParticipantKind.SIP.
2. Then, access the sip.phoneNumber from the participant’s attributes dictionary.
Example (Node.js):
if (participant.kind == ParticipantKind.SIP) {
console.log(participant.attributes['sip.phoneNumber']);
}
Example (Python):
if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP:
caller_number = participant.attributes.get('sip.phoneNumber')
if caller_number:
logger.info(f"Caller phone number is {caller_number}")
Just a couple of important things to keep in mind:
• If HidePhoneNumber is set to true in your dispatch rule configuration, the sip.phoneNumber attribute won’t be available.
• For outbound calls, the sip.phoneNumber reflects the number dialed by the SIP participant, not the caller’s actual number.
If you have any questions or need further assistance, feel free to ask—I’m here to help!
Sources: SIP participant | LiveKit Docs