To create and configure an outbound trunk, see Outbound trunk.
After you purchase a phone number and configure your SIP trunking provider, you must create an inbound trunk and dispatch rule to accept incoming calls. The inbound trunk allows you to limit incoming calls to those coming from your SIP trunking provider.
You can also configure additional properties for all incoming calls that match the trunk including SIP headers, participant metadata and attributes, and session properties. For a full list of available parameters, see CreateSIPInboundTrunk
.
To learn more about LiveKit SIP, see SIP overview. To learn more about SIP API endpoints and types, see SIP API.
Inbound trunk example
The following examples create an inbound trunk that accepts calls made to the number +1-510-555-0100
and enables Krisp noise cancellation. This phone number is the number purchased from your SIP trunking provider.
Create a file named inbound-trunk.json
with the following content:
{"trunk": {"name": "My trunk","numbers": ["+15105550100"],"krisp_enabled": true}}
The leading +
in the phone number assumes the Destination Number Format
is set to +E.164
for your Telnyx number.
Then create the inbound trunk using lk
:
lk sip inbound create inbound-trunk.json
Accepting calls from specific phone numbers
The configuration for inbound trunk accepts inbound calls to number +1-510-555-0100
from caller numbers +1-310-555-1100
and +1-714-555-0100
.
Remember to replace the numbers in the example with actual phone numbers when creating your trunks.
{"trunk": {"name": "My trunk","numbers": ["+15105550100"],"allowed_numbers": ["+13105550100", "+17145550100"]}}
The leading +
in the phone number assumes the Destination Number Format
is set to +E.164
for your Telnyx number.
Allowed caller numbers can also be filtered with a Dispatch Rule.
List inbound trunks
Use the ListSIPInboundTrunk
API to list all inbound trunks and trunk parameters.
lk sip inbound list