Self-hosted SIP server with LiveKit Cloud – is this supported?

We are trying to understand whether a self-hosted SIP server can work with the LiveKit Cloud dashboard.

Our setup:

  • We have already self-hosted a SIP server using Docker Compose.

  • In our configuration (config.yaml / docker-compose.yaml), we provided:

    • LiveKit Cloud wss_url

    • api_key

    • api_secret

  • We opened ports 5060 and 5061 (and temporarily all ports for testing).

What we tested:

  • We successfully tested SIP integration using Plivo with the LiveKit Cloud SIP server, and it worked as expected.

  • However, when switching to our self-hosted SIP server, all calls result in a busy line.

Our question:

  • Is it actually supported to use a self-hosted SIP server with LiveKit Cloud?

  • If yes, are there any additional configuration steps required that we might be missing?

We’d appreciate any guidance on:

  • Required SIP configuration for LiveKit Cloud

  • Networking/firewall considerations

  • Any known limitations when mixing self-hosted SIP with LiveKit Cloud

Thanks in advance for your help!

@darryncampbell can you please give us a answer on this.

Looks like this question also came up last year and the answer was no:

Why are you looking to deploy with this configuration?

@darryncampbell we just figured it out, Self Host SIP Server is working with Livekit cloud dashboard. We had problem with our SIP provider.

Hello @darryncampbell @Aman misunderstood this.

This issue is still not resolved — we’re continuing to face the same problem. Here’s a clear breakdown of what we’ve implemented:

  1. We are using Plivo as our telephony provider for an Indian number. On Plivo, we configured an inbound trunk by pointing it to our self-hosted SIP server.

  2. On our self-hosted SIP server, we are using our LiveKit Cloud credentials (WSS URL, API key, and secret) to connect.

  3. On LiveKit Cloud, we have configured both the inbound trunk and dispatch rule.

Inbound trunk configuration:

{
  "sipTrunkId": "ST_KeVUwXXXXX",
  "name": "Plivio_trunk_test",
  "numbers": ["+9180XXXXXX75"],
  "allowedAddresses": ["0.0.0.0/0"]
}

Dispatch rule configuration:

{
  "sipDispatchRuleId": "SDR_earm6BGmXXXX",
  "rule": {
    "dispatchRuleIndividual": {
      "roomPrefix": "call-"
    }
  },
  "trunkIds": ["ST_KeVUwCtXXXXXX"],
  "name": "Trunk Dispatch Rule",
  "attributes": {
    "agent": "69XXXXXXXXXXXXb"
  },
  "roomConfig": {}
}

  1. Current behavior:
    When we call the Plivo number, the phone rings but the call is never answered.

Expected behavior:
We expected the call to automatically route to LiveKit (via our SIP setup), reach our agent, and be handled without manual intervention.

Our primary requirement for using a self-hosted SIP server is region-specific handling.

Could someone help clarify:

  • Why the call is not being picked up?

  • Whether our architecture/setup is missing anything?

  • The correct approach to achieve automatic call handling with this setup?

Thanks in advance.
Rajan

Hi @Rajan_kumar , per that GitHub issue I shared above, this is not a supported configuration. The response from DZ here, Running local sip server with livekit cloud server · Issue #437 · livekit/sip · GitHub, can be considered authoritative.

You can either:

  • Use self-hosted LiveKit with your self-hosted SIP server
  • User LiveKit Cloud with LiveKit SIP

Our primary requirement for using a self-hosted SIP server is region-specific handling.

The SIP server within LiveKit cloud offers a regional endpoint: Region pinning for telephony | LiveKit Documentation (available on all plans).

There was a very good recent blog about deploying voice agents in India, see the ‘Telephony for voice agents’ section:

I also did a more generic blog about LiveKit region pinning as there are multiple pieces: