To provision an inbound trunk with the SIP Service, use the CreateSIPInboundTrunk
API. It returns an SIPInboundTrunkInfo
object that describes the created SIP trunk. These parameters can also be queried at any time using the ListSIPInboundTrunk
API.
Minimal inbound trunk
The following creates an inbound trunk with minimal configuration. It will accept all inbound calls to number +15105550100
.
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"]}}
Note the leading +
assumes the Destination Number Format
is set to +E.164
for your Telnyx number.
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"]}}
Note the leading +
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.
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>"}}