how can i connect my sip docker compose to use my ...
# ask-ai
s
how can i connect my sip docker compose to use my locally hosted livekit image
t
Thanks for reaching out, Youssef. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! To get your SIP Docker Compose setup connected with a locally hosted LiveKit image, here’s a simple step-by-step guide for you: 1. Download the Docker Compose file: Just run this command:
wget 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.go
s
i already have a livekit server running locally, i want to use it instead of launching one with the sip server
t
Hey there! If you want to connect your existing locally hosted LiveKit server with the SIP server, here’s a friendly step-by-step guide to help you out: 1. Create a SIP server configuration file: Start by making a
config.yaml
file with these settings:
Copy code
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:
Copy code
# 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.yaml
s
i am bit confused, my setup is 2 docker images for each. do i only need the livekit server and add this config to it?
t
Just to make sure I’m on the right track—are you running the LiveKit server and the SIP server in two separate Docker containers, or are you hoping to combine them into one? Usually, the SIP server configuration goes into the SIP server container, not the LiveKit one. If you can share a bit about how your setup looks, I’d be happy to help you figure it out!
s
yes i am already running them as 2 separate containers, here are the docker compose file. services: caddy: image: livekit/caddyl4 command: run --config /etc/caddy.yaml --adapter yaml restart: unless-stopped network_mode: "host" volumes: - ./caddy.yaml:/etc/caddy.yaml - ./caddy_data:/data livekit: image: livekit/livekit-server:latest command: --config /etc/livekit.yaml restart: unless-stopped network_mode: "host" volumes: - ./livekit.yaml:/etc/livekit.yaml redis: image: redis:7-alpine command: redis-server /etc/redis.conf restart: unless-stopped network_mode: "host" volumes: - ./redis.conf:/etc/redis.conf egress: image: livekit/egress:latest restart: unless-stopped environment: - EGRESS_CONFIG_FILE=/etc/egress.yaml network_mode: "host" volumes: - ./egress.yaml:/etc/egress.yaml cap_add: - CAP_SYS_ADMIN ingress: image: livekit/ingress:latest restart: unless-stopped environment: - INGRESS_CONFIG_FILE=/etc/ingress.yaml network_mode: "host" volumes: - ./ingress.yaml:/etc/ingress.yaml sip: image: livekit/sip restart: unless-stopped environment: SIP_CONFIG_BODY: | api_key: ''" 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 network_mode: "host"
t
Thanks so much for sharing your Docker Compose setup! Since you’re already running the LiveKit server and SIP server as separate containers, there’s no need to tweak the LiveKit server configuration. Instead, just make sure your SIP server is set up correctly to connect to your existing LiveKit server. Looking at your configuration, the SIP server is already set to use the WebSocket URL
ws://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!
s
I am facing the following error when i call, i can see in the logs i receive the call but it is never handed to the worker for the agent to answer. logs: ip-1 | 2025-09-08T125506.067Z DEBUG sip service/service.go:145 service ready {"nodeID": "NE_onDZYTa2qhjF"} sip-1 | 2025-09-08T125524.129Z INFO sip sip/inbound.go:178 processing invite {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_GmuwLRxWYAas", "fromIP": "54.172.60.2", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "41051235_c3356d0b_b60b17db-090f-48a2-aaa9-388e802a744e", "sipCallID": "0c675d3dfeed9181f78ed0790756f33a@0.0.0.0", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "twilioCallSID": "CA799ce249afdee746120aac0f649dd36a"} sip-1 | 2025-09-08T125524.148Z DEBUG sip sip/inbound.go:434 Rejecting inbound flood {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_GmuwLRxWYAas", "fromIP": "54.172.60.2", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "41051235_c3356d0b_b60b17db-090f-48a2-aaa9-388e802a744e", "sipCallID": "0c675d3dfeed9181f78ed0790756f33a@0.0.0.0", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "twilioCallSID": "CA799ce249afdee746120aac0f649dd36a", "jitterBuf": false} sip-1 | 2025-09-08T125524.148Z DEBUG Server transaction terminating {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer"} sip-1 | 2025-09-08T125524.148Z DEBUG Server transaction destroyed {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer", "tx": "z9hG4bK5ab.5d53d2cf8622a275c6dc506f498bf07e.0__54.172.60.2__5060__INVITE"} sip-1 | 2025-09-08T125524.148Z INFO sip sip/inbound.go:782 Closing inbound call {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_GmuwLRxWYAas", "fromIP": "54.172.60.2", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "41051235_c3356d0b_b60b17db-090f-48a2-aaa9-388e802a744e", "sipCallID": "0c675d3dfeed9181f78ed0790756f33a@0.0.0.0", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "twilioCallSID": "CA799ce249afdee746120aac0f649dd36a", "jitterBuf": false, "status": 486, "reason": "flood"} sip-1 | 2025-09-08T125524.148Z INFO sip sip/inbound.go:777 call statistics {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_GmuwLRxWYAas", "fromIP": "54.172.60.2", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "41051235_c3356d0b_b60b17db-090f-48a2-aaa9-388e802a744e", "sipCallID": "0c675d3dfeed9181f78ed0790756f33a@0.0.0.0", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "twilioCallSID": "CA799ce249afdee746120aac0f649dd36a", "jitterBuf": false, "status": 486, "reason": "flood", "stats": {"port":{"streams":0,"packets":0,"packets_ignored":0,"packets_input":0,"mux_packets":0,"mux_bytes":0,"audio_packets":0,"audio_bytes":0,"dtmf_packets":0,"dtmf_bytes":0},"room":{"input_packets":0,"input_bytes":0,"mixer_samples":0,"mixer_frames":0,"output_samples":0,"output_frames":0},"mixer":{"tracks":0,"tracks_total":0,"restarts":0,"mixes":0,"mixes_timed":0,"mixes_jump":0,"mixes_zero":0,"input_samples":0,"input_frames":0,"mixed_samples":0,"mixed_frames":0,"output_samples":0,"output_frames":0}}} sip-1 | 2025-09-08T125524.150Z DEBUG Server transaction terminating {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer"} sip-1 | 2025-09-08T125524.150Z DEBUG Server transaction destroyed {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer", "tx": "z9hG4bK5ab.5d53d2cf8622a275c6dc506f498bf07e.0__54.172.60.2__5060__INVITE"} sip-1 | 2025-09-08T125703.250Z INFO sip sip/inbound.go:178 processing invite {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_edtit7xqCP4h", "fromIP": "54.172.60.1", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "93676408_c3356d0b_fbd8fc6d-2888-4a4b-b42e-87f7a3c774a3", "sipCallID": "cc92b0cde641a3bbcf67699a0db3fe8a@0.0.0.0", "twilioCallSID": "CA50af31e0cce6693131846bfbdeefd79a", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e"} sip-1 | 2025-09-08T125703.259Z DEBUG sip sip/inbound.go:434 Rejecting inbound flood {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_edtit7xqCP4h", "fromIP": "54.172.60.1", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "93676408_c3356d0b_fbd8fc6d-2888-4a4b-b42e-87f7a3c774a3", "sipCallID": "cc92b0cde641a3bbcf67699a0db3fe8a@0.0.0.0", "twilioCallSID": "CA50af31e0cce6693131846bfbdeefd79a", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "jitterBuf": false} sip-1 | 2025-09-08T125703.259Z DEBUG Server transaction terminating {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer"} sip-1 | 2025-09-08T125703.259Z DEBUG Server transaction destroyed {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer", "tx": "z9hG4bKbe74.d305a2bde5923877454427978d6d37c3.0__54.172.60.1__5060__INVITE"} sip-1 | 2025-09-08T125703.259Z INFO sip sip/inbound.go:782 Closing inbound call {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_edtit7xqCP4h", "fromIP": "54.172.60.1", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "93676408_c3356d0b_fbd8fc6d-2888-4a4b-b42e-87f7a3c774a3", "sipCallID": "cc92b0cde641a3bbcf67699a0db3fe8a@0.0.0.0", "twilioCallSID": "CA50af31e0cce6693131846bfbdeefd79a", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "jitterBuf": false, "status": 486, "reason": "flood"} sip-1 | 2025-09-08T125703.260Z INFO sip sip/inbound.go:777 call statistics {"nodeID": "NE_onDZYTa2qhjF", "callID": "SCL_edtit7xqCP4h", "fromIP": "54.172.60.1", "toIP": "34.166.35.83:5060", "fromHost": "wittify-99a6022e.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "93676408_c3356d0b_fbd8fc6d-2888-4a4b-b42e-87f7a3c774a3", "sipCallID": "cc92b0cde641a3bbcf67699a0db3fe8a@0.0.0.0", "twilioCallSID": "CA50af31e0cce6693131846bfbdeefd79a", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "jitterBuf": false, "status": 486, "reason": "flood", "stats": {"port":{"streams":0,"packets":0,"packets_ignored":0,"packets_input":0,"mux_packets":0,"mux_bytes":0,"audio_packets":0,"audio_bytes":0,"dtmf_packets":0,"dtmf_bytes":0},"room":{"input_packets":0,"input_bytes":0,"mixer_samples":0,"mixer_frames":0,"output_samples":0,"output_frames":0},"mixer":{"tracks":0,"tracks_total":0,"restarts":0,"mixes":0,"mixes_timed":0,"mixes_jump":0,"mixes_zero":0,"input_samples":0,"input_frames":0,"mixed_samples":0,"mixed_frames":0,"output_samples":0,"output_frames":0}}} sip-1 | 2025-09-08T125703.261Z DEBUG Server transaction terminating {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer"} sip-1 | 2025-09-08T125703.261Z DEBUG Server transaction destroyed {"nodeID": "NE_onDZYTa2qhjF", "caller": "transaction.Layer", "tx": "z9hG4bKbe74.d305a2bde5923877454427978d6d37c3.0__54.172.60.1__5060__INVITE"}
t
Hey there! The error "Rejecting inbound flood" in your SIP server logs usually means that the incoming call doesn’t match any of your configured SIP Inbound Trunks or their rules. This often happens when the SIP server can’t authenticate or route the call because something’s missing or set up incorrectly. Here’s how you can fix it: 1. Set up a SIP Inbound Trunk: Make sure you have a SIP Inbound Trunk configured that matches the incoming call’s details. This includes: ◦ Allowed Addresses: Specify the source IP addresses or CIDR blocks where calls are accepted from. For example:
allowed_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.proto
s
how can i list the rules cli
t
Hey there! To see all your SIP dispatch rules using the LiveKit CLI, just run this command:
Copy code
lk 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 Docs
s
using python
t
Hey there! Are you working with the LiveKit Python SDK or making direct API calls to the LiveKit server? If you're using the SDK, I’d be happy to walk you through the exact method to list SIP dispatch rules. Just let me know what setup you have, and I’ll help you out!
s
Yes SDK please
t
If you want to list SIP dispatch rules using the LiveKit Python SDK, you can easily do that with the
list_dispatch_rule
method from the
SIPService
class. Here’s a quick example to get you started:
Copy code
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.go
s
Everything is working but it is returning 401 now invalid token, logs: sip-1 ö 2025-09-08T132030.100Z ERROR sip sip/inbound.go:903 Cannot create LiveKit participant ä"nodeID": "NE_9qYp7KmmsWwP", "callID": "SCL_uf5uSEtLNtGp", "fromIP": "54.172.60.3", "toIP": "34.166.35.83:5060", "fromHost": "wittify-9e681a17.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "52457253_c3356d0b_5981dded-9422-41f1-a304-69f9d92daa96", "sipCallID": "7c35d6c46fba59c0df9e90169234d20dÉ0.0.0.0", "twilioCallSID": "CAfeece588ca30f0fd7dd570c479bce36c", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "sipTrunk": "ST_qXVVqUkhDxVe", "jitterBuf": false, "sipTrunk": "ST_qXVVqUkhDxVe", "sipRule": "SDR_aFoUwqUUHqX6", "room": "+16315282343_WtnSQvUHMs5i", "participant": "sip_+201202096505", "participantName": "Phone +201202096505", "error": "unauthorized: invalid token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdHRyaWJ1dGVzIjp7InNpcC5jYWxsSUQiOiJTQ0xfdWY1dVNFdExOdEdwIiwic2lwLnBob25lTnVtYmVyIjoiKzIwMTIwMjA5NjUwNSIsInNpcC5ydWxlSUQiOiJTRFJfYUZvVXdxVVVIcVg2Iiwic2lwLnRydW5rSUQiOiJTVF9xWFZWcVVraER4VmUiLCJzaXAudHJ1bmtQaG9uZU51bWJlciI6IisxNjMxNTI4MjM0MyJ9LCJleHAiOjE3NTc0MjQwMzAsImlzcyI6IkFQSTdEWENCY1NHa2VLaiIsImtpbmQiOiJzaXAiLCJtZXRhZGF0YSI6IntcImFnZW50X2lkXCI6IFwiYmVkNDMwMmEtMTljMy00ZDdiLThlZGItNDgxMGM1NWI3MWQ5XCIsIFwidXNlcl9pZFwiOiBcIjhlZGEyYTRiLTAyYjMtNGE2Ni1hYzNmLTg2ZGViODQwNDBmOVwifSIsIm5hbWUiOiJQaG9uZSArMjAxMjAyMDk2NTA1IiwibmJmIjoxNzU3MzM3NjMwLCJyb29tQ29uZmlnIjp7ImFnZW50cyI6W3siYWdlbnROYW1lIjoidGVsZXBob255LWFnZW50IiwibWV0YWRhdGEiOiJ7XCJhZ2VudF9pZFwiOiBcImJlZDQzMDJhLTE5YzMtNGQ3Yi04ZWRiLTQ4MTBjNTViNzFkOVwiLCBcInVzZXJfaWRcIjogXCI4ZWRhMmE0Yi0wMmIzLTRhNjYtYWMzZi04NmRlYjg0MDQwZjlcIn0ifV19LCJzdWIiOiJzaXBfKzIwMTIwMjA5NjUwNSIsInZpZGVvIjp7ImNhblB1Ymxpc2giOnRydWUsImNhblB1Ymxpc2hEYXRhIjp0cnVlLCJjYW5TdWJzY3JpYmUiOnRydWUsImNhblVwZGF0ZU93bk1ldGFkYXRhIjp0cnVlLCJyb29tIjoiKzE2MzE1MjgyMzQzX1d0blNRdlVITXM1aSIsInJvb21Kb2luIjp0cnVlfX0.OkgGKgjnIQ5m0SDcu0XpDhG4X_BoGPeXyJ5WJt_1-HQ, error: go-jose/go-jose: error in cryptographic primitive"å sip-1 ö github.com/livekit/sip/pkg/sip.(*inboundCall).joinRoom sip-1 ö /workspace/pkg/sip/inbound.go:903 sip-1 ö github.com/livekit/sip/pkg/sip.(*inboundCall).handleInvite sip-1 ö /workspace/pkg/sip/inbound.go:535 sip-1 ö github.com/livekit/sip/pkg/sip.(*Server).processInvite sip-1 ö /workspace/pkg/sip/inbound.go:274 sip-1 ö github.com/livekit/sip/pkg/sip.(*Server).onInvite sip-1 ö /workspace/pkg/sip/inbound.go:128 sip-1 ö github.com/livekit/sipgo.(*Server).handleRequest sip-1 ö /go/pkg/mod/github.com/livekit/sipgoÉv0.13.2-0.20250601220430-a77cc3f220fb/server.go:235 sip-1 ö 2025-09-08T132030.100Z WARN sip sip/inbound.go:780 Closing inbound call with error ä"nodeID": "NE_9qYp7KmmsWwP", "callID": "SCL_uf5uSEtLNtGp", "fromIP": "54.172.60.3", "toIP": "34.166.35.83:5060", "fromHost": "wittify-9e681a17.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "52457253_c3356d0b_5981dded-9422-41f1-a304-69f9d92daa96", "sipCallID": "7c35d6c46fba59c0df9e90169234d20dÉ0.0.0.0", "twilioCallSID": "CAfeece588ca30f0fd7dd570c479bce36c", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "sipTrunk": "ST_qXVVqUkhDxVe", "jitterBuf": false, "sipTrunk": "ST_qXVVqUkhDxVe", "sipRule": "SDR_aFoUwqUUHqX6", "room": "+16315282343_WtnSQvUHMs5i", "participant": "sip_+201202096505", "participantName": "Phone +201202096505", "status": 486, "reason": "participant-failed"å sip-1 ö 2025-09-08T132030.101Z DEBUG Server transaction terminating ä"nodeID": "NE_9qYp7KmmsWwP", "caller": "transaction.Layer"å sip-1 ö 2025-09-08T132030.101Z DEBUG Server transaction destroyed ä"nodeID": "NE_9qYp7KmmsWwP", "caller": "transaction.Layer", "tx": "z9hG4bK9163.c8457513903ba2592deee606f713bdfa.0__54.172.60.3__5060__INVITE"å sip-1 ö 2025-09-08T132030.101Z INFO sip sip/inbound.go:801 Inbound call closed ä"nodeID": "NE_9qYp7KmmsWwP", "callID": "SCL_uf5uSEtLNtGp", "fromIP": "54.172.60.3", "toIP": "34.166.35.83:5060", "fromHost": "wittify-9e681a17.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "52457253_c3356d0b_5981dded-9422-41f1-a304-69f9d92daa96", "sipCallID": "7c35d6c46fba59c0df9e90169234d20dÉ0.0.0.0", "twilioCallSID": "CAfeece588ca30f0fd7dd570c479bce36c", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "sipTrunk": "ST_qXVVqUkhDxVe", "jitterBuf": false, "sipTrunk": "ST_qXVVqUkhDxVe", "sipRule": "SDR_aFoUwqUUHqX6", "room": "+16315282343_WtnSQvUHMs5i", "participant": "sip_+201202096505", "participantName": "Phone +201202096505", "status": 486, "reason": "participant-failed"å sip-1 ö 2025-09-08T132030.101Z INFO sip sip/inbound.go:777 call statistics ä"nodeID": "NE_9qYp7KmmsWwP", "callID": "SCL_uf5uSEtLNtGp", "fromIP": "54.172.60.3", "toIP": "34.166.35.83:5060", "fromHost": "wittify-9e681a17.pstn.twilio.com", "fromUser": "+201202096505", "toHost": "34.166.35.83", "toUser": "+16315282343", "sipTag": "52457253_c3356d0b_5981dded-9422-41f1-a304-69f9d92daa96", "sipCallID": "7c35d6c46fba59c0df9e90169234d20dÉ0.0.0.0", "twilioCallSID": "CAfeece588ca30f0fd7dd570c479bce36c", "twilioAccSID": "ACedcbbde4a95c83560dfa68748b08490e", "sipTrunk": "ST_qXVVqUkhDxVe", "jitterBuf": false, "sipTrunk": "ST_qXVVqUkhDxVe", "sipRule": "SDR_aFoUwqUUHqX6", "room": "+16315282343_WtnSQvUHMs5i", "participant": "sip_+201202096505", "participantName": "Phone +201202096505", "status": 486, "reason": "participant-failed", "stats": ä"port":ä"streams":0,"packets":0,"packets_ignored":0,"packets_input":0,"mux_packets":0,"mux_bytes":0,"audio_packets":0,"audio_bytes":0,"dtmf_packets":0,"dtmf_bytes":0å,"room":ä"input_packets":0,"input_bytes":0,"mixer_samples":0,"mixer_frames":0,"output_samples":0,"output_frames":0å,"mixer":ä"tracks":0,"tracks_total":0,"restarts":0,"mixes":0,"mixes_timed":0,"mixes_jump":0,"mixes_zero":0,"input_samples":0,"input_frames":0,"mixed_samples":0,"mixed_frames":0,"output_samples":0,"output_frames":0ååå sip-1 ö 2025-09-08T132030.104Z DEBUG Server transaction terminating ä"nodeID": "NE_9qYp7KmmsWwP", "caller": "transaction.Layer"å sip-1 ö 2025-09-08T132030.104Z DEBUG Server transaction destroyed ä"nodeID": "NE_9qYp7KmmsWwP", "caller": "transaction.Layer", "tx": "z9hG4bK9163.c8457513903ba2592deee606f713bdfa.0__54.172.60.3__5060__INVITE"å sip-1 ö 2025-09-08T132030.281Z DEBUG Server transaction terminating ä"nodeID": "NE_9qYp7KmmsWwP", "caller": "transaction.Layer"å sip-1 ö 2025-09-08T132030.282Z DEBUG Server transaction destroyed ä"nodeID": "NE_9qYp7KmmsWwP", "caller": "transaction.Layer", "tx": "z9hG4bK9163.c8457513903ba2592deee606f713bdfa.0__54.172.60.3__5060__INVITE"å
t
It looks like the "unauthorized: invalid token" error in your SIP server logs is pointing to a hiccup with the authentication token. No worries—here are some friendly steps to help you sort it out: 1. Verify API Key and Secret: Double-check that the API key and secret you’re using to create the token are spot-on and match what’s set up in your LiveKit server. 2. Check Token Format: Make sure your token is a valid JWT and that it’s included in the authorization header exactly like
Bearer <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.go
s
I am sure the secret and api key are correct, where to look other than that logs: livekit-1 | 2025-09-08T140749.078Z WARN livekit service/utils.go:53 error handling request {"status": 401, "method": "GET", "path": "/rtc", "error": "invalid token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdHRyaWJ1dGVzIjp7InNpcC5jYWxsSUQiOiJTQ0xfa0NxdTN1OEVHWENoIiwic2lwLnBob25lTnVtYmVyIjoiKzIwMTIwMjA5NjUwNSIsInNpcC5ydWxlSUQiOiJTRFJfZDdoYnluUkM3WXdSIiwic2lwLnRydW5rSUQiOiJTVF9xaFg0bm1tVmFjeVQiLCJzaXAudHJ1bmtQaG9uZU51bWJlciI6IisxNjMxNTI4MjM0MyJ9LCJleHAiOjE3NTc0MjY4NjksImlzcyI6IkFQSTdEWENCY1NHa2VLaiIsImtpbmQiOiJzaXAiLCJtZXRhZGF0YSI6IntcImFnZW50X2lkXCI6IFwiYmVkNDMwMmEtMTljMy00ZDdiLThlZGItNDgxMGM1NWI3MWQ5XCIsIFwidXNlcl9pZFwiOiBcIjhlZGEyYTRiLTAyYjMtNGE2Ni1hYzNmLTg2ZGViODQwNDBmOVwifSIsIm5hbWUiOiJQaG9uZSArMjAxMjAyMDk2NTA1IiwibmJmIjoxNzU3MzQwNDY5LCJyb29tQ29uZmlnIjp7ImFnZW50cyI6W3siYWdlbnROYW1lIjoidGVsZXBob255LWFnZW50IiwibWV0YWRhdGEiOiJ7XCJhZ2VudF9pZFwiOiBcImJlZDQzMDJhLTE5YzMtNGQ3Yi04ZWRiLTQ4MTBjNTViNzFkOVwiLCBcInVzZXJfaWRcIjogXCI4ZWRhMmE0Yi0wMmIzLTRhNjYtYWMzZi04NmRlYjg0MDQwZjlcIn0ifV19LCJzdWIiOiJzaXBfKzIwMTIwMjA5NjUwNSIsInZpZGVvIjp7ImNhblB1Ymxpc2giOnRydWUsImNhblB1Ymxpc2hEYXRhIjp0cnVlLCJjYW5TdWJzY3JpYmUiOnRydWUsImNhblVwZGF0ZU93bk1ldGFkYXRhIjp0cnVlLCJyb29tIjoiKzE2MzE1MjgyMzQzX3JoNE5VU290dldMRiIsInJvb21Kb2luIjp0cnVlfX0.1LrGB343tDop4-JpFKtrcvR3WXw6uN4UwG5KV68wyEg, error: go-jose/go-jose: error in cryptographic primitive"} livekit-1 | 2025-09-08T140749.079Z WARN livekit service/utils.go:53 error handling request {"status": 401, "method": "GET", "path": "/rtc/validate", "error": "invalid token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdHRyaWJ1dGVzIjp7InNpcC5jYWxsSUQiOiJTQ0xfa0NxdTN1OEVHWENoIiwic2lwLnBob25lTnVtYmVyIjoiKzIwMTIwMjA5NjUwNSIsInNpcC5ydWxlSUQiOiJTRFJfZDdoYnluUkM3WXdSIiwic2lwLnRydW5rSUQiOiJTVF9xaFg0bm1tVmFjeVQiLCJzaXAudHJ1bmtQaG9uZU51bWJlciI6IisxNjMxNTI4MjM0MyJ9LCJleHAiOjE3NTc0MjY4NjksImlzcyI6IkFQSTdEWENCY1NHa2VLaiIsImtpbmQiOiJzaXAiLCJtZXRhZGF0YSI6IntcImFnZW50X2lkXCI6IFwiYmVkNDMwMmEtMTljMy00ZDdiLThlZGItNDgxMGM1NWI3MWQ5XCIsIFwidXNlcl9pZFwiOiBcIjhlZGEyYTRiLTAyYjMtNGE2Ni1hYzNmLTg2ZGViODQwNDBmOVwifSIsIm5hbWUiOiJQaG9uZSArMjAxMjAyMDk2NTA1IiwibmJmIjoxNzU3MzQwNDY5LCJyb29tQ29uZmlnIjp7ImFnZW50cyI6W3siYWdlbnROYW1lIjoidGVsZXBob255LWFnZW50IiwibWV0YWRhdGEiOiJ7XCJhZ2VudF9pZFwiOiBcImJlZDQzMDJhLTE5YzMtNGQ3Yi04ZWRiLTQ4MTBjNTViNzFkOVwiLCBcInVzZXJfaWRcIjogXCI4ZWRhMmE0Yi0wMmIzLTRhNjYtYWMzZi04NmRlYjg0MDQwZjlcIn0ifV19LCJzdWIiOiJzaXBfKzIwMTIwMjA5NjUwNSIsInZpZGVvIjp7ImNhblB1Ymxpc2giOnRydWUsImNhblB1Ymxpc2hEYXRhIjp0cnVlLCJjYW5TdWJzY3JpYmUiOnRydWUsImNhblVwZGF0ZU93bk1ldGFkYXRhIjp0cnVlLCJyb29tIjoiKzE2MzE1MjgyMzQzX3JoNE5VU290dldMRiIsInJvb21Kb2luIjp0cnVlfX0.1LrGB343tDop4-JpFKtrcvR3WXw6uN4UwG5KV68wyEg, error: go-jose/go-jose: error in cryptographic primitive"}
t
Hey there! The 'invalid token' error in your LiveKit logs usually means there’s a hiccup with the JWT token used for authentication. Let’s walk through some things you can check: 1. Token Expiry: Double-check that the token’s
exp
(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!
s
how to check the api key and secret in my locally livekit server
t
Hey there! To check the API key and secret on your locally hosted LiveKit server, here’s a quick guide to help you out: 1. Default Development Credentials: If you’re running the server in development mode using
livekit-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