SipCreateParticipant function usage?
# ask-ai
h
SipCreateParticipant function usage?
t
Thanks for reaching out, Krish. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The
CreateSIPParticipant
function is used to create a SIP participant for making outgoing calls. Below is an overview of its usage:
Copy code
async def create_sip_participant(
    self,
    create: CreateSIPParticipantRequest,
    *,
    timeout: Optional[float] = None,
) -> SIPParticipantInfo:
Required Parameters: • `sip_trunk_id`: ID for the SIP trunk used to dial the user • `sip_call_to`: Phone number to call • `room_name`: Name of the room to connect the participant to Optional Parameters: • `participant_identity`: Identity of the participant • `participant_name`: Name of the participant • `timeout`: Optional request timeout in seconds • Other options like DTMF digits, headers, and media encryption settings The function returns a
SIPParticipantInfo
object and requires a SIP
call
grant on the authorization token. Here is an example of its usage:
Copy code
self.api.sip.create_sip_participant(
    api.CreateSIPParticipantRequest(
        room_name=self._room.name,
        participant_identity=participant_identity,
        sip_trunk_id=trunk_id,
        sip_call_to=call_to,
        participant_name=participant_name if is_given(participant_name) else None,
    )
)
Sources: SIP APIs | LiveKit Docs | livekit.api.sip_service API documentation | GitHub::livekit::agents | livekit-agents/livekit/agents/job.py
h
In nodejs?
t
Hey there! Let me walk you through how to use the createSipParticipant function in Node.js with the LiveKit Server SDK. It's pretty straightforward! 😊
Copy code
createSipParticipant(
  sipTrunkId: string,
  number: string,
  roomName: string,
  opts?: CreateSipParticipantOptions
): Promise<SIPParticipantInfo>
What you'll need to provide: • `sipTrunkId`: The ID of your SIP trunk (think of it like the phone line you'll be using) • `number`: The phone number you want to dial • `roomName`: The room where the call will take place Optional extras: • `opts`: Some additional settings you might want to customize via
CreateSipParticipantOptions
When you call this function, it'll return a Promise that gives you back a SIPParticipantInfo object. Cool, right? Let me know if you need any help working through this! 👍 Sources: SipClient | LiveKit JS Server SDK - v2.9.7
h
The latest version is 2.13.1 , right?
t
Hey there! 👋 Just wanted to give you a quick heads up about our latest LiveKit Server SDK for Node.js – we've just released version 2.13.0. Hope this helps keep you up to speed! Let me know if you have any questions. Sources: LiveKit JS Server SDK - v2.9.7