Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring Trunk and Dispatch on self-hosted SIP Server #256

Closed
osyris opened this issue Jan 9, 2025 · 2 comments
Closed

Configuring Trunk and Dispatch on self-hosted SIP Server #256

osyris opened this issue Jan 9, 2025 · 2 comments
Assignees
Labels
question Further information is requested SIP

Comments

@osyris
Copy link

osyris commented Jan 9, 2025

I think I am missing something obvious. I've created a self-hosted SIP server that is run natively without Docker. I want to use it with LiveKit Cloud Server. My SIP Sever config.yaml is:

log_level: debug
api_key: xxxxxxx
api_secret: xxxxxxx
ws_url: wss://xxxxxx-5cb9cj27.livekit.cloud
health_port: 8080
sip_port: 5060
rtp_port: 10000-20000
use_external_ip: true
redis:
  address: localhost:6379

Server is starting and running nicely.

In the Docs there are instructions on how to add Inbound Trunk and Dispatch Rule but those are added to the LiveKit Cloud.

CleanShot 2025-01-09 at 20 34 34@2x
CleanShot 2025-01-09 at 20 35 12@2x
Is this part done correctly? When using self-hosted SIP Server, do I still need to add Trunk and Dispatch config to the LiveKit Cloud or does need to go somewhere into the self-hosted SIP Server config?

On the Twilio side I also have the SIP-trunk configured and when I call my number I see in the SIP Server logs:

Jan 09 21:39:01 4066261-fk23777 sip[3081]: 2025-01-09T21:39:01.387+0300        INFO        sip        sip/inbound.go:173        processing invite        {"nodeID": "NE_7PbsSX7sWPnH", "callID": "SCL_ZxHsyRYehWg6", "fromIP": "54.171.127.194", "toIP": "188.225.72.77:5060", "fromHost": "rodion-trunk.pstn.twilio.com", "fromUser": "+3725258198", "toHost": "188.225.72.77", "toUser": "+3726510312", "sipTag": "75348722_c3356d0b_11fbc320-60be-4765-b8b7-5a1734195fe9", "sipCallID": "[email protected]", "twilioCallSID": "CA3cb523806805f311638778f6ad3a63d1", "twilioAccSID": "AC75f32eb24a42a26e29ac1a086798f125"}
Jan 09 21:39:02 4066261-fk23777 sip[3081]: 2025-01-09T21:39:02.388+0300        WARN        sip        sip/inbound.go:209        Rejecting inbound, auth check failed        {"nodeID": "NE_7PbsSX7sWPnH", "callID": "SCL_ZxHsyRYehWg6", "fromIP": "54.171.127.194", "toIP": "188.225.72.77:5060", "fromHost": "rodion-trunk.pstn.twilio.com", "fromUser": "+3725258198", "toHost": "188.225.72.77", "toUser": "+3726510312", "sipTag": "75348722_c3356d0b_11fbc320-60be-4765-b8b7-5a1734195fe9", "sipCallID": "[email protected]", "twilioCallSID": "CA3cb523806805f311638778f6ad3a63d1", "twilioAccSID": "AC75f32eb24a42a26e29ac1a086798f125", "error": "no response from servers"}

It says "no response from servers", but what servers is it not getting the response from?

In Twilio the Origination URL is:

SID                                 Friendly Name  Sip URL            Priority  Weight
OU4923984c171009f70f8de239b496218a  null           sip:188.225.72.77  1         1   

Does my config look correct? What am I missing to make this work?

@dennwc dennwc self-assigned this Jan 17, 2025
@dennwc dennwc added question Further information is requested SIP labels Jan 17, 2025
@dennwc
Copy link
Contributor

dennwc commented Jan 17, 2025

This is not a supported configuration, I'm afraid. If you want to self-host, you must run both LiveKit server and LiveKit SIP.

The reason why it currently fails is that you host a separate Redis instance. It is used by LiveKit services as a shared RPC bus. Thus, your SIP server cannot reach LiveKit APIs on the cloud, because it's connecting to a local Redis, not the Cloud RPC bus.

@osyris
Copy link
Author

osyris commented Jan 17, 2025

Thanks for confirming this! After reading the docs further I also found the description of how Redis is used to as the connection layer so it became obvious that my initial setup will not work :)

I am already running both LK Server and LK SIP and everything is working as expected 👌

@osyris osyris closed this as completed Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested SIP
Projects
None yet
Development

No branches or pull requests

2 participants