Network rack in a phone closet with a gray voice gateway, blue patch cables and an older desk phone

SIP Gateway Explained: Connect a Legacy PBX to a SIP Trunk

A SIP gateway is a device or software that translates between SIP (Session Initiation Protocol), the IETF standard for setting up internet phone calls, and older phone connections such as analog lines and PRI circuits, an older digital phone line service. It lets a PBX (private branch exchange, the phone system that routes calls to your extensions) that cannot speak SIP make and take calls over a SIP trunk, so you can keep a compatible phone system and its desk phones.

The gateway is the translator. The SIP trunk is phone line service delivered over the internet, carrying calls between your phone system and the public phone network. An older PBX needs both pieces to leave copper lines behind.

Two things go by this name. Pick yours:

Connect an older PBX to a SIP trunk

You have: a PBX with analog line jacks or a PRI card.
You need: a SIP gateway box or software.

Find your gateway

Use SIP desk phones with Microsoft Teams

You have: compatible SIP desk phones and Teams.
You need: Microsoft’s Teams SIP Gateway service.

See the Teams steps

Jump to: Which gateway · How it works · Sizing · Setup steps · Cutover checklist · Teams SIP Gateway

Key takeaways

  • You need a gateway only if your PBX has no SIP option. Check for a SIP trunk setting or a firmware upgrade first.
  • Match the gateway to what your PBX plugs into today: analog line ports or a PRI card.
  • A PBX’s analog line ports plug into the gateway’s FXS ports, which supply dial tone like the phone company. FXO ports plug into a phone line like a phone, so plugging the PBX into them gives no dial tone.
  • Buy SIP channels for your busiest moment, not your number of phones. Each channel handles one call at a time.
  • Test 911, fax, alarm lines and every inbound number before you cancel the old lines.

What is a SIP gateway and what does it do?

A SIP gateway does two jobs at once. It converts call signaling, such as picking up the handset, the digits dialed and hanging up, into SIP messages, the call setup standard defined in IETF RFC 3261. It also turns the voice into RTP packets (Real-time Transport Protocol, the protocol that carries the audio), defined in IETF RFC 3550, and turns incoming packets back into sound your PBX understands.

Your PBX does not know anything changed. It sees the gateway as the same phone lines or digital circuit it always had. That is why a gateway can work with a system its maker no longer updates, as long as its line ports or PRI card still work.

You will also see the terms “VoIP gateway” and “SIP media gateway”. For an office PBX they usually mean the same kind of box. “Media gateway” stresses the audio conversion and is also used for large carrier equipment, and “VoIP gateway” is the broader name, since SIP is the technology that sets up the VoIP call.

Why are businesses adding gateways now?

Copper phone lines are going away. Retail switched access lines, the traditional copper service, fell at a compound annual rate of 17.9% from 2022 to 2025, according to the FCC’s Voice Telephone Services report.

In March 2026 the FCC also gave carriers blanket authority to grandfather legacy voice service over copper, which means current customers keep it but new customers cannot order it (FCC 26-19). A gateway lets a PBX that still works move to SIP on your schedule instead of the carrier’s.

Which SIP gateway does your PBX need?

Start with what your PBX plugs into today, not with the gateway catalog. Look at the back of the system or its trunk card list. You will usually find one of four answers, and each one points to a different setup.

Decision diagram: a PBX with analog line ports needs a gateway with FXS ports, a PRI or T1 card needs a PRI gateway set to the network side, a PBX with a SIP trunk setting needs no gateway, and fax, door phones or paging use a small FXS adapter

Match the gateway to your PBX’s trunk side

Analog line jacks

What you have: the ports that once took the phone company’s lines

What you need: an analog gateway with one FXS port per PBX line jack

What to verify: caller ID and the disconnect signal on each port

A PRI or T1 card

What you have: a digital circuit card in the PBX, usually for a PRI (Primary Rate Interface) phone service. Some T1 cards use older signaling, so check which yours uses.

What you need: a digital gateway with a matching PRI port, set as the network side

What to verify: line type, framing and the dialed digits the PBX expects

A SIP trunk setting

What you have: a SIP option in the PBX admin screen

What you need: no gateway; connect the PBX straight to the trunk

What to verify: the firmware version and a provider setup guide

Single analog devices

What you have: a fax, door phone or paging system

What you need: a small FXS adapter (ATA, analog telephone adapter) per device or group

What to verify: T.38 fax support and power backup

FXS or FXO: why the names feel backwards

An FXS port acts like the phone company. It supplies dial tone, ring voltage and power. An FXO port acts like a phone and plugs into a phone line, as the definitions in this manufacturer datasheet show. Your PBX’s line ports were built to plug into the phone company, so they are FXO ports. To replace the phone company, the gateway must face them with FXS ports.

Wiring diagram: each legacy PBX line jack, which acts like a phone (FXO), connects by phone cord to one SIP gateway FXS port, which acts like the phone company; the gateway's LAN port connects by Ethernet to the router and then the SIP trunk

An FXO gateway does the opposite job. It plugs into copper lines you are keeping and puts them on your IP network. That is useful during a staged move, but it does not help a PBX leave copper.

PRI gateways for larger systems

A PRI (Primary Rate Interface) is an older digital phone line service that carries many calls over one T1 circuit. If your PBX has a PRI card, a digital gateway replaces the carrier’s circuit.

The gateway’s PRI port is usually set as the network side, because your PBX expects to be the user side, as it was with the carrier. A PRI can also pass the number the caller dialed, so each direct number still rings the right person. Our PRI vs SIP guide covers when to keep the PRI card and when to move it off.

When you do not need a gateway

Many newer PBXs can register to a SIP trunk on their own, sometimes after a firmware update or a license. If yours can, skip the extra box and the extra point of failure. See how SIP trunking works with a PBX for that path.

Analog devices outside the PBX are a separate job. A small FXS gateway brings these devices onto the IP network without replacing them, and our guide to what an ATA is walks through fax machines, door phones and paging.

How does a SIP gateway carry a call from your PBX to the trunk?

The gateway handles two separate streams for every call: signaling, which sets the call up, and audio. The path below works the same way for a four-line office and a hotel with a PRI; only the gateway’s PBX side changes.

Call path diagram: the legacy PBX sends analog lines or PRI to the SIP gateway, which sends SIP call setup and RTP voice through the router and firewall to the internet line, the SIP trunk provider and the public phone network
  1. The PBX seizes a line. A user dials out, and the PBX picks an idle line port or PRI channel, exactly as before.
  2. The gateway sends a SIP INVITE. It collects the digits and asks the SIP trunk provider to set up the call.
  3. Voice becomes packets. The gateway encodes the audio, for example with G.711, and sends it as RTP every 20 ms, the default interval in RFC 3551.
  4. The provider reaches the phone network. The SIP trunk hands the call to the public phone network or to another SIP endpoint.
  5. Inbound calls run in reverse. The trunk sends an INVITE to the gateway. On analog, the gateway rings the PBX port mapped to that number; on a PRI, it passes the dialed digits so the PBX routes the call.

Tones you press during a call, such as menu choices, are called DTMF tones (dual-tone multi-frequency). They usually travel as RTP telephone events defined in RFC 4733. If a bank’s phone menu ignores your keypresses after the move, check that the gateway and trunk use the same DTMF method, since some systems send tones another way.

SIP gateway vs PBX vs SIP trunk: what does each one do?

The three parts are easy to mix up because they work as a chain. Each one does one job, and an older system needs all three.

Three parts, three jobs
Part Its job Where it lives
PBXRoutes calls to extensions, voicemail, menus and queuesYour phone closet or a server
SIP gatewayTranslates the PBX’s analog or PRI signals to SIP and backNext to the PBX, on your network
SIP trunkCarries calls between your site and the public phone networkYour provider, over your internet line

How many gateway ports and SIP channels do you need?

Size the gateway by your PBX’s line ports, and size the SIP trunk by your busiest moment. A SIP channel handles one call at a time, so count the most calls that run together, not the number of phones. Our guide to concurrent call limits shows how to read that peak from your call records.

Illustrative example: a dental office with an older PBX

  • The PBX has 8 analog line ports wired to 8 copper lines.
  • Call records show at most 6 calls at once, during the morning rush.
  • Gateway: 8 FXS ports, one per PBX line port, so nothing in the PBX changes.
  • SIP trunk: 6 channels, with room to add more when the peak grows.
  • Internet: 6 x 80 kbps = 480 kbps each way with G.711, before Ethernet overhead.

No call records yet? Estimate the peak from traffic. Busy hour traffic in Erlangs is the calls offered in your busiest hour, including any that got a busy signal, times the average call length in minutes, divided by 60. The Erlang B method behind ITU-T E.520 turns that into channels. Example: 60 calls averaging 4 minutes is 4 Erlangs, and Erlang B estimates that 10 channels keep busy signals under 1% of calls. Treat it as a planning estimate, not a guarantee.

Have your channel count? Test it on a free trial trunk before you change any wiring.

Bandwidth per call depends on the codec, the method that turns voice into digital audio. Each 20 ms packet carries the audio plus 40 bytes of RTP, UDP and IP headers. With G.711, a 64 kbps codec from ITU-T G.711, that is 200 bytes 50 times a second, or 80 kbps each way. With G.729, an 8 kbps codec from ITU-T G.729, it is 24 kbps each way.

Upload and download needed, each way, by calls at once
Calls at once G.711 (64 kbps codec) G.729 (8 kbps codec)
4 320 kbps
96 kbps
8 640 kbps
192 kbps
16 1,280 kbps
384 kbps

Worked from RFC 3551 payload sizes and 20 ms packets, at the IP level. Leave headroom for other traffic and use router QoS so voice goes first.

How do you connect a legacy PBX to a SIP trunk through a gateway?

Test after every step. The order below keeps the old lines working until the new path is proven.

1

List every line and number

Write down each PBX line port or PRI, which number rings where, the main number, fax and alarm lines, and the caller ID you send.

2

Open the network for voice

Allow the SIP and RTP traffic your provider documents. SIP commonly uses port 5060, or 5061 for SIP over TLS (RFC 3261), and RTP uses the port range set on the gateway. If your provider recommends it, turn off SIP ALG on the router, a feature that rewrites SIP and can break audio (see why to disable SIP ALG), and give voice traffic priority with router QoS (quality of service).

3

Register the gateway to the SIP trunk

Enter the trunk’s server address and your credentials, or the provider’s IP authentication. Pick the codec, G.711 first if your bandwidth allows since it is not compressed, and the DTMF method the trunk expects.

4

Map numbers to ports

Plain analog lines do not pass the number the caller dialed, so send each inbound number to a chosen port or port group. On a PRI, pass the dialed digits and let the PBX route as before.

5

Pilot one line, with a way back

Analog: move one PBX line jack from copper to a gateway FXS port. PRI: move the PRI cable to the gateway in a quiet window while the carrier circuit stays live. Label the old cables so you can plug back in within minutes, run the cutover checklist, then move the rest.

6

Port your numbers, retest, then cancel

Schedule the number port for a quiet time. When it completes and the full checklist passes, call every ported number again. Then cancel only the lines you no longer need, after checking whether alarm, fax or bundled internet service shares the account.

For the full trunk side, including codecs and channels, see our SIP trunking for legacy PBX and key systems page.

What should you test before you cancel the old lines?

Problems after a move tend to show up in the calls people make least often. Test each of these with live calls, except 911, and keep the copper lines until all of them pass.

Cutover checklist

  • 911: users can dial 911 with no prefix such as 9, a front desk or central spot is notified, and the call carries a dispatchable location, as 47 CFR 9.16 requires for the multi-line phone systems it covers. Verify it with your SIP trunk provider’s documented test process, and arrange any live 911 test call with your local emergency call center in advance.
  • Every inbound number rings the right port, group or extension.
  • Outbound caller ID shows your main number on local and long-distance calls.
  • Keypresses work in an outside phone menu, such as a bank’s.
  • Fax: a multi-page fax goes both ways using T.38, the fax over IP standard in ITU-T T.38, if your trunk and gateway support it.
  • Alarm and elevator lines: their vendor confirms the new path, or they stay on a line the vendor supports.
  • Transfers, hold and voicemail work on a call that came in over the trunk.
  • Power: the gateway, switch and router are on a battery backup, and you know what still works if the internet line drops.

How do you keep a SIP gateway secure?

A gateway connects your phone system to the internet, so treat it like a firewall, not a phone. Toll fraud is when someone breaks in and runs up calls on your account. Weak passwords and open admin pages are easy ways in, so close both.

  • Use long, unique SIP passwords, or IP authentication so only your public IP can use the trunk.
  • Keep the gateway’s web admin page off the internet. Manage it from inside your network or over a VPN, an encrypted connection into your office network.
  • Turn on SIP over TLS (port 5061) and SRTP, which encrypts the voice packets as defined in RFC 3711, where the gateway and trunk support them.
  • Block international calling on the trunk if you never call abroad.
  • Update the gateway’s firmware, and change the default admin login on day one.

Is Microsoft’s Teams SIP Gateway the same thing?

No. Microsoft’s Teams SIP Gateway is a cloud service that lets compatible SIP desk phones sign in to Teams with corporate credentials and make and receive Teams calls, per Microsoft Learn. It connects phones to Teams. It does not connect a PBX to a SIP trunk.

Teams SIP Gateway: a one-phone pilot

  1. Check the phone’s model and firmware against Microsoft’s compatible device list in Plan for SIP Gateway, and confirm the user has a phone number with outside calling enabled.
  2. In the Teams admin center, check that a SIP devices tab shows under Teams devices, which means the service is on for your organization. Then turn on “SIP devices can be used for calls” in the user’s calling policy.
  3. Reset the phone to factory settings and point it at the provisioning address for your region, which Microsoft lists in Configure SIP Gateway.
  4. Sign in on that one phone, test calls in and out, then roll out the rest.

Once signed in, a SIP desk phone can make and take outside calls, hold, transfer, conference two calls, check voicemail and dial into Teams meetings, per Microsoft’s plan page. It can only call users who have phone numbers.

If a PBX stays in service alongside Teams and its outside calls move to SIP, it still needs its own SIP gateway or SIP trunk setting.

SIP gateway questions people ask next

▸What is the difference between a SIP gateway and a SIP trunk?

A SIP trunk is the phone line service delivered over the internet. A SIP gateway is the box or software that lets an older PBX use it by translating analog or PRI signals into SIP. A PBX that already speaks SIP needs only the trunk.

▸Does a SIP gateway hurt call quality?

It should not, but several things can. Network problems such as low upload bandwidth, jitter and packet loss, a router with SIP ALG turned on, codec changes between gateway and trunk, and echo settings on the gateway can all hurt audio. Check the router’s SIP ALG and QoS first, use G.711 where you have the room, and keep the gateway’s firmware current.

▸Can I move some lines and keep others on copper?

Yes. You can move the main lines first and keep a fax or alarm line on copper until it is tested. Review the PBX’s trunk groups, hunt order and outbound routes so calls use the ports you expect during the move.

▸Is there a software SIP gateway?

Yes. A software gateway runs on a server. With a telephony interface card in that server it can connect analog lines or a PRI; without one it only links SIP or IP systems. For a single older PBX, a hardware gateway is often the simpler box to install and support.

▸What is SIP telephony?

SIP telephony is making phone calls with SIP, the IETF standard in RFC 3261 that sets up, changes and ends calls over an IP network. SIP handles the ringing, answering and hanging up, and RTP carries the voice. SIP stands for Session Initiation Protocol. VoIP is the broad name for calls over the internet, and SIP is a technology that makes those calls possible.

▸What is a SIP address?

A SIP address, or SIP URI, names a user or phone the way an email address does, for example sip:frontdesk@example.com. RFC 3261 defines the format. Your SIP trunk provider sets the addresses your gateway uses, so you rarely type one by hand.

▸Where do I find my SIP server address and login?

A SIP server is the provider’s system that accepts your gateway’s registration and sets up each call. Your SIP trunk provider gives you its address and your login, usually in its online control panel or setup email. You need the server address (often called the proxy or registrar), your username and password or the IP address the provider will accept, and the codec and DTMF settings it expects. Enter them in the gateway’s SIP trunk or account screen.

▸Is SIP over TCP or UDP?

Both. RFC 3261 allows SIP over UDP or TCP on port 5060, and over TLS on port 5061. TLS is the better choice when your trunk supports it, because it encrypts the call setup.

Keep the PBX you trust and move it to SIP

A working PBX does not have to retire with the copper lines. Check whether it can speak SIP on its own, match a gateway to its line ports or PRI card, size channels to your busiest hour, and run the checklist before you cancel anything.

SIP.US works with any SIP-based PBX, or a legacy PBX with a SIP gateway, on prepaid service with no contract, so start your free trial and test your gateway on a live trunk before you move a single line.

Start your free trial

Related Posts

SIP Trunks for Small Business: The Complete Buyer’s Guide

November 20, 2026

Small businesses get the most from SIP trunking when they buy capacity by concurrent calls,…

SIP Trunking with PBX Systems: How It Works, Compatibility & Migration

November 20, 2026

Most PBX systems can connect to a SIP trunk, and the right integration path depends…

PRI vs SIP Trunking: Differences, Costs & Migration Considerations

October 28, 2026

PRI vs SIP comes down to fixed circuit capacity versus flexible internet-based channels, and for…