Start with 45 free minutes of callsTry for free

What Is SIP Trunking, and How Do You Connect an AI Voice Agent?

8 min readChecked against 9 sources

SIP Trunking

SIP trunking is the internet-routed call connection between a PBX or other SIP system and a phone carrier. To connect an AI voice agent, route the inbound DID or PBX destination to the agent's SIP URI, then configure authentication, encryption, codecs, outbound routing and transfers. [Twilio's US pricing](https://www.twilio.com/en-us/sip-trunking/pricing/us), current as of August 2026, listed local origination at $0.0034 per minute and termination from $0.0011 per minute.

Is SIP trunking the same as VoIP?

SIP trunking is the connection that routes calls over the internet and connects channels to a PBX, according to Twilio’s definition.

A trunk replaces or supplements traditional carrier lines. It can connect:

  • A phone carrier directly to an AI platform.
  • A PBX or Session Border Controller (SBC) to an AI platform.
  • A PBX or SBC to a carrier for inbound and outbound public calls.

The trunk carries signaling and audio. Your PBX, carrier and AI platform still decide where each call goes and what happens after it connects.

Which connection path should you use?

Use direct carrier routing when the AI agent owns the whole call. Use PBX routing when the PBX must retain extensions, queues, schedules or human transfer logic.

PathInbound routeOutbound routeBest for
Carrier directDID to agent URIAgent to carrierDedicated AI numbers
PBX or SBCPBX to agent URIAgent to PBXExisting phone systems
Forwarded pilotNumber to pilot DIDExisting carrierLimited rollout

Carrier direct

The carrier sends calls for a DID to the AI platform’s SIP URI:

Caller -> PSTN -> Carrier DID -> AI platform SIP URI -> Agent

For outbound calls, the reverse route is required:

Agent -> Carrier SIP trunk -> PSTN -> Callee

OpenAI, for example, tells teams to point the provider trunk at sip:[email protected];transport=tls. OpenAI then sends a live.transport.incoming event to the configured webhook, while the backend handles session configuration, call controls and business logic (OpenAI documentation).

PBX or SBC

The PBX routes selected extensions, queues or DIDs to the AI platform:

Caller -> Carrier -> PBX or SBC -> AI platform -> Agent

This path keeps existing PBX routing in front of the agent. A transfer can return to the PBX before it reaches a human extension or queue.

ElevenLabs documents direct connections from a PBX or SIP-enabled phone system to its agent platform. Telnyx describes its SIP connection as the virtual phone line between a compatible PBX or system and its voice infrastructure.

What do you need before configuration?

You need control of every system that will make a routing decision.

RequirementWhat to confirm
PBX, SBC or carrierSIP routing is available
Phone numberDID can reach the trunk
NetworkSIP and media paths are open
AuthenticationCredentials or source IPs
AudioShared codec is enabled
AI platformInbound SIP is accepted

Twilio requires an internet-connected SIP network element, such as an SBC, IP-PBX or SIP call server. A termination trunk also needs a destination SIP URI and either an IP access control list, a credentials list or both (Twilio documentation).

ElevenLabs accepts digest authentication or an ACL based on the signaling source IP. Its documented codec requirement is at least one of G.722, G.711 PCMU or G.711 PCMA, unless your system resamples the audio (ElevenLabs documentation).

How do you configure the trunk?

Configure routing first, then security, audio and call behavior.

  1. Create or import the trunk in the carrier, PBX or AI platform.
  2. Add the AI platform’s SIP URI as the inbound destination.
  3. Map each DID, extension or queue to the intended agent.
  4. Add the carrier or PBX destination used for agent-originated calls.
  5. Select digest credentials, source-IP ACLs or both.
  6. Enable TLS for signaling and SRTP for media where required.
  7. Enable a codec shared by every call leg.
  8. Route a pilot DID, extension or queue through the trunk.
  9. Test inbound calls, outbound calls, DTMF, caller ID and transfers.
  10. Add failure routing before production cutover.

Do not treat inbound and outbound as one route. An inbound call can work while agent-originated calls fail because the reverse destination, authentication or caller ID policy is missing.

Which security and network settings matter?

Use encrypted signaling and media when every endpoint supports them. OpenAI uses TLS for SIP signaling and requires SRTP for call audio (OpenAI documentation). ElevenLabs recommends TLS transport with required media encryption (ElevenLabs documentation).

Check these controls before cutover:

  • Validate the remote TLS certificate and hostname.
  • Restrict source IPs when using ACL authentication.
  • Store digest credentials outside PBX dial plans and application code.
  • Permit the negotiated RTP or SRTP address and port ranges.
  • Confirm that NAT does not rewrite unreachable media addresses.
  • Use an SBC when you need a public SIP edge between private PBX infrastructure and the internet.
  • Keep failover routes separate from the primary AI destination.

TLS protects SIP signaling. SRTP protects call media. Enabling one does not automatically enable the other.

How much capacity does the trunk need?

Size concurrent calls, call setup rate and bandwidth separately.

  • Concurrency is the number of active calls.
  • Calls per second (CPS) is the rate at which new calls start.
  • Bandwidth depends on simultaneous media sessions.

Twilio gives this planning formula: peak bandwidth = maximum simultaneous calls x 100 kbps (Twilio documentation). Apply it to the busiest expected interval, not the daily call total.

Twilio’s published account-profile concurrency limits are:

Account profileInboundOutboundSource
No approved PCP22Twilio
Individual PCP33Twilio
Business PCPUnlimitedUnlimitedTwilio

Twilio also publishes a default outgoing rate of one call per second (Twilio Help Center). Check account approval and CPS settings before a launch that will create a burst of calls.

What does SIP trunking cost?

Separate carrier connectivity from the AI platform and speech stack. A carrier’s SIP rate is not the all-in agent rate.

Twilio US carrier connectivity

PartPriceSourceChecked
Local inbound$0.0034/minTwilio2026-11-26
US outboundFrom $0.0011/minTwilio2026-11-26

Telnyx US carrier connectivity

PartPriceSourceChecked
Platform fee$0Telnyx2026-11-26
Local inboundFrom $0.0032/minTelnyx2026-11-26
Local outboundFrom $0.005/minTelnyx2026-11-26
First 10 channels$12/monthTelnyx2026-11-26

Speko with your own SIP trunk

Speko is a voice agent platform for business phone calls: teams build, test, run and monitor AI phone agents for scripted calls such as interviews, candidate screens and intake.

See Speko Agents for its inbound, outbound and transfer workflow.

Speko’s quoted rate is “$0.09 per minute on Speko infrastructure across speech-to-text, LLM and text-to-speech.” Calls over your own SIP trunk add nothing to the Speko charge (Speko pricing).

PartPriceSourceChecked
Speech-to-textIncluded in $0.09/minSpeko2026-11-26
LLMIncluded in $0.09/minSpeko2026-11-26
Text-to-speechIncluded in $0.09/minSpeko2026-11-26
Own SIP trunkNo added Speko chargeSpeko2026-11-26

Do you have to port the phone number?

No. Routing and porting solve different problems.

Keep the existing number when the current carrier or PBX can route it to the AI platform’s SIP URI. Use call forwarding for a limited pilot when direct SIP routing is not ready. Port the number only when the final carrier design requires the number to move.

This makes rollback easier. The original PBX or carrier can keep control of schedules, overflow and failure routes while the pilot runs.

What should you test before cutover?

Test the complete call path, not just whether the agent answers.

TestPass conditionFailure to inspect
Inbound callCorrect agent answersDID mapping
Outbound callCallee receives callReverse route
Two-way audioBoth sides hear audioRTP, NAT, codec
DTMFDigits arrive correctlyPayload settings
Caller IDExpected number appearsCarrier policy
TransferHuman receives contextPBX route
FailoverBackup route answersTimeout rules
TLSCertificate validatesHostname, trust chain

Run the pilot through the same SBC, firewall and carrier account planned for production. A softphone test from another network does not exercise the same path.

How do you troubleshoot common SIP failures?

Start with the SIP response and call-leg boundary where the failure first appears.

SymptomLikely areaFirst check
Authentication failureDigest or ACLUsername, realm, source IP
TLS failureCertificateHostname and trust chain
No audioRTP pathFirewall and advertised IP
One-way audioNAT or ACLMedia addresses
Garbled audioCodecShared codec order
Wrong agentDID mappingCalled number format
Transfer failsPBX routeTransfer destination
No failoverRouting policyTimeout and backup URI

Capture SIP signaling on both sides of the failing boundary. Compare the called number, caller ID, codec offer, response code and media address. Redact credentials before sharing traces.

FAQ

Can my PBX send only selected calls to the AI agent?

Yes. Route selected DIDs, extensions, queues or schedules to the agent’s SIP URI while leaving other calls on the existing PBX path.

Do I need to port my current phone number?

Usually not. Keep the number with its current carrier when that carrier or your PBX can route calls to the AI platform.

Why does the call connect with no audio?

Inspect RTP or SRTP routing, NAT rewriting, firewall rules and the advertised media address. If only one side can hear, compare the media path in each direction.

What should I budget beyond the SIP trunk rate?

Add the AI platform, speech-to-text, LLM and text-to-speech charges. Also review number, channel, recording and carrier-specific charges for the route you will use.

Sources