Inbound Trunks

Inbound Trunks

An inbound SIP trunk represents a phone number (or set of numbers) that LiveKit can receive calls on.

SIPHON can either:

  • Look up / create a trunk from a phone number (sip_number) (recommended)
  • Or use an existing trunk (sip_trunk_id)

Provider-specific SIP examples (Twilio, Telnyx, Plivo, Wavix): Provider-specific quickstarts

Recommended: provide a phone number

from siphon.telephony.inbound import Dispatch

dispatch = Dispatch(
    dispatch_name="customer-support",
    agent_name="CustomerSupport",
    sip_number="+15550100",
)

SIPHON will:

  • Reuse an existing inbound trunk already configured for that number, or
  • Create a new inbound trunk.

Use an existing inbound trunk ID

from siphon.telephony.inbound import Dispatch

dispatch = Dispatch(
    dispatch_name="customer-support",
    agent_name="CustomerSupport",
    sip_trunk_id="ST_xxx",
)

If you don’t provide sip_number, SIPHON will attempt to infer it from the trunk.

Create an inbound trunk manually

If you want to create a trunk yourself (and then reference it by sip_trunk_id), you can use the trunk helper directly.

import asyncio
from siphon.telephony.inbound import Trunk

async def main():
    trunk = Trunk()
    result = await trunk.create_trunk(
        name="customer-support",
        sip_number="+15550100",
    )
    print(result)  # {"trunk_id": "ST_..."}

if __name__ == "__main__":
    asyncio.run(main())

Then pass the returned trunk_id into Dispatch(..., sip_trunk_id=...).

Notes

  • The underlying helper is siphon.telephony.inbound.Trunk.
  • You still need a dispatch rule to connect the trunk/number to an agent.

Next