Skip to content

How does SIP trunking work?

A SIP trunk connects your phone system to a carrier over an IP network instead of physical telephone circuits. On every call, your PBX and the carrier exchange short SIP messages to set up and end the session, while spoken audio travels as a separate stream of IP packets. The carrier routes the call to whichever network serves the number you dialed.

The two ends of the trunk

A SIP trunk links your PBX on one end to a carrier's voice network on the other. Atlantech Online, for example, delivers SIP trunks1 to customers operating their own VoIP PBX, while offering a hosted PBX to teams that prefer not to manage one. With a trunk, your PBX handles extensions, voicemail, and internal call routing, and the carrier supplies public phone numbers and routes calls to outside networks.

Rather than a dedicated physical cable, the trunk is a logical configuration where each side stores the network address and authentication rules needed to trust messages from the other. No wire is reserved per call. Instead, a trunk's capacity is set in simultaneous calls, which we break down in how many simultaneous calls you need on a SIP trunk.

One outbound call, message by message

Suppose someone at extension 214 dials a supplier's mobile number. Your PBX checks its internal directory, finds no matching extension, and sends the carrier a SIP INVITE message following the call-setup pattern defined in RFC 32612.

The INVITE identifies the caller and the dialed number, and includes a session description in its message body, similar to an email attachment. That description lists the audio formats your PBX can use and the network address where it expects to receive audio.

The carrier replies with 100 Trying to confirm the request arrived and is being routed. During setup, before the call is answered, the carrier looks up which network serves the supplier's number and forwards the call request to that mobile network.

Once the supplier's phone begins ringing, a 180 Ringing message returns to your PBX so the caller at extension 214 hears ringback. When the supplier answers, a 200 OK arrives containing the other side's session description, which specifies the chosen audio format and destination address for audio. Your PBX confirms with an ACK, completing what RFC 3261 calls "a simple offer/answer model" so both sides know which audio format to send and where to send it.

A busy or declined call returns an error response instead of 200 OK, and some carriers require your PBX to authenticate itself before accepting the INVITE.

The messages in that call

MessageSent byWhat it means
INVITEPBXRequests the call and describes the audio the PBX can send and receive
100 TryingCarrierThe request arrived and is being routed
180 RingingCarrierThe far end is alerting the person called
200 OKCarrierThe call was answered, with the other side's audio description
ACKPBXConfirms the answer and completes setup
BYEWhichever side hangs upEnds the call, and the other side replies 200 OK

How the audio travels

SIP sets up, modifies, and ends the call session, while spoken audio travels separately over the Real-time Transport Protocol (RTP), defined in RFC 35503. Each side divides its audio into small packets and sends them to the IP address and port the other side specified during setup.

Because packet networks can lose, reorder, or unevenly delay packets, every RTP packet includes a sequence number and a timestamp so the receiver can put the audio back in order and play it at the right pace. Under RFC 3550, RTP "does not guarantee delivery or prevent out-of-order delivery," so it cannot compensate for a connection with heavy packet loss. Call quality depends on that connection as well as the equipment and configuration at each end, while a companion protocol, RTCP, reports how well the audio is arriving. We cover codec overhead and network sizing in how much bandwidth a VoIP call uses.

Audio packets do not have to follow the signaling path: in RFC 3261's reference call flow, "the end-to-end media packets take a different path from the SIP signaling messages." That separation explains why a call can ring, connect, and show as active while one person hears nothing. When SIP messages succeed without two-way audio, the fault often lies in unreachable media addresses, firewall rules blocking RTP packets, or endpoint settings, so you check signaling and audio separately.

When either person hangs up, that side sends a BYE and the other answers 200 OK. Both stop sending audio.

Inbound calls run the other way

When someone dials one of your numbers, their network delivers the call to your carrier because your carrier hosts that number. The carrier then sends the INVITE to your PBX. Your PBX rings an extension or plays the auto attendant, and the same alerting, answer, and audio steps follow.

To deliver inbound INVITE messages, the carrier must know your PBX's network address. Trunks use either a fixed address configured at setup or SIP registration, where your PBX sends REGISTER messages under RFC 3261 when it starts and at regular intervals afterward to report where it can be reached. Which method your trunk uses depends on your carrier's setup.

Where a session border controller fits

A session border controller (SBC) can operate between your PBX and the carrier's network to perform several functions documented in RFC 58534. Depending on how it is deployed, an SBC can repair non-standard SIP messages, keep signaling connections open to a PBX behind firewall address translation, and rewrite session descriptions so RTP audio passes through an operator-controlled relay.

An SBC is not part of every trunk on the customer's side. A carrier may run its own, and a PBX on a private circuit to the carrier may connect without one. Whether you run an on-site SBC depends on your PBX, firewall, and whether your carrier hosts the border device on its side.

How a trunk's call capacity is set

Neither SIP nor RTP reserves a physical circuit: under RFC 3550, RTP "does not address resource reservation," and SIP manages sessions without allocating fixed network capacity for them. Because of that design, a carrier's limit on simultaneous calls is a software setting rather than a count of physical lines.

Because capacity is software-controlled, carriers can raise or lower channel limits quickly. In a 2023 example from Atlantech Online, a local government customer adds capacity on its SIP trunks during snowstorms and tropical storms. Your carrier's limit is only one ceiling, though: your PBX, any SBC or gateway, and your data connection each enforce their own maximum, and concurrent calls must stay within all of those limits. We cover how to choose that number in how many simultaneous calls you need.

The trunk defines only the link between your PBX and your carrier. Beyond the carrier, the call may finish on a mobile network, a copper landline, or another IP phone system; we compare those networks in how VoIP differs from a landline. In the outbound call above, the request reached the supplier's mobile network before the supplier's phone began ringing.

Sources

  1. SIP Trunking: Efficient Voice CommunicationsAtlantech Online
  2. RFC 3261: SIP: Session Initiation ProtocolIETF
  3. RFC 3550: RTP: A Transport Protocol for Real-Time ApplicationsIETF
  4. RFC 5853: Requirements from Session Initiation Protocol (SIP) Session Border Control (SBC) DeploymentsInternet Engineering Task Force (IETF)
Ralph Lemos

Ralph Lemos

Fact Checker and Reviewer at AnswerStack.org

Ralph Lemos is AnswerStack's fact checker and reviewer. He checks claims against their sources and reviews the evidence behind each published answer.

Published by AnswerStack