bumpy-spoon-58882
02/13/2025, 2:02 PMgray-monkey-83525
02/13/2025, 2:02 PMLIVEKIT_URL
, LIVEKIT_API_KEY
, and LIVEKIT_API_SECRET
(source).
2. Create a SIP Trunk: Use the Twilio CLI to create a SIP trunk. Ensure the domain name ends with pstn.twilio.com
. For example:
twilio api trunking v1 trunks create --friendly-name "My test trunk" --domain-name "my-test-trunk.pstn.twilio.com"
(source).
3. Configure the Trunk: Set up the trunk for inbound calls by configuring an origination URI. Use the following command:
twilio api trunking v1 trunks origination-urls create --trunk-sid <twilio_trunk_sid> --friendly-name "LiveKit SIP URI" --sip-url "sip:<your SIP host>" --weight 1 --priority 1 --enabled
(source).
4. Associate Phone Number: Link your phone number to the SIP trunk using the Twilio CLI:
twilio api trunking v1 trunks phone-numbers create --trunk-sid <twilio_trunk_sid> --phone-number-sid <twilio_phone_number_sid>
(source).
5. Create an Inbound Trunk in LiveKit: Create a JSON file (inbound-trunk.json
) with your trunk details and use the LiveKit CLI to create the inbound trunk:
{
"trunk": {
"name": "Twilio inbound trunk",
"numbers": [
"+15105550100"
],
"auth_username": "<username>",
"auth_password": "<password>"
}
}
lk sip inbound create inbound-trunk.json
(source).
6. Add a Dispatch Rule: Create a dispatch rule to route calls to a LiveKit room. Create a dispatch-rule.json
file:
{
"name": "My dispatch rule",
"trunk_ids": [
"<livekit_trunk_id>"
],
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call"
}
}
}
Apply the rule using the CLI:
lk sip dispatch create dispatch-rule.json
(source).
Would you like more detailed guidance on any of these steps?
Sources:
- Accepting incoming calls
- Configuring a SIP provider trunk 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.