Back to Insights
VoIP Engineering

VoIP Gateway Explained: FXO vs FXS, Analog, T1/E1 and SIP Gateways

Telephony Engineering Team
9 min read
VoIP Gateway Explained: FXO vs FXS, Analog, T1/E1 and SIP Gateways

A VoIP gateway is a device or software that converts calls between a traditional phone network and an IP network. It translates analog or digital phone signals into SIP and RTP, and back again, so legacy equipment such as analog phones, fax machines, and old PBXs can work with a modern VoIP system.

Gateways are less glamorous than cloud platforms, but almost every organization with older equipment, fax lines, alarm systems, or a PSTN backup plan still depends on one.

What a VoIP gateway does

A gateway sits between two worlds:

  • The traditional side: analog lines, PBX station ports, or digital trunks such as T1, E1, or PRI
  • The IP side: SIP signaling and RTP audio over a network

It performs three jobs:

  1. Signaling conversion. For example, it turns an analog phone going off-hook into a SIP INVITE.
  2. Media conversion. It digitizes analog audio, applies a codec, and sends it as RTP packets.
  3. Telephony functions. It generates dial tone and ring, detects digits, handles caller ID, and manages echo and fax.

FXS vs FXO: the simple explanation

These two port types cause more confusion than anything else in analog telephony. They describe the role each side plays.

  • FXS (Foreign eXchange Subscriber) is the port that provides the phone line. It supplies dial tone, power, and ring voltage to an analog device. You plug an analog phone or fax machine into an FXS port.
  • FXO (Foreign eXchange Office) is the port that receives a phone line. It behaves like a phone plugged into a wall jack. You plug a telephone company line, or a PBX extension port, into an FXO port.

A simple way to remember it: S for Subscriber side, which feeds the phone. O for Office side, which connects to the line.

ConnectionPort needed on the gateway
Analog phone or fax → gatewayFXS
PSTN line from the phone company → gatewayFXO
Old PBX extension port → gatewayFXO
Gateway → analog phoneFXS

Plugging devices into the wrong port type will not work, and a mismatch on live lines can even cause damage, so check labels before connecting.

Types of VoIP gateways

TypePortsTypical use
ATA (analog telephone adapter)1 to 2 FXSConnect a single analog phone or fax machine to VoIP
Analog FXS gateway4 to 48+ FXSConnect many analog phones, such as in hotels, hospitals, and warehouses
Analog FXO gateway2 to 24+ FXOConnect PSTN lines to a SIP PBX, or keep PSTN as a backup path
Digital T1/E1/PRI gatewayDigital trunk portsReplace a PRI with SIP, or bridge a legacy PBX to IP
SIP-to-SIP gateway / SBCNone (all IP)Secure and normalize SIP between networks. See what an SBC does
GSM / cellular gatewaySIM slotsUse a mobile network for backup or special routing
WebRTC-to-SIP gatewayNone (software)Connect browsers to SIP systems. See WebRTC to SIP gateway architecture

When do you need a gateway?

  • You still have analog phones, fax machines, elevator phones, intercoms, or alarm lines that must keep working.
  • You are migrating from a legacy PBX gradually and need the old and new systems to interconnect. See PBX to cloud migration with zero downtime.
  • You have a PRI or T1 and want to move to SIP trunks without replacing the PBX. See SIP trunk vs PRI.
  • You want a PSTN backup for use when the internet or the VoIP provider fails.
  • You need to connect equipment that cannot speak SIP, such as older paging systems.

If you only use IP phones and softphones with a cloud provider, you do not need a gateway.

Fax, modems, and special devices

Fax is the hardest thing to run over VoIP because fax tones are sensitive to delay, jitter, and packet loss.

  • T.38 fax relay converts fax signals into data packets and is the preferred method when both ends support it. See ITU-T T.38.
  • G.711 pass-through sends fax as ordinary audio using the G.711 codec. It works on clean networks but is more fragile.
  • Disable features that interfere with fax tones, such as voice activity detection, aggressive echo cancellation on fax calls, and compressed codecs.

Alarm panels, card machines, and modems are also sensitive. Test them thoroughly, and keep a dedicated analog line for critical ones where possible.

Important technical settings

  • Codecs. G.711 is the safest for fax and analog quality. See G.711 vs G.729.
  • DTMF method. Out-of-band DTMF using RTP events (RFC 4733) is reliable. In-band DTMF can be distorted by codecs.
  • Echo cancellation. Analog lines produce echo. Gateways include echo cancellers (see ITU-T G.168), and these must be enabled and tuned.
  • Country and tone settings. Set the correct dial tone, ring cadence, and impedance for your region, or phones may behave oddly.
  • Caller ID format. Different regions use different standards, so choose the right one.
  • Timers and hook-flash. Set flash timing and disconnect detection correctly so transfers and hang-ups work.

How to choose a gateway

QuestionWhy it matters
How many ports, and which types?Plan for growth, and keep spare ports
Does it support the codecs and fax mode you need?Fax reliability depends on T.38 support
Does it have good echo cancellation?Analog lines echo
Does it support SIP over TLS and SRTP?Security for signaling and media
Is it certified or documented for your PBX or provider?Fewer integration surprises
Does it offer failover from FXO to PSTN?Resilience for emergency and backup needs
Is firmware still updated?Security patches
Does it support provisioning and monitoring?Easier to manage many units
What is the warranty and support?Gateways run for years

Well-known vendors include Grandstream, Cisco, AudioCodes, Patton, Mediatrix, Yeastar, and Sangoma, among others. Features and models change, so compare current specifications for your needs.

A basic setup flow

  1. Plan the network. Give the gateway a static IP or a DHCP reservation, and place it on a voice VLAN if you use VLANs.
  2. Register FXS ports to your PBX or provider as SIP extensions, one per analog device.
  3. Configure FXO ports as trunks with dialing rules, such as a prefix for outside lines.
  4. Set region, tones, and caller ID to match your country.
  5. Set codec order and DTMF method to match your PBX.
  6. Test every port. Place inbound and outbound calls, test transfers, and check audio both ways.
  7. Test fax and special devices with real equipment.
  8. Test failure scenarios. Unplug the network, and test what happens on power loss.
  9. Document everything, including port mapping and credentials.

Security basics

Gateways are frequent targets because they are often forgotten after installation.

  • Change default passwords immediately.
  • Restrict SIP access to your PBX or provider's IP addresses, not the whole internet.
  • Disable unused services, and keep management interfaces off the public internet.
  • Keep firmware updated.
  • Monitor for abnormal calling. Unexpected international calls from an FXO gateway are a classic sign of toll fraud. See VoIP toll fraud prevention and VoIP security best practices.

Emergency calling and analog lines

Traditional analog lines continue to work during a power outage because the phone company powers them. A VoIP gateway does not, unless it and the network equipment have battery backup. Keep this in mind for emergency phones, elevators, and alarms, and plan for power backup or a PSTN fallback. Emergency calls over VoIP also require accurate location information. See E911 compliance for VoIP.

Troubleshooting common gateway problems

SymptomLikely causesWhat to check
No dial tone on an FXS portNot registered, wrong credentials, or network issueRegistration status, SIP logs
One-way audioNAT or firewall, wrong RTP settingsNAT settings, SIP ALG, RTP port ranges. See SIP ALG
EchoEcho canceller disabled or mistuned, impedance mismatchEcho canceller settings, impedance, analog line quality
DTMF not detectedIn-band DTMF distorted by codecSwitch to RFC 4733 DTMF
Fax failsCodec compression, jitter, no T.38Use T.38 or G.711 pass-through, disable VAD
Caller ID missingWrong caller ID standard, provider not sending itRegion setting, provider support
Phantom ring or false calls on FXOLine noise or ring detection settingsRing detect threshold, line quality
Calls drop after a short timeNAT timeout or session timersKeep-alives, session timer settings

Frequently asked questions

What is the difference between FXO and FXS?

FXS ports power and serve analog phones, while FXO ports connect to the phone company line or a PBX station port. FXS feeds a phone, FXO is the side that receives a line.

What is an ATA?

An analog telephone adapter is a small gateway with one or two FXS ports that lets an ordinary analog phone or fax machine work over VoIP.

Do I need a VoIP gateway to use VoIP?

Only if you must connect analog or legacy digital equipment. IP phones, softphones, and mobile apps connect directly.

Is a VoIP gateway the same as an SBC?

No. A gateway converts between different telephony technologies, such as analog to SIP. An SBC secures and manages SIP traffic between IP networks. Some devices combine both roles.

References


Bridging legacy phones, PRIs, or fax into a modern platform? Our custom VoIP development team designs gateway and migration architectures that keep old equipment working while you modernize.

Discussion

0

Join the conversation

Sign in with your preferred account to comment, reply, and keep the discussion useful for other engineers.

Takes a few seconds. No separate password required.

C

Controva LLC

Engineering Team

We build digital empires that scale. Specializing in high-performance web architecture, AI automation, and headless commerce.

Work with us

Share this article