Skip to main content

How SIP trunking works

SIP trunking lets you connect your existing telephony infrastructure directly to Cartesia Agents. Inbound calls — Traffic from your trunk is sent to Cartesia’s SIP endpoint. Inbound calls to your numbers are routed to the agent assigned to that number. Outbound calls — Cartesia places calls through your trunk’s SIP hostname, so outgoing calls use your carrier and caller ID. Authentication — Restrict who can send traffic with digest authentication (username and password) and/or by allowing only specific source IPs. Signaling and media — Call setup (signaling) uses TCP or TLS; use TLS when you want encrypted signaling. Once a call is up, RTP audio can be encrypted according to your media_encryption setting (disabled, allowed, or required).

Configure your PSTN provider

In your PSTN provider’s SIP trunk settings, point the trunk to Cartesia’s SIP endpoint. Choose the transport your carrier supports:
  • TCP: sip:sip.cartesia.ai;transport=tcp
  • TLS: sip:sip.cartesia.ai;transport=tls (encrypted signaling)
Once the trunk is configured on your carrier’s side, register it with Cartesia. Some fields are omitted below — see Create Provider for the full list.
The response returns the provider id and read-only trunk details. Passwords are never returned; Cartesia exposes the configured username as auth_username.

Import a number

Import a carrier number using the provider id from the previous step. See Import Phone Number for all fields.
Expected Response:

Assign to an agent

Assign the imported number to an agent so inbound calls are routed to it.
You can alternatively pass agent_id on import to assign an agent in the same request.
Expected Response:
To unassign, set agent_id to null.

Place outbound calls

Use the imported phone number to route outbound calls through. The carrier ultimately decides the caller ID. See Create Outbound Call for all fields.
Expected Response:
The response includes a call ID per destination. Use Get Call to monitor call status.