response = await livekit_api.sip.create_sip_partic...
# ask-ai
m
response = await livekit_api.sip.create_sip_participant( api.CreateSIPParticipantRequest( sip_trunk_id=sip_trunk_id, sip_call_to=phone_number, room_name=room_name, participant_identity=identity, participant_name="Human Agent", krisp_enabled=True ) ) play dail tone on existing room when creating new sip participant
t
Thanks for reaching out, Rajadurai. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To play a dial tone in the existing room when creating a new SIP participant, set the
play_dialtone
parameter to
True
in your
CreateSIPParticipantRequest
. This causes LiveKit to play a standard dial tone to all room participants as the SIP call is connecting, providing audio feedback to participants present in the room. Here's how you can modify your code:
Copy code
response = await livekit_api.sip.create_sip_participant(
    api.CreateSIPParticipantRequest(
        sip_trunk_id=sip_trunk_id,
        sip_call_to=phone_number,
        room_name=room_name,
        participant_identity=identity,
        participant_name="Human Agent",
        krisp_enabled=True,
        play_dialtone=True
    )
)
This will ensure the dial tone is heard by existing room participants while the call connects. The dial tone stops once the call is answered or fails to connect. Usage of
play_dialtone
is supported across all LiveKit SDKs. Sources: pkg/sip/outbound.go | livekit/livekit_sip.pb.go | Make outbound calls | LiveKit Docs | packages/livekit-server-sdk/src/SipClient.ts | src/main/kotlin/io/livekit/server/SipServiceClient.kt
m
Can I play custom tones?
t
I totally get what you're looking for! Right now, our knowledge base only shows you can turn the standard dial tone on or off using the
play_dialtone
option when setting up a SIP participant. But I hear you - there's no clear way to upload your own custom tones or audio files to replace the default dial tone. The current API doesn't give us any extra settings or parameters to personalize the dial tone's sound. The system just uses its standard tones, and unfortunately, that's not something you can tweak through the SIP participant settings. I know that might be a bit frustrating! Sources: livekit-protocol/src/livekit.rs | src/main/kotlin/io/livekit/server/SipServiceClient.kt | tones/tones.go | protobufs/livekit_sip.proto | Make outbound calls | LiveKit Docs | packages/livekit-server-sdk/src/SipClient.ts