SIP inbound trunk

How to create and configure an inbound trunk to accept incoming calls.

note

To create and configure an outbound trunk, see Outbound trunk.

You can create an inbound trunk with the SIP Service using the CreateSIPInboundTrunk API. It returns an SIPInboundTrunkInfo object that describes the created SIP trunk.

To learn more about SIP and trunks, see SIP overview. To learn more about SIP API endpoints and types, see SIP API.

Minimal inbound trunk

The following creates an inbound trunk with minimal configuration. It will accept all inbound calls to number +15105550100.

important

LiveKit recommends limiting or authenticating inbound calls to help prevent unauthorized usage. For examples, see Accepting calls from specific phone numbers and IPs and Enabling authentication for inbound calls.

Create a file at inbound-trunk.json with the following content:

{
"trunk": {
"name": "Demo inbound trunk",
"numbers": ["+15105550100"]
}
}
caution

Note the leading + assumes the Destination Number Format is set to +E.164 for your Telnyx number.

tip

Multiple inbound numbers can be specified for one trunk.

Then create the inbound trunk using lk:

lk sip inbound create inbound-trunk.json

Accepting calls from specific phone numbers and IPs

The configuration for inbound trunk will accept inbound calls to number +15105550100 from caller numbers +13105551100 and +17145550100 and IP range 1.1.1.0/24.

{
"trunk": {
"name": "Demo inbound trunk",
"numbers": ["+15105550100"],
"allowed_numbers": ["+13105550100", "+17145550100"],
"allowed_addresses": ["1.1.1.0/24"]
}
}
caution

Note the leading + assumes the Destination Number Format is set to +E.164 for your Telnyx number.

tip

Allowed caller numbers can also be filtered with a Dispatch Rule.

Enabling authentication for inbound calls

The following inbound trunk configuration requires user/password authentication from a SIP Trunk Provider:

{
"trunk": {
"name": "Demo inbound trunk",
"numbers": ["+15105550100"],
"auth_username": "<sip-inbound-user>",
"auth_password": "<sip-inbound-pass>"
}
}

List inbound trunks

Use the ListSIPInboundTrunk API to list all inbound trunks and trunk parameters.

lk sip inbound list