How can I define a outbound address for sip inboun...
# ask-ai
b
How can I define a outbound address for sip inbound trunk?
t
Thanks for reaching out, Carlos. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! To make sure I’m guiding you in the right direction, could you please let me know if you’re trying to set up an inbound SIP trunk or an outbound SIP trunk? Usually, outbound addresses go with outbound trunks, so understanding exactly what you’re working on will help me assist you better. Sources: livekit/livekit_sip.pb.go | SIP APIs | LiveKit Docs | SIP outbound trunk | LiveKit Docs
b
I'm trying to set up a inbound trunk
t
When setting up an inbound SIP trunk, it’s important to focus on a few key details: • Inbound Addresses: Here, you’ll define the IP addresses or CIDR blocks from which your trunk will accept traffic. • Inbound Numbers: This is where you specify the phone numbers that are allowed to call into your trunk. • Authentication: Don’t forget to use the
auth_username
and
auth_password
fields to securely authenticate incoming SIP invites. Just a quick note: outbound addresses aren’t needed for inbound trunks. If you’d like, I’m here to help you walk through these settings or answer any questions you have!
b
I have livekit server behind a load balancer in Kubernetes so I need livekit set load balancer ip in the SDP message
t
To help make sure the load balancer's IP is correctly set in the SDP message for your LiveKit server behind a Kubernetes load balancer, here’s a simple step-by-step guide you can follow: 1. Enable External IP Detection: Just set
rtc.use_external_ip: true
in your LiveKit configuration. This lets the server use STUN to find and share the load balancer’s external IP in the SDP messages. 2. Expose RTC Ports: Make sure the necessary UDP and TCP ports are open through your Kubernetes load balancer. For example, expose the UDP port range (like 50000–60000) and the TCP port (such as 7881). 3. Verify Load Balancer IP: Run
kubectl get svc
to check the external IP assigned to your load balancer. If needed, update your DNS records to point to this IP. 4. Validate SDP: Try a WebRTC connection and look at the SDP message to confirm the ICE candidates include the load balancer’s external IP. If you run into any issues, please double-check that your STUN servers are reachable and that your firewall rules allow traffic on these ports. Feel free to reach out if you want me to walk you through any part of this—I’m here to help! Sources: config-sample.yaml | examples/server-do.yaml
b
I have configured
rtc.use_external_ip: true
but in the SDP message appears the Cloud NAT IP
t
I understand how frustrating it can be when the Cloud NAT IP shows up in the SDP message even after setting
rtc.use_external_ip: true
. This usually points to a hiccup with external IP discovery or validation. Let’s walk through some steps together to get this sorted out: 1. Verify UDP Port Accessibility: Please check that the UDP port range (like 50000–60000) is open on both your firewall and cloud network settings so inbound traffic can flow smoothly. 2. Test STUN Server Reachability: Make sure the LiveKit server can connect to STUN servers such as
<http://stun.l.google.com:19302|stun.l.google.com:19302>
. If it’s blocked, try allowing outbound UDP on port 19302. 3. Enable Debug Logging: Turning on
debug
logging will give you a detailed look at ICE negotiation and STUN resolution. Keep an eye out for messages like "failed to get external IP." 4. Explicitly Configure Public IP: If automatic discovery isn’t working, it might help to manually set the public IP using orchestration tools or static IP settings. 5. Use External TURN Server: For networks that are more restrictive, enabling a TURN server with TLS on port 443 can be a reliable fallback. I hope these steps help you move forward! If you’d like, I’m here to assist you with any of these configurations—just let me know. Sources: pkg/rtcconfig/config.go | CHANGELOG.md | gclb-sample.yaml | Deploying LiveKit | LiveKit Docs
b
How can I do this? Explicitly Configure Public IP: If automatic discovery isn’t working, it might help to manually set the public IP using orchestration tools or static IP settings.
t
To manually set the public IP in LiveKit, here’s a friendly guide to help you through the process based on your deployment method: 1. Disable Automatic Discovery: In your configuration file, kindly set
rtc.use_external_ip: false
to stop STUN-based IP discovery. This helps keep things clear and controlled. 2. Set the Static Public IP: Add
rtc.node_ip: "your-static-public-ip"
in the configuration file. This way, LiveKit will advertise the exact IP you want in the SDP messages. 3. For Kubernetes Deployments: If you’re using Helm, update the
values.yaml
file like this: `livekit: rtc: node_ip: "your-static-public-ip" use_external_ip: false`Also, please make sure your Kubernetes service or ingress is set up with a static IP (for example, using
loadBalancerIP
). 4. Update DNS: Point your domain (like
<http://livekit.yourdomain.com|livekit.yourdomain.com>
) to the static IP with an A record. This keeps everything connected smoothly. 5. Firewall Rules: Don’t forget to allow inbound traffic on the necessary ports (such as 7880, 7881, and 50000–60000 for media) so everything works seamlessly. If you have any questions or want a hand with a particular step or deployment environment, just let me know—I’m here to help! Sources: Self-hosted SIP server | LiveKit Docs | pkg/config/config.go | pkg/rtcconfig/webrtc_config.go