How can I set the callerId when using create_sip_p...
# ask-ai
s
How can I set the callerId when using create_sip_participant. I am using twilio trunk and we are approve to modify the callerId.
t
Thanks for reaching out, Andy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to help you set the caller ID when using
create_sip_participant
with a Twilio trunk. You can do this by using the
sip_number
parameter in your request. This lets you specify the caller ID that will show up for the person receiving the call. If you don't provide
sip_number
, the system will automatically use a number from your SIP trunk configuration. Here's a simple example in Python to guide you:
Copy code
api.CreateSIPParticipantRequest(
    sip_trunk_id=sip_trunk_id,
    sip_call_to=target_phone_number,
    sip_number=original_from_number,  # This sets the caller ID
    room_name=room_name,
    participant_identity=participant_identity,
    play_dialtone=True,
    wait_until_answered=True,
)
Just a few important things to keep in mind: • The
sip_number
should be a valid number in E.164 format, and Twilio expects it to start with a
+
. • Make sure the number you use in
sip_number
is either verified in your Twilio account or is one of the numbers linked to your SIP trunk. • If the number isn’t authorized, the call might not go through or it could show the default caller ID from your trunk. If you'd like to dive deeper, feel free to check out the LiveKit Twilio trunk setup guide. It’s a great resource to help you along. Sources: livekit/livekit_sip.pb.go | src/setup-twilio.ts | Preserving Caller ID During SIP Transfers in LiveKit Agents | packages/livekit-server-sdk/src/SipClient.ts | lib/livekit/sip_service_client.rb
s
Would I still have my twilio A Attestation with this approach?
t
Thanks for reaching out! Could you please let me know if your question is about keeping the A Attestation level for STIR/SHAKEN verification, or if it’s about another part of Twilio’s verification system? I want to make sure I understand correctly so I can help you in the best way possible. Sources: packages/livekit-server-sdk/src/SipClient.ts | SIP participant | LiveKit docs
s
My questions is if I use sip_number, Will I still get my Twilio's A Attestation
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!