salmon-lighter-12882
09/08/2025, 12:15 PMtall-airline-16756
09/08/2025, 12:15 PMtall-airline-16756
09/08/2025, 12:16 PMwget https://raw.githubusercontent.com/livekit/sip/main/docker-compose.yaml
2. Start the services: Next, start everything up by running:
docker compose up
This will launch a local LiveKit server, a Redis instance, and the SIP server all together.
3. Configuration details: The docker-compose.yaml file already sets up the services with what they need — like API credentials, WebSocket URL, Redis address, SIP port (5060), and the RTP port range (10000-20000).
4. Network configuration: All services use network_mode: host so they share your machine’s network stack, which helps them talk to each other smoothly.
5. Firewall considerations: Make sure your firewall lets through the SIP signaling port (5060) and the media port range (10000-20000) so everything works from the Internet.
6. API credentials: Don’t forget to swap out any placeholder credentials with your real LiveKit server credentials.
7. Determine SIP URI: Use your machine’s public IP address to create the SIP URI like this: <public-ip-address>:5060.
8. Create SIP Trunk and Dispatch Rule: Finally, use the LiveKit CLI or server SDKs to set up inbound addresses, outbound settings, and routing rules for your calls.
Just double-check your firewall settings to make sure those ports are open. If you hit any bumps or want a hand with anything else, feel free to ask—I’m here to help!
Sources: Self-hosted SIP server | LiveKit Docs | test/integration/sip_test.gosalmon-lighter-12882
09/08/2025, 12:31 PMtall-airline-16756
09/08/2025, 12:31 PMconfig.yaml file with these settings:
api_key: <your-api-key>
api_secret: <your-api-secret>
ws_url: ws://localhost:7880
redis:
address: localhost:6379
sip_port: 5060
rtp_port: 10000-20000
use_external_ip: true
logging:
level: debug
2. Run the SIP server: You have two easy options:
◦ Use Docker: Grab the docker-compose.yaml file and start the SIP server with:
wget https://raw.githubusercontent.com/livekit/sip/main/docker-compose.yaml
docker compose up
◦ Run it natively: Build the SIP server with Go and run it using your config file:
livekit-sip --config=config.yaml
1. Create SIP Trunk and Dispatch Rule: Use the LiveKit CLI to set up a SIP trunk and dispatch rule to route calls to the right rooms. Here’s how:
# Create SIP Trunk
livekit-cli create-sip-trunk --request trunk_request.json
# Create SIP Dispatch Rule
livekit-cli create-sip-dispatch-rule --request dispatch_request.json
2. Make sure your network is accessible: Double-check that the SIP signaling port (5060) and media ports (10000-20000) are open and reachable from the internet.
3. Find your SIP URI: Use your machine’s public IP address to form the SIP URI like this: <public-ip-address>:5060.
If you hit any bumps or want me to walk you through any part, just give me a shout—I’m here to help!
Sources: Self-hosted SIP server | LiveKit Docs | docker-compose.yamlsalmon-lighter-12882
09/08/2025, 12:50 PMtall-airline-16756
09/08/2025, 12:50 PMsalmon-lighter-12882
09/08/2025, 12:52 PMtall-airline-16756
09/08/2025, 12:53 PMws://localhost:7880 and Redis at localhost:6379. All you need to do is swap out the placeholder api_key and api_secret with your actual LiveKit server credentials.
Here’s a quick rundown of what to do next:
1. Update the SIP server environment: Pop in your real API credentials for the LiveKit server by replacing the api_key and api_secret inside the SIP_CONFIG_BODY.
2. Restart the SIP server: Once that’s done, restart the SIP container so the changes take effect:
docker compose restart sip
3. Check the connection: Make sure the SIP server is chatting smoothly with the LiveKit server and Redis. You can peek at the SIP container logs to spot any hiccups:
docker logs sip
If you hit any snags or want a hand with anything else, just give me a shout!salmon-lighter-12882
09/08/2025, 12:58 PMtall-airline-16756
09/08/2025, 12:59 PMallowed_addresses: ["54.172.60.2/32"]
◦ Numbers: Define which destination phone numbers this trunk will handle. For example:
numbers: ["+16315282343"]
◦ Authentication: If your SIP provider needs authentication, don’t forget to add the auth_username and auth_password fields.
1. Create a SIP Dispatch Rule: Once your trunk is ready, set up a dispatch rule to route calls to a specific LiveKit room or create a new one. You can use the LiveKit CLI or API for this.
2. Restart the SIP Server: To make sure your changes take effect, restart the SIP server container with:
docker compose restart sip
3. Check the Logs: Take a peek at the SIP server logs to confirm that the incoming call is now being handled properly.
If you’d like, I’m happy to help you create the trunk or dispatch rule with some detailed examples or step-by-step guidance—just let me know!
Sources: pkg/sip/inbound.go | protobufs/livekit_sip.protosalmon-lighter-12882
09/08/2025, 1:01 PMtall-airline-16756
09/08/2025, 1:01 PMlk sip dispatch list
It’ll show you all the SIP dispatch rules set up in your LiveKit environment. If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: autocomplete/fish_autocomplete | SIP dispatch rule | LiveKit Docssalmon-lighter-12882
09/08/2025, 1:04 PMtall-airline-16756
09/08/2025, 1:04 PMsalmon-lighter-12882
09/08/2025, 1:04 PMtall-airline-16756
09/08/2025, 1:05 PMlist_dispatch_rule method from the SIPService class. Here’s a quick example to get you started:
from livekit.api import SIPService, ListSIPDispatchRuleRequest
# Initialize the SIP service
sip_service = SIPService(api_key="your-api-key", api_secret="your-secret-key", host="your-host")
# List all dispatch rules
response = await sip_service.list_dispatch_rule(ListSIPDispatchRuleRequest())
for rule in response.items:
print(f"Rule ID: {rule.sip_dispatch_rule_id}, Name: {rule.name}")
Just swap out your-api-key, your-secret-key, and your-host with your LiveKit credentials and server URL. If you hit any bumps or want to chat more about it, I’m here to help!
Sources: SIP dispatch rule | LiveKit Docs | livekit-protocol/livekit/protocol/sip.pyi | livekit/livekit_sip.twirp.gosalmon-lighter-12882
09/08/2025, 1:21 PMtall-airline-16756
09/08/2025, 1:22 PMBearer <token>. The token should be properly generated and formatted.
3. Inspect SIP Trunk Configuration: Take a look at your SIP trunk setup in LiveKit and confirm that the Trunk ID mentioned in the logs is correct.
4. Review Logs for Specific Errors: Peek through the logs for any extra clues—like missing credentials, mismatched secrets, or tokens that might be malformed.
5. Regenerate the Token: If your token’s expired or just not working, try generating a new one using the right API key and secret.
If you want a hand creating a valid token or digging deeper into this, just give me a shout—I’m here to help!
Sources: SIP troubleshooting guide | LiveKit Docs | pkg/sip/inbound.go | livekit-api/src/services/mod.rs | pkg/service/auth.gosalmon-lighter-12882
09/08/2025, 2:09 PMtall-airline-16756
09/08/2025, 2:10 PMexp (expiration) claim is set to a future time. If it’s expired, it won’t work.
2. Token Issuer: Make sure the iss (issuer) claim matches the API key you used to sign the token. If they don’t line up, the token won’t validate.
3. Signing Key: Confirm the token is signed with the correct secret key tied to your API key. Even a small mismatch can cause this error.
4. Token Claims: Take a look at the claims inside the token (like roomConfig, metadata) to ensure they’re formatted properly and fit your intended use.
5. Token Generation: If you’re creating the token programmatically, double-check that the library or method you’re using plays nicely with LiveKit’s JWT requirements.
6. Logs for Details: Your logs show the token got rejected—try decoding it with a JWT decoder tool to peek inside and verify its claims.
If you want a hand debugging the token or need help generating a fresh one, just give me a shout—I’m here to help!salmon-lighter-12882
09/08/2025, 2:15 PMtall-airline-16756
09/08/2025, 2:16 PMlivekit-server --dev, the default API key and secret are:
◦ API key: devkey
◦ API secret: secret
1. Check Environment Variables: Take a look at the LIVEKIT_API_KEY and LIVEKIT_API_SECRET variables in your config files (like .env or .env.local). Here’s an example:
LIVEKIT_API_KEY=devkey\nLIVEKIT_API_SECRET=secret\nLIVEKIT_URL=ws://localhost:7880
2. Set Environment Variables: If you need to, you can set them directly in your terminal like this:
export LIVEKIT_API_KEY=devkey\nexport LIVEKIT_API_SECRET=secret\nexport LIVEKIT_URL=ws://localhost:7880
If you want a hand double-checking or updating these credentials, just let me know—I’m here to help!
Sources: Next.js quickstart | LiveKit Docs | Next.js 12 quickstart | LiveKit Docs | packages/livekit-server-sdk/src/AccessToken.ts | Accepting incoming calls | LiveKit Docs | Running LiveKit locally | LiveKit Docs