Skip to main content
A Trunk is your carrier connection - the SIP capacity phone numbers ride on. Numbers come from trunks: after you register one, client.numbers.sync() discovers its numbers so you can attach them to a Speech Pipe. You bring your own carrier (Twilio, Tata, …) and register it once with its SIP credentials. After that you work with numbers, not SIP.

Register a trunk

from unpod import AsyncClient
from unpod.models import TrunkCreate, ByoConfigCreate

client = AsyncClient()

trunk = await client.trunks.create(TrunkCreate(
    name="tata-byo",
    type="byo",
    byo_config=ByoConfigCreate(
        provider="tata",
        sip_domain="sip.tata.in",
        auth_username="user",
        auth_password="secret",
        transport="tls",   # default
    ),
))

List and delete

trunks = await client.trunks.list()
await client.trunks.delete(trunk.trunk_id)

Then sync your numbers

result = await client.numbers.sync()   # {"synced": int, "new": int}
See Numbers for attaching them, or follow Make Your First Phone Call for the full provisioning walk-through.