Hey everyone, quick SIP routing question: Is ther...
# telephony
a
Hey everyone, quick SIP routing question: Is there a way to select which specific LiveKit SIP region gets used within a country for outbound calls? We’re building an optimization layer around SIP, and we allow our users to declare the country where their traffic will be. For the US we go further and detect East vs West Coast automatically from the area code. However, when creating an outbound SIP rule, the only parameter available is destination_country. What we’re seeing is: • We set "destination_country": "US" • LiveKit consistently uses Ashburn / US-East • Even when calling a West Coast number (206, 415, 510, etc.) • Meanwhile, Twilio forces SF media edges for West Coast numbers • Result: Twilio RTP = San Francisco, LiveKit SIP = Ashburn → adds ~1s latency round-trip We cannot change Twilio’s media region programmatically, Twilio requires contacting support to do that and we’re building a solution where users connect their existing Twilio SIP trunk and “it just works.” So the question: How can we instruct LiveKit Cloud SIP to pin outbound calls specifically to US-West rather than US-East? Is there: • an undocumented region field we can set on the outbound trunk? • a way to pin to subregions like us-west-b? • or any recommended approach to ensure West Coast calls originate from West Coast LiveKit SIP servers? Any guidance would be greatly appreciated, trying to eliminate the cross-country ping-pong between SF and Ashburn. 🙏
l
I see https://github.com/livekit/protocol/pull/1268 was recently added to allow you to specify region in CreateSIPParticipant
f
Thank you Darryn, that is great! Is it available in the Python SDK? I think this pull was only for go?
l
I'm not an expert in this, but I think that's generated code? So, this line has
destination
which wasn't there in the previous version of the file: https://github.com/livekit/python-sdks/blob/main/livekit-protocol/livekit/protocol/sip.pyi#L784
f
Amazing thank you for sharing, I noticed that this destination works BUT it doenst always respect what we send. for example, if u put AU (australia) it will use australia, if you put US, it will us US BUT if you put FR, DE, JO, IL then it will fall back to where the agent is running (ie if my agent is in Virginia, it will use the livekit sip server that is Ashburn but if I run the agent in Jordan, it will run the agent in IL)... Do you guys have any reason that would happen? Maybe it is not yet fully integrated? or maybe it doenst take 2 letter country codes but instead takes the region (ie ASIA, AUS, ME, etc)?
l
I'm not sure how 'production ready' the feature should be considered, @dry-musician-70452 do you please happen to know if there are plans to document the destination region introduced in https://github.com/livekit/protocol/pull/1268 ?
d
unsure, i'll open a convo w the team internally
🙏 2
f
really appreciate your help guys, and if u want us to test anything we are ready. we have already established that this doesnt fully work and that the most reliable way to control livekit locations is by setting the destination country when creating an outbound trunk rule. We have also figured out that these countries codes (US, AU, SA, UK, SG) are respected, if we use other countries they fall back to picking the closest livekit sip server to where the agent is hosted. Happy to run some tests if you guys want