Hey, I have a livekit SIP connection between netGS...
# ask-ai
r
Hey, I have a livekit SIP connection between netGSM and livekit. for some reason, it is not routing. what am I missing? can you give other exampels of people using custom SIP providors in this way? sip trunk info json:{ "sipTrunkId": "ST_dyXdmDURXeTi", "name": "netgsm-inbound-trunk", "numbers": [ "+908508405757", "08508405757", "8508405757", "+08508405757" ] } sip-dispatch-rule-info.json { "sipDispatchRuleId": "SDR_83WWaW3R9CX3", "rule": { "dispatchRuleIndividual": { "roomPrefix": "gsm" } }, "trunkIds": [ "ST_dyXdmDURXeTi" ], "name": "testingRule", "roomConfig": {} } exact error: call but no ring, call duration on netGSM is 0 seconds. netgsm:SIP Trunk Bilgileri ROPE: 569sfrz9k5v.sip.livekit.cloud PORT:5060 SIP Şifresi: password(hidden) SIP Kullanıcı Adı 8508405757 SIP Sunucu Adresi sip.netgsm.com.tr Bağlantı Tipi UDP Bağlantı Portu 5060
t
Thanks for reaching out, Rhythm. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's work through your SIP connection issue between netGSM and LiveKit together. Here are some friendly steps to help you troubleshoot: 1. Verify SIP Trunk Configuration: Double-check that your SIP trunk is set up properly in LiveKit, including the authentication details and phone numbers. Also, make sure your dispatch rules are correctly routing calls to the right LiveKit rooms. 2. Check Network and Firewall Settings: Make sure the necessary ports are open: Also, verify your NAT traversal settings, like using
use_external_ip
for SIP signaling and setting
nat_1_to_1_ip
if needed. ◦ SIP signaling: Port 5060 (UDP/TCP) or 5061 (TLS) ◦ RTP media: Port range 10000-20000 (UDP) 1. Monitor Call Status: Keep an eye on the SIP call status through participant events. If calls disconnect or fail, take note of the failure reason to help pinpoint the issue. 2. Check SIP Provider Compatibility: Make sure netGSM is properly configured to send SIP traffic to your LiveKit SIP instance. For incoming calls, ensure the provider routes calls correctly to LiveKit's SIP service. 3. Log and Debug: Take a look at the SIP logs and participant status updates to see where things might be going wrong. Look out for any specific error codes or messages if calls show as "disconnected" or "error." If you'd like, I’m here to help with any of these steps or answer any questions you have. Just let me know! Sources: SIP trunk setup | LiveKit Docs | Accepting inbound calls | LiveKit Docs | Making outbound calls | LiveKit Docs | Diagnosing Connection Errors with Connection Test Utility | Community & Support | livekit/livekit_composite | DeepWiki
r
where do i check if teh necessary ports are open on the cloud? where do i check all of these things on livketi cloud? number through the lsit and define that
t
Hey there! To make sure the necessary ports are open and your SIP configuration on LiveKit Cloud is all set, here’s a friendly step-by-step guide you can follow: 1. Check Port Requirements: You’ll want to double-check that these ports are open: ◦ SIP signaling: Ports 5060 (UDP/TCP) and 5061 (TLS) for inbound traffic. ◦ RTP media: UDP ports 10000-20000 for two-way traffic. 1. Use Connection Test Utility: Try running the LiveKit Connection Test utility. It’s super handy for spotting any connectivity hiccups by checking WebRTC, WebSocket, and TURN server connections to see if any ports are blocked or causing trouble. 2. Verify Firewall Configuration: Head over to your cloud environment (like AWS or Google Cloud), open up the VPC dashboard, and tweak the inbound rules to add those necessary ports. For example, in AWS, just open the VPC dashboard, pick your security group, and add rules for ports 5060, 5061, and 10000-20000. 3. SIP Configuration Verification: Take a peek at your
config.yaml
file to make sure your SIP service is set up right:Also, you can use command-line tools to see if the SIP service is actually listening on those ports: `netstat -tuln | grep 5060`or
ss -tuln | grep 5060
◦ Set
sip_port
to 5060 and
rtp_port
to 10000-20000. ◦ If you’re using secure SIP, double-check that
tls.port
is set to 5061. 1. Troubleshooting Common Issues: ◦ Make sure your NAT traversal is configured properly. ◦ Double-check your API credentials and SIP trunk setup to avoid authentication problems. ◦ Confirm your dispatch rules are set up correctly to route calls smoothly. If anything’s unclear or you want a hand with any of these steps, just let me know—I’m here to help! Sources: SIP Integration | livekit/livekit_composite | DeepWiki | src/connectionHelper/checks/webrtc.ts | Ports and Firewall | LiveKit Docs
r
where thugh? I am not on aws dude im using fucking live kit
t
On LiveKit Cloud, port configuration is handled for you automatically, so there’s no need to worry about opening or setting up ports yourself. But if you want to double-check or tweak your SIP settings, here’s a friendly walkthrough to guide you: 1. Check Your SIP URI: Head over to your Project Settings page where you’ll find your SIP URI (something like
sip:vjnxecm0tjk.sip.livekit.cloud
). 2. Create SIP Trunks: Jump into Telephony Configuration and set up a new trunk. You can use the JSON editor to add inbound or outbound trunks with all the details you need, like numbers, authentication info, and allowed addresses. 3. Create Dispatch Rules: Still in Telephony Configuration, you can create dispatch rules to send incoming calls to specific LiveKit rooms. The JSON editor lets you define rules based on room names or prefixes—super handy! 4. Firewall Considerations: If you’re working from a corporate network, just make sure your firewall lets traffic through on these ports: ◦ SIP signaling: 5060 (UDP/TCP) and 5061 (TLS) ◦ RTP media: 10000-20000 (UDP) 1. Programmatic Configuration: If you like working with code, you can also manage SIP trunks and dispatch rules using the LiveKit CLI or server SDKs. If you get stuck or want to chat through any of these steps, just let me know—I’m here to help! Sources: Create and configure a Twilio SIP trunk | LiveKit Docs | SIP trunk setup | LiveKit Docs | test/integration/sip_test.go | packages/livekit-server-sdk/src/SipClient.ts | Create and configure SIP trunk | LiveKit Docs
r
if i wish to add teh credentials and ip to this inbound trunk, what is the correct way to do this { "sipTrunkId": "ST_dyXdmDURXeTi", "name": "netgsm-inbound-trunk", "numbers": [ "+908508405757", "08508405757", "8508405757", "+08508405757" ] }
t
Here’s how you can add credentials and allowed IPs to your inbound SIP trunk on LiveKit Cloud — I’ll walk you through it step-by-step: 1. Using the LiveKit Cloud Dashboard: a. Head over to TelephonyConfiguration in your LiveKit Cloud dashboard. b. Either edit an existing trunk or create a new one. c. Make sure the trunk direction is set to Inbound. d. Fill in your SIP credentials in the Username and Password fields. e. Add the IP addresses or CIDR blocks you want to allow under the Allowed Addresses field. f. Don’t forget to save your changes! 1. Using the LiveKit API: If you prefer, you can update the trunk programmatically using the API. Here’s a quick example for updating an existing trunk:
Copy code
curl -X POST \
  https://<YOUR_LIVEKIT_URL>/twirp/livekit.SIP/UpdateSIPInboundTrunk \
  -H "Authorization: Bearer <token-with-sip-admin>" \
  -H 'Content-Type: application/json' \
  -d '{
        "sip_trunk_id": "ST_dyXdmDURXeTi",
        "update": {
          "auth_username": "your_sip_username",
          "auth_password": "your_sip_password",
          "allowed_addresses": ["192.168.1.0/24", "10.0.0.1"]
        }
      }'
Just swap out
<YOUR_LIVEKIT_URL>
with your actual LiveKit instance URL. If you hit any bumps or want me to walk you through any part of this, just let me know — I’m here to help!
s
is allowed addresse a necessary column if u have auth username and pw
t
Hey there! Just a quick note about the 'allowed_addresses' field — it’s not a must-have if you’re already using authentication credentials like auth_username and auth_password for your SIP trunk. Here’s the scoop: • What 'Allowed Addresses' Does: This lets you specify which IP addresses or CIDR blocks can use the SIP trunk. If you leave it blank, all incoming traffic is accepted, and the system just checks the authentication credentials. • How Authentication Works: When you provide auth_username and auth_password, the SIP trunk will only accept calls that successfully authenticate, no matter where they’re coming from. • It’s Optional: The 'allowed_addresses' field adds an extra layer of security by limiting traffic to certain IPs, but you don’t have to use it if you’re comfortable relying on authentication alone. So, if you want to let SIP traffic come from any IP but still require authentication, feel free to skip the 'allowed_addresses' field. And hey, if anything’s unclear or you want to chat more about it, just let me know—I’m here to help!
r
what makes that necessary for inbound?
t
The 'allowed_addresses' field is there to help keep your inbound SIP trunks secure by letting you restrict incoming SIP traffic to certain trusted IP addresses or networks. This way, only the sources you trust can access your trunk, which really helps cut down the chances of any unauthorized access or security issues. You’d want to use this if you’re looking to tighten security by limiting access to specific IPs. But if you’re already using authentication credentials (auth_username and auth_password), you can actually skip this field. Feel free to ask if you want me to explain anything more!
r
does netGSM require us to use auth here?
t
Hey there! Whether netGSM needs authentication (like a username and password) for SIP trunk integration really depends on their specific setup. Most SIP providers, including netGSM, usually do require it, but it’s always a good idea to double-check their documentation or reach out to their support team to be sure. If netGSM does ask for authentication, you can easily set up your LiveKit SIP trunk using the auth_username and auth_password fields. If they don’t require it, feel free to leave those fields out. Just let me know if you want a hand with the configuration or if you have any more info about netGSM’s requirements—I’m here to help!