bored-father-15295
10/09/2025, 8:53 PMtall-airline-16756
10/09/2025, 8:53 PMtall-airline-16756
10/09/2025, 8:53 PMconfig.yaml file to specify the TLS port and the paths to your certificates. For example:
tls:
port: 5061
port_listen: 5061
certs:
- cert_file: /path/to/cert.pem
key_file: /path/to/key.pem
1. Start the SIP Server: Make sure your server is started with a valid tls.Config object and that it listens on the TLS port you set.
2. Network Setup: Don’t forget to open port 5061 (or whichever TLS port you chose) on your firewall to allow SIP/TLS signaling through.
3. Client Configuration: When configuring your client, use the SIP URI with ;transport=tls appended, like this: sip:yourserver.sip.livekit.cloud;transport=tls.
If you need to generate TLS certificates, OpenSSL is a great tool for that. Here’s a handy script to create a self-signed certificate:
#!/usr/bin/env bash
mkdir -p certs && cd certs
# Create self-signed root CA certificate
openssl genrsa -out rootca-key.pem 2048
openssl req -new -x509 -nodes -days 3650 \
-subj "/C=US/ST=California/CN=localhost" \
-key rootca-key.pem \
-out rootca-cert.pem
# Generate server private key and certificate signing request (CSR)
openssl req -newkey rsa:2048 -nodes \
-subj "/C=US/ST=California/CN=localhost" \
-keyout server.key \
-out server.csr
# Sign the server certificate with the root CA
openssl x509 -req -days 3650 -set_serial 01 \
-in server.csr \
-out server.crt \
-CA rootca-cert.pem \
-CAkey rootca-key.pem \
-extensions SAN \
-extfile <(printf "\n[SAN]\nsubjectAltName=IP:127.1.1.100\nextendedKeyUsage=serverAuth")
Just a quick note: replace 127.1.1.100 with your server’s actual public IP address. And when you’re moving to production, it’s best to use certificates from a trusted Certificate Authority to keep everything secure.
Sources: Deploying LiveKit | LiveKit Docs | pkg/sip/server.go | Secure trunking | LiveKit Docs | testdata/generate_certs_rsa.shbored-father-15295
10/09/2025, 9:00 PMtall-airline-16756
10/09/2025, 9:00 PMbored-father-15295
10/09/2025, 9:31 PMtall-airline-16756
10/09/2025, 9:32 PMsip_error: TwirpError(code=unavailable, message=twirp error unknown: no response from servers, status=503), which usually means the SIP server is temporarily unavailable or can’t process the request right now. This can happen sometimes due to misconfigurations or network hiccups.
Let’s walk through some steps that might help resolve this:
1. Check Outbound Trunk Configuration: Double-check that the address field in your outbound trunk exactly matches the SIP endpoint your provider gave you (for example, sip.telnyx.com) and doesn’t include any unsupported subdomains.
2. Verify SIP Trunk and Dispatch Rules: Make sure the trunk ID you’re using in any CreateSIPParticipant request actually exists and is set up correctly.
3. Assess Network and Intermediary Services: Take a look at any load balancers, proxies, or gateways between LiveKit and your SIP provider to spot any potential issues.
4. Review Logs: Checking the LiveKit service logs can be really helpful to see if there are any errors or overload situations causing the temporary unavailability.
If you’ve gone through these steps and things are still not working, it’s a good idea to reach out to your SIP provider. They can confirm if their endpoint is up and running and help ensure they’re not sending back the 503 error.
Sources: livekit-protocol/livekit/protocol/sip.py | livekit-api/src/services/twirp_client.rs | livekit/livekit_sip.twirp.go | protocol/unity_proto/UnityAPI.twirp.go | SIP troubleshooting guide | LiveKit Docsbored-father-15295
10/09/2025, 9:35 PMtall-airline-16756
10/09/2025, 9:35 PMtransport: SIP_TRANSPORT_TLS. Here’s an example to get you started:
{
"trunk": {
"name": "tls-outbound-trunk",
"address": "sip.provider.com",
"numbers": [
"+1234567890"
],
"transport": "SIP_TRANSPORT_TLS",
"auth_username": "your_username",
"auth_password": "your_password",
"media_encryption": "SIP_MEDIA_ENCRYPT_REQUIRE"
}
}
1. Use the Trunk in a CreateSIPParticipant Request: When you make your request, just reference the trunk ID like this:
{
"sip_trunk_id": "ST_XXXX",
"sip_call_to": "+14085551234",
"room_name": "my-secure-call-room",
"participant_identity": "caller-secure-01",
"participant_name": "Secure Caller",
"participant_metadata": "Outbound TLS call",
"dtmf": "1234#",
"play_dialtone": true,
"ringing_timeout": 30,
"max_call_duration": 3600,
"media_encryption": "SIP_MEDIA_ENCRYPT_REQUIRE"
}
Just a quick reminder: please make sure your SIP provider supports TLS and is set up to accept secure signaling on port 5061. If it helps, you can also define the trunk directly inline in your request using the trunk field. If you have any questions or need further assistance, I’m here to help!
Sources: rpc/sip_test.go | Secure trunking | LiveKit Docs | Making outbound calls | LiveKit Docsbored-father-15295
10/09/2025, 10:32 PMtall-airline-16756
10/09/2025, 10:32 PMmedia_encryption parameter to SIP_MEDIA_ENCRYPT_ALLOW instead of SIP_MEDIA_ENCRYPT_REQUIRE. This way, the call can continue even if the other party doesn’t support media encryption (SRTP).
Here’s a friendly example of the updated CreateSIPParticipant request for you to try:
{
"sip_trunk_id": "ST_XXXX",
"sip_call_to": "+14085551234",
"room_name": "my-secure-call-room",
"participant_identity": "caller-secure-01",
"participant_name": "Secure Caller",
"participant_metadata": "Outbound TLS call",
"dtmf": "1234#",
"play_dialtone": true,
"ringing_timeout": 30,
"max_call_duration": 3600,
"media_encryption": "SIP_MEDIA_ENCRYPT_ALLOW"
}
This setup makes sure media encryption is used when available, but it won’t block the call if it’s not supported. If you have any questions or need more help, I’m here for you!bored-father-15295
10/09/2025, 10:38 PMtall-airline-16756
10/09/2025, 10:39 PMmedia_encryption parameter to SIP_MEDIA_ENCRYPT_NONE. This way, media encryption (SRTP) won’t be applied to your call.
Here’s a friendly example of how your CreateSIPParticipant request would look with this setting:
{
"sip_trunk_id": "ST_XXXX",
"sip_call_to": "+14085551234",
"room_name": "my-secure-call-room",
"participant_identity": "caller-secure-01",
"participant_name": "Secure Caller",
"participant_metadata": "Outbound call without encryption",
"dtmf": "1234#",
"play_dialtone": true,
"ringing_timeout": 30,
"max_call_duration": 3600,
"media_encryption": "SIP_MEDIA_ENCRYPT_NONE"
}
With this setup, SRTP is turned off, allowing your call to proceed without media encryption. If you have any questions or need further help, feel free to ask—we’re here to support you!