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 +1234567890
.
Create a file at inboundTrunk.json
with the following content:
{"trunk": {"name": "Demo inbound trunk","numbers": ["1234567890"]}}
Note that Telnyx numbers must omit the leading +
by default.
Multiple inbound numbers can be specified for one Trunk.
Then create the inbound trunk using lk
:
lk sip inbound create inboundTrunk.json
Accepting calls from specific phone numbers and IPs
The configuration for inbound trunk will accept inbound calls to number +1234567890
from caller numbers +11111111
and +22222222
and IP range 1.1.1.0/24
.
{"trunk": {"name": "Demo inbound trunk","numbers": ["1234567890"],"allowed_numbers": ["11111111", "22222222"],"allowed_addresses": ["1.1.1.0/24"]}}
Note that Telnyx numbers must omit the leading +
by default.
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": ["+1234567890"],"auth_username": "<sip-inbound-user>","auth_password": "<sip-inbound-pass>"}}