Skip to main content

What is a SIP Trunk?

A SIP trunk (Session Initiation Protocol trunk) is a virtual phone line that connects your phone system to the public telephone network (PSTN) over the internet. Instead of physical copper wires, voice calls are transmitted as data packets over your existing internet connection.
Traditional Phone LineSIP Trunk
Physical copper wiresVirtual connection over internet
Fixed capacity (23 channels per PRI)Scalable on demand
Local provider lock-inProvider-agnostic, works globally
High fixed monthly costsPay-per-use or wholesale rates
Just like email replaced physical mail for messages, SIP trunking replaces physical phone lines for calls. The calls sound the same to the person on the other end.

How Does SIP Trunking Work?

Two protocols work together: SIP handles the signaling (setting up and tearing down calls), and RTP carries the actual voice audio.

The Call Flow

1

Call Initiation

A SIP INVITE is sent to the provider’s gateway with the destination number and codec preferences (e.g., G.711 ulaw).
2

Authentication and Routing

The provider verifies the request via IP-based auth or username/password (digest auth), then routes the call to the PSTN.
3

Media Negotiation (SDP)

Both sides exchange SDP messages to agree on audio codecs, IP addresses, and ports for the voice stream.
4

Voice Streaming (RTP)

Voice audio flows as RTP packets between the endpoints, encoded using the agreed codec (typically G.711 ulaw at 64 kbps).
5

Call Termination

When either party hangs up, a SIP BYE message closes the session and stops the audio stream.

Key Terms

TermMeaning
OriginationReceiving inbound calls from the PSTN and delivering them to your system
TerminationSending outbound calls from your system to the PSTN via the trunk
DID NumberA phone number assigned to your trunk that external callers can dial
GatewayThe provider’s server address where SIP traffic is sent
CodecAudio encoding format (G.711 ulaw is the standard)

How Bolna Accommodates SIP Trunking

Bolna’s Bring Your Own Telephony (BYOT) feature lets you connect any standards-compliant SIP trunk. Bolna runs an Asterisk-based SIP media server with the PJSIP channel driver. When you register your trunk:
  1. Bolna creates a SIP endpoint with your gateway address, authentication details, and codec preferences
  2. Inbound calls arrive at Bolna’s server (sip:13.200.45.61:5060), get matched to a registered DID, and route to the assigned AI agent
  3. Outbound calls are sent through your trunk’s gateway using your credentials and caller ID
  4. The AI agent handles the conversation in real-time (speech-to-text, LLM response, text-to-speech)

Supported Authentication

MethodHow It WorksBest For
Username/Password (userpass)SIP digest auth with username and passwordZadarma, Vonage, DIDWW
IP-Based (ip-based)Bolna identified by source IP 13.200.45.61Plivo Zentrunk, Telnyx

Benefits of Using a SIP Trunk with Bolna

Keep your current SIP provider, contracts, and phone numbers. Connect your trunk to Bolna and your AI agents are ready instantly.
Pay your SIP provider directly for call minutes at your own negotiated rates. Bolna charges separately only for AI processing.
Your DID numbers stay with your current provider. No porting, no downtime. Just point them to Bolna’s SIP server.
Switch providers without changing anything on Bolna. Configure multiple trunks from different providers for failover.
Bring US toll-free, Indian DIDs, European local numbers, or any numbers from your provider’s inventory.
Your existing compliance setup (DLT registration, STIR/SHAKEN) stays with your provider. Bolna does not interfere.
Scale from 1 concurrent call to thousands without hardware changes. Bolna scales alongside your trunk capacity.
SRTP (Secure RTP) is not supported. Media must use standard (unencrypted) RTP. Trunks requiring mandatory SRTP will not work with Bolna.

Get Started

Follow these guides in order to set up SIP trunking with Bolna:

Set Up a Plivo Trunk

Create inbound and outbound SIP trunks on Plivo Zentrunk

Set Up a Twilio Trunk

Create an Elastic SIP Trunk on Twilio

Register Trunk on Bolna

Register your trunk and add phone numbers via API

Receive Inbound Calls

Route incoming calls to Bolna AI agents

Make Outbound Calls

Place outbound calls from your trunk numbers

SIP Trunk API Reference

Full API reference for managing trunks and numbers