Skip to content

SIP Trunk connection unclear #422

@nguenauer

Description

@nguenauer

Hi everyone,

I’m hosting my own LiveKit server and LiveKit SIP server on the same machine. My goal is to connect my existing SIP trunk (with a custom provider) to LiveKit SIP so that I can receive incoming calls and route them to a voice bot written in Python, based on the livekit-agent examples.

Unfortunately, I’m stuck because the documentation is unclear to me — especially when it comes to:

  • Registering an external SIP trunk with credentials (username, password), a non-standard SIP port, and a custom SIP server URL.
  • Understanding how LiveKit SIP actually routes incoming calls to the Python agent.
  • Figuring out whether I need to configure anything specific on the LiveKit server or just the SIP component.
  • How the agent "knows" that an incoming SIP call is meant to trigger a new bot session.

My setup:

  • livekit-server and livekit-sip are self-hosted (same host)
  • SIP trunk has:
    • Username & password
    • Non-standard SIP port (e.g., 5070)
    • Custom SIP provider URL (not a typical IP PBX)
  • I’m using Python and experimenting with the livekit-agent examples
  • The goal is: I call the number → SIP trunk → LiveKit SIP → bot answers and speaks

My questions:

  1. Where exactly do I configure my SIP trunk settings (auth, port, host) in LiveKit SIP? Is this done via environment variables, config file, or something else?
  2. Do I need to pre-register my SIP trunk, or will LiveKit SIP accept calls from any authenticated SIP peer?
  3. How can I route an incoming SIP call to a Python agent session? Is there a signal or event the agent listens for?
  4. How do I debug SIP-level connection issues? Is there a log level I should enable to see if registration or calls are failing?
  5. Any complete working example or diagram you could share showing SIP trunk → LiveKit SIP → LiveKit Room → Agent?

Any guidance or clarification would be really appreciated. I’m happy to share logs or config if needed!

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions