future-shampoo-29056
09/11/2025, 10:01 AMtall-airline-16756
09/11/2025, 10:01 AMtall-airline-16756
09/11/2025, 10:02 AM5060
(for SIP signaling) and 10000-20000
(for RTP media) are open.
3. Configure Telnyx SIP Trunk: In the Telnyx portal, create an FQDN connection using your public IP and port (for example, your-public-ip:5060
). Then, assign your purchased phone number to this trunk.
4. Register the Inbound SIP Trunk in LiveKit: Use the LiveKit CLI or SDK to set up an inbound SIP trunk and link it to your Telnyx number.
5. Create a SIP Dispatch Rule: Define a rule that routes incoming calls to specific rooms within LiveKit.
Once you've completed these steps, your Telnyx number will be ready to route calls directly to your local LiveKit instance. If you’d like, I’m here to help with any of these steps or provide more details—just let me know!future-shampoo-29056
09/11/2025, 10:06 AMwget <https://raw.githubusercontent.com/livekit/sip/main/docker-compose.yaml>
will launch both the server and sip? I already launch livekit server using https://github.com/livekit/livekittall-airline-16756
09/11/2025, 10:06 AMwget <https://raw.githubusercontent.com/livekit/sip/main/docker-compose.yaml>
followed by docker compose up
. This will launch both the LiveKit server and the SIP service together. The Docker Compose file conveniently includes the LiveKit server, a Redis instance, and the SIP server, all set up to work seamlessly.
Since you already have the LiveKit server running separately, you have the option to tweak the Docker Compose file to exclude the LiveKit server and just start the SIP service and Redis. If you'd like, I’m here to help you with adjusting the configuration—just let me know!
Sources: Self-hosted SIP server | LiveKit Docs | Docs::Home | test/integration/sip_test.gofuture-shampoo-29056
09/11/2025, 10:27 AMtall-airline-16756
09/11/2025, 10:28 AM5060
. For example:
<your-public-ip>:5060
To make sure everything runs smoothly, please check that port 5060
(for SIP signaling) and the RTP port range 10000-20000
are open and accessible from the internet. If you'd like, I’m here to help you verify or set this up—just let me know!
Sources: Docs::Home | Docs::Home | SIP trunk setup | LiveKit Docs | Ports and firewall | LiveKit Docs | pkg/sip/service.gofuture-shampoo-29056
09/12/2025, 2:22 AMtall-airline-16756
09/12/2025, 2:23 AMfuture-shampoo-29056
09/12/2025, 2:24 AMtall-airline-16756
09/12/2025, 2:25 AM<TELNYX_PORTAL_URL>
).
◦ Navigate to Voice » SIP Trunking and create a new connection.
◦ Choose FQDN as your connection type.
◦ Enter your FQDN (for example, <http://sip.yourdomain.com|sip.yourdomain.com>
) and specify the SIP port, which is usually 5060
.
◦ Select the transport protocol that fits your setup—either TCP or UDP.
1. Update DNS Records: Double-check that your DNS records (like A or CNAME) correctly point to your public IP address. This step ensures Telnyx can find your SIP server through the FQDN.
2. Test Connectivity: Finally, test to confirm Telnyx can reach your SIP server using the FQDN and port 5060
. Also, make sure the necessary ports (5060 for SIP and 10000-20000 for RTP) are open and accessible.
If you run into any questions or need a hand with any of these steps, please don’t hesitate to reach out—I’m here to help!future-shampoo-29056
09/12/2025, 2:26 AMtall-airline-16756
09/12/2025, 2:27 AM<project>.sip.livekit.cloud
, to make sure everything routes and functions smoothly.
If you’d prefer to use an IP address, no worries! You’d just need to create a DNS record (like an A or CNAME record) that links your public IP to a domain name. Then, you can use that domain name as the FQDN in Telnyx.
Please feel free to reach out if you’d like a hand setting up the DNS record or configuring the FQDN in Telnyx—I’m here to help!
Sources: SIP outbound trunk | LiveKit Docs | Create and configure Telnyx SIP trunk | LiveKit Docsfuture-shampoo-29056
09/12/2025, 2:35 AMtall-airline-16756
09/12/2025, 2:36 AMconst trunk = await sipClient.createSipInboundTrunk(
"telnyx-inbound-trunk",
["+15105550100"],
{
auth_username: "your_telnyx_sip_username",
auth_password: "your_telnyx_sip_password"
}
);
1. Optional: Configure Outbound Trunk:
◦ If you’d like, you can also set up an outbound trunk in LiveKit using Telnyx’s SIP domain (like <http://sip.trunk.telnyx.com|sip.trunk.telnyx.com>
) along with your credentials.
◦ Here’s an example:
{
"trunk": {
"name": "My Telnyx outbound trunk",
"address": "<http://sip.trunk.telnyx.com|sip.trunk.telnyx.com>",
"numbers": [
"+15105550100"
],
"auth_username": "your_telnyx_username",
"auth_password": "your_telnyx_password"
}
}
If you have any questions or need a hand with any of these steps, please don’t hesitate to reach out—I’m here to help!
Sources: Create and configure Telnyx SIP trunk | LiveKit Docs | packages/sip--um-actually/src/setup-livekit.ts | protobufs/livekit_sip.proto | SIP APIs | LiveKit Docs | Making calls using SIP | LiveKit Docsfuture-shampoo-29056
09/12/2025, 3:37 AMtall-airline-16756
09/12/2025, 3:38 AM<te-dev.kaopiz.com>
, which points to port 5060. In this case, your SIP URI would be:
sip:<http://te-dev.kaopiz.com:5060|te-dev.kaopiz.com:5060>
Just a quick reminder to make sure port 5060 is open and accessible from the internet so everything works smoothly. If you have any questions or need a hand with anything else, I’m here to help!future-shampoo-29056
09/12/2025, 3:54 AMtall-airline-16756
09/12/2025, 3:54 AMawait sipClient.createSipInboundTrunk(
"inbound-trunk",
["+1234567890"],
{
auth_username: "your-username",
auth_password: "your-password"
}
);
Just give your trunk a name, add the phone numbers, and include any authentication details if needed. Once that's done, you can create a SIP Dispatch Rule to direct incoming calls to the right rooms.
Outbound SIP Trunk
If you're looking to make outgoing calls, this is the way to go:
await sipClient.createSipOutboundTrunk(
"outbound-trunk",
"<http://sip.example.com|sip.example.com>",
["+1234567890"],
{
auth_username: "your-username",
auth_password: "your-password",
transport: SIPTransport.SIP_TRANSPORT_TCP
}
);
Here, you'll set up the trunk with a name, the SIP server address, phone numbers, and any authentication info you might have. After that, the CreateSIPParticipant
API is your friend for initiating calls.
If anything feels unclear or you want a hand with these steps, just let me know—I’m happy to guide you through it!
Sources: pkg/service/sip.go | packages/livekit-server-sdk/src/SipClient.ts | lib/livekit/proto/livekit_sip_pb.rb | Create and configure a Twilio SIP trunk | LiveKit Docs | livekit-api/livekit/api/sip_service.pyfuture-shampoo-29056
09/12/2025, 3:55 AMtall-airline-16756
09/12/2025, 3:55 AMinbound-trunk.json
) with this content:
{
"trunk": {
"name": "My inbound trunk",
"numbers": [
"+15105550100"
]
}
}
Just be sure to replace +15105550100
with your actual phone number.
1. Next, run this command to create the inbound trunk:
lk sip inbound create inbound-trunk.json
Outbound SIP Trunk
1. Similarly, create a JSON file (like outbound-trunk.json
) with the following:
{
"trunk": {
"name": "My outbound trunk",
"address": "<my-trunk>.<http://pstn.twilio.com|pstn.twilio.com>",
"numbers": [
"+15105550100"
],
"authUsername": "<username>",
"authPassword": "<password>"
}
}
Make sure to replace those placeholders with your SIP provider’s actual details.
1. Then, run this command to create the outbound trunk:
lk sip outbound create outbound-trunk.json
If you have any questions along the way or want some help setting up additional features like dispatch rules, just let me know—I’m here to help!
Sources: Accepting incoming calls | LiveKit Docs | SIP outbound trunk | LiveKit Docsfuture-shampoo-29056
09/12/2025, 3:57 AMtall-airline-16756
09/12/2025, 3:57 AMdispatch-rule.json
with this content for a direct dispatch rule:
{
"dispatch_rule": {
"rule": {
"dispatchRuleDirect": {
"roomName": "open-room",
"pin": "12345"
}
},
"trunk_ids": [
"trunk-123",
"trunk-456"
],
"name": "My dispatch rule",
"metadata": "{\"is_internal\": true}",
"attributes": {
"department": "support",
"priority": "high"
},
"hide_phone_number": true,
"roomConfig": {
"agents": [
{
"agentName": "inbound-agent",
"metadata": "job dispatch metadata"
}
]
}
}
}
This setup will place all callers into the open-room
, require a PIN for access, apply the rule to specific trunks, hide phone numbers for privacy, and assign an agent to handle the calls.
1. Run the CLI command: Simply use this command to create your dispatch rule:
lk sip dispatch create dispatch-rule.json
If you’d like help with other types of rules or want to explore additional configurations, just let me know—I’m here to help!
Sources: Accepting incoming calls | LiveKit Docs | SIP dispatch rule | LiveKit Docs | SIP APIs | LiveKit Docs | Agents telephony integration | LiveKit Docs