{"industry":{"id":"ff619d7c-d7d7-485e-a05a-53fba07f33ed","slug":"telecommunications","label":"Telecommunications","description":"Business voice, fiber, UCaaS, and network services"},"topic":{"slug":"pstn","label":"PSTN","description":"The public switched telephone network: how it works, POTS retirement, and the move to VoIP.","schemaKind":null},"answer":{"id":"28c898f5-b2d9-4a9d-88be-bd46bb9848e9","slug":"what-is-a-pstn-gateway-and-what-do-fxs-and-fxo-ports-do","question":"What is a PSTN gateway, and what do FXS and FXO ports do?","answerMarkdown":"A PSTN gateway is a device that converts telephone calls between the circuit-switched public telephone network and a packet-based IP network, so analog phones, fax machines, or a legacy PBX can work with a VoIP system.[1][2] On the analog side it uses two kinds of ports. An FXS port, short for Foreign Exchange Subscriber, supplies dial tone, battery current, and ring voltage to an end device such as a phone or fax machine, while an FXO port, short for Foreign Exchange Office, is the line-side interface that receives dial tone from the PSTN or a PBX and signals on-hook and off-hook by opening and closing the electrical loop.[4][11] The two always work as a pair, because a line coming from an FXO port has to terminate on an FXS port for a call to complete.[4] The gateway handles the media conversion, encoding voice with a codec such as G.711 or G.729 into RTP packets, and it speaks a VoIP control protocol such as SIP, MGCP, or H.248 to the phone system that runs the call.[1][3][8]","answerText":"A PSTN gateway is a device that converts telephone calls between the circuit-switched public telephone network and a packet-based IP network, so analog phones, fax machines, or a legacy PBX can work with a VoIP system.[1][2] On the analog side it uses two kinds of ports. An FXS port, short for Foreign Exchange Subscriber, supplies dial tone, battery current, and ring voltage to an end device such as a phone or fax machine, while an FXO port, short for Foreign Exchange Office, is the line-side interface that receives dial tone from the PSTN or a PBX and signals on-hook and off-hook by opening and closing the electrical loop.[4][11] The two always work as a pair, because a line coming from an FXO port has to terminate on an FXS port for a call to complete.[4] The gateway handles the media conversion, encoding voice with a codec such as G.711 or G.729 into RTP packets, and it speaks a VoIP control protocol such as SIP, MGCP, or H.248 to the phone system that runs the call.[1][3][8]","answerHtml":"<p>A PSTN gateway is a device that converts telephone calls between the circuit-switched public telephone network and a packet-based IP network, so analog phones, fax machines, or a legacy PBX can work with a VoIP system.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a> On the analog side it uses two kinds of ports. An FXS port, short for Foreign Exchange Subscriber, supplies dial tone, battery current, and ring voltage to an end device such as a phone or fax machine, while an FXO port, short for Foreign Exchange Office, is the line-side interface that receives dial tone from the PSTN or a PBX and signals on-hook and off-hook by opening and closing the electrical loop.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a><a href=\"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications\" class=\"citation-ref\" data-citation-index=\"11\" target=\"_blank\" rel=\"noreferrer\">[11]</a> The two always work as a pair, because a line coming from an FXO port has to terminate on an FXS port for a call to complete.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> The gateway handles the media conversion, encoding voice with a codec such as G.711 or G.729 into RTP packets, and it speaks a VoIP control protocol such as SIP, MGCP, or H.248 to the phone system that runs the call.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a><a href=\"https://datatracker.ietf.org/doc/html/rfc3261\" class=\"citation-ref\" data-citation-index=\"8\" target=\"_blank\" rel=\"noreferrer\">[8]</a></p>\n","summary":"A PSTN gateway bridges the traditional phone network and a VoIP system by converting analog or TDM voice into IP packets and back. Its analog ports come in two types: an FXS port powers and rings an end device like a phone or fax, and an FXO port connects to a live phone line from the PSTN or a PBX. FXS and FXO always pair, one feeding the line the other receives.","publishedAt":"2026-07-20T16:01:22.747","verifiedAt":"2026-07-18T00:00:00","editorialStatus":"APPROVED","lastReviewedAt":"2026-07-18T00:00:00","nextReviewDueAt":"2026-10-18T00:00:00","templateVersion":"v2","aliases":["What is a PSTN gateway?","What is a VoIP gateway?","What is the difference between FXS and FXO ports?","What does an FXS port do?","What does an FXO port do?","FXS vs FXO","What is an FXS gateway?","What is an FXO gateway?","What is an analog telephone adapter?","Foreign Exchange Subscriber vs Foreign Exchange Office","How do analog voice gateways work?","PSTN gateway explained"],"confidenceScore":93,"confidenceLabel":"High","canonicalUrl":null},"contributor":{"id":"ec39deab-44fe-48d8-9029-fefe993ab85a","slug":"answer-stack","displayName":"AnswerStack","websiteUrl":null},"contributorOrganizationProfile":{"entityId":"ec39deab-44fe-48d8-9029-fefe993ab85a","legalName":null,"description":null,"websiteUrl":null,"imageUrl":null,"slogan":null,"subtitle":null,"facts":[],"coiNote":null,"foundingDate":null,"numberOfEmployeesText":null,"contactPoint":null,"address":null,"headquartersText":null,"organizationType":null},"contributorPerson":{"slug":"answerstack-editorial-team","displayName":"AnswerStack Editorial Team"},"sections":[{"id":"90908a51-bd84-406b-9e30-7176703eae91","sectionKey":"what_is_pstn_gateway","sectionType":"markdown_section","heading":"What is a PSTN gateway?","introMarkdown":"A PSTN gateway is hardware or software that sits between the public switched telephone network and a packet network and converts calls from one to the other.[1] The formal name for that function is a media gateway, which the IETF defines as a network element that provides conversion between the audio signals carried on telephone circuits and data packets carried over the Internet or over other packet networks.[1] In practice you will also see the same box called a VoIP gateway, a voice gateway, an FXS or FXO gateway, or, in its smallest form, an analog telephone adapter.[2][3] Whatever the label, the task is the same: take a call that arrives as a continuous electrical signal on a phone line and turn it into a stream of IP packets, then do the reverse for calls going the other way.[2]\n\nThat conversion has two halves. The gateway digitizes and encodes the voice itself, sampling the audio and packing it into Real-time Transport Protocol packets with a codec such as G.711 or G.729.[2][3] It also translates the signaling, meaning the on-hook, off-hook, dialing, and ringing information that tells the network when a call starts, what number to reach, and when to hang up.[1] On the telephone side that signaling might be analog loop current or a digital protocol carried on a T1 or E1 circuit, and on the IP side it becomes a VoIP control protocol such as SIP, MGCP, or H.248.[1][8][9] Because those two worlds encode a call so differently, the gateway is what lets an analog handset, a fax machine, or an older PBX keep working while the calls behind them travel over the internet.[2]\n\n### Why a gateway is useful during the move to IP\n\nMany organizations still run analog devices or a TDM PBX that would be costly to replace all at once, and a gateway lets that equipment connect to a SIP trunk or a hosted phone system while the rest of the network moves to IP.[5][7] A small residential-scale gateway gives a single analog line an IP path, while a trunking gateway manages a large number of digital circuits for a carrier or a large site.[1]","introHtml":"<p>A PSTN gateway is hardware or software that sits between the public switched telephone network and a packet network and converts calls from one to the other.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a> The formal name for that function is a media gateway, which the IETF defines as a network element that provides conversion between the audio signals carried on telephone circuits and data packets carried over the Internet or over other packet networks.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a> In practice you will also see the same box called a VoIP gateway, a voice gateway, an FXS or FXO gateway, or, in its smallest form, an analog telephone adapter.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a><a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a> Whatever the label, the task is the same: take a call that arrives as a continuous electrical signal on a phone line and turn it into a stream of IP packets, then do the reverse for calls going the other way.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a></p>\n<p>That conversion has two halves. The gateway digitizes and encodes the voice itself, sampling the audio and packing it into Real-time Transport Protocol packets with a codec such as G.711 or G.729.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a><a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a> It also translates the signaling, meaning the on-hook, off-hook, dialing, and ringing information that tells the network when a call starts, what number to reach, and when to hang up.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a> On the telephone side that signaling might be analog loop current or a digital protocol carried on a T1 or E1 circuit, and on the IP side it becomes a VoIP control protocol such as SIP, MGCP, or H.248.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://datatracker.ietf.org/doc/html/rfc3261\" class=\"citation-ref\" data-citation-index=\"8\" target=\"_blank\" rel=\"noreferrer\">[8]</a><a href=\"https://www.itu.int/rec/T-REC-H.248.1\" class=\"citation-ref\" data-citation-index=\"9\" target=\"_blank\" rel=\"noreferrer\">[9]</a> Because those two worlds encode a call so differently, the gateway is what lets an analog handset, a fax machine, or an older PBX keep working while the calls behind them travel over the internet.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a></p>\n<h3>Why a gateway is useful during the move to IP</h3>\n<p>Many organizations still run analog devices or a TDM PBX that would be costly to replace all at once, and a gateway lets that equipment connect to a SIP trunk or a hosted phone system while the rest of the network moves to IP.<a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a><a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a> A small residential-scale gateway gives a single analog line an IP path, while a trunking gateway manages a large number of digital circuits for a carrier or a large site.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a></p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":0},{"id":"9eedbf98-d47f-486d-b7f9-025a8c7650fe","sectionKey":"fxs_fxo_table","sectionType":"table_section","heading":"FXS and FXO ports at a glance","introMarkdown":"The analog side of a gateway uses two port types that are easy to confuse because they are mirror images of each other. An FXS port faces the end device and behaves like the phone company, while an FXO port faces the line and behaves like a telephone.[4] The table sums up the split, and the two sections after it explain what each port does and why the direction matters.","introHtml":"<p>The analog side of a gateway uses two port types that are easy to confuse because they are mirror images of each other. An FXS port faces the end device and behaves like the phone company, while an FXO port faces the line and behaves like a telephone.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> The table sums up the split, and the two sections after it explain what each port does and why the direction matters.</p>\n","outroMarkdown":"The rule that keeps them straight is direction: FXS supplies the line and faces the subscriber's equipment, while FXO consumes the line and faces the office.[4]","outroHtml":"<p>The rule that keeps them straight is direction: FXS supplies the line and faces the subscriber&#39;s equipment, while FXO consumes the line and faces the office.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a></p>\n","contentJson":{"rows":[{"cells":["Connects to","An end device such as an analog phone, fax machine, or modem [3][4]","A live line: a PSTN wall jack, or a station port on a PBX [4][5]"]},{"cells":["Acts like","The central office; it feeds and powers the line [4]","A telephone; it draws from the line [4]"]},{"cells":["Provides","Dial tone, battery current, and ring voltage [4]","On-hook and off-hook loop closure, and dialed DTMF digits [4][11]"]},{"cells":["Typical gateway use","An FXS gateway brings analog phones or fax onto a VoIP system [5]","An FXO gateway connects a VoIP system to live PSTN lines [5]"]},{"cells":["Pairing rule","Supplies the line that an FXO port receives [4]","Must be fed by an FXS port or a live phone line [4]"]}],"columns":["Property","FXS port (Foreign Exchange Subscriber)","FXO port (Foreign Exchange Office)"]},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":1},{"id":"11e7b2e2-01f5-4ed6-9abc-2f6b7a33b979","sectionKey":"fxs_port","sectionType":"markdown_section","heading":"What does an FXS port do?","introMarkdown":"An FXS port is the interface a gateway uses to power and control an analog end device, and it behaves the way a phone company's central office does toward a home phone.[4] Foreign Exchange Subscriber is the full name, and the S for subscriber is the reminder that this port faces the subscriber's equipment: a telephone, a fax machine, a modem, or the trunk port of an older PBX that expects to see a phone line.[3][4] The port supplies the three things an analog phone needs: dial tone so you know the line is ready, battery current so the handset has power over the copper pair, and ring voltage so it physically rings on an incoming call.[4] Because the FXS port generates that ring voltage, which is what makes the attached device ring, it is the active side of the pair.[4][11]\n\nOn a gateway, the FXS ports are where you plug in the analog hardware you want to keep. A small analog telephone adapter might have one or two FXS ports for a single phone or fax, while a larger FXS gateway can present dozens of them so an office full of analog handsets registers to an IP PBX.[3][5] Each port usually maps to a SIP account or profile on the call server, which makes an old two-wire phone look like a modern IP endpoint to the system.[6] Connecting a fax machine this way normally means turning on T.38 so the fax tones survive the packet network, a point the trade-offs section returns to.[10]","introHtml":"<p>An FXS port is the interface a gateway uses to power and control an analog end device, and it behaves the way a phone company&#39;s central office does toward a home phone.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> Foreign Exchange Subscriber is the full name, and the S for subscriber is the reminder that this port faces the subscriber&#39;s equipment: a telephone, a fax machine, a modem, or the trunk port of an older PBX that expects to see a phone line.<a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a><a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> The port supplies the three things an analog phone needs: dial tone so you know the line is ready, battery current so the handset has power over the copper pair, and ring voltage so it physically rings on an incoming call.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> Because the FXS port generates that ring voltage, which is what makes the attached device ring, it is the active side of the pair.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a><a href=\"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications\" class=\"citation-ref\" data-citation-index=\"11\" target=\"_blank\" rel=\"noreferrer\">[11]</a></p>\n<p>On a gateway, the FXS ports are where you plug in the analog hardware you want to keep. A small analog telephone adapter might have one or two FXS ports for a single phone or fax, while a larger FXS gateway can present dozens of them so an office full of analog handsets registers to an IP PBX.<a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a><a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> Each port usually maps to a SIP account or profile on the call server, which makes an old two-wire phone look like a modern IP endpoint to the system.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a> Connecting a fax machine this way normally means turning on T.38 so the fax tones survive the packet network, a point the trade-offs section returns to.<a href=\"https://www.itu.int/rec/T-REC-T.38\" class=\"citation-ref\" data-citation-index=\"10\" target=\"_blank\" rel=\"noreferrer\">[10]</a></p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":2},{"id":"af5a63e7-56a4-4b8e-82de-4695232b3710","sectionKey":"fxo_port","sectionType":"markdown_section","heading":"What does an FXO port do?","introMarkdown":"An FXO port is the interface a gateway uses to connect to a live telephone line, and it behaves the way a telephone does toward the network.[4] Foreign Exchange Office is the full name, and the O for office is the reminder that this port faces the telephone company's central office, or a PBX that is acting as one toward its extensions.[4][5] Rather than supplying power, the FXO port receives dial tone and line power from whatever it plugs into, then signals its state by opening and closing the electrical loop: closing the loop takes the line off-hook to seize it, and reopening the loop puts it back on-hook to release the call.[4][11] To dial, the port sends the digits as DTMF tones, the same tones a push-button phone produces.[11]\n\nOn a gateway, the FXO ports are where the outside lines come in. An FXO gateway lets a VoIP phone system reach the PSTN over ordinary analog lines, which suits a site that keeps a few copper lines for local calling or for reliability.[5] The same design gives you a fallback path, because if the internet or the SIP trunk goes down, calls can route out through the FXO ports to the physical phone lines instead.[5] Some adapters combine both port types, so a single unit might offer one FXS port for a phone and one FXO port for a PSTN line, with the FXS side hard-relayed to the FXO side during a power outage so the phone still reaches the emergency network.[6]","introHtml":"<p>An FXO port is the interface a gateway uses to connect to a live telephone line, and it behaves the way a telephone does toward the network.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> Foreign Exchange Office is the full name, and the O for office is the reminder that this port faces the telephone company&#39;s central office, or a PBX that is acting as one toward its extensions.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a><a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> Rather than supplying power, the FXO port receives dial tone and line power from whatever it plugs into, then signals its state by opening and closing the electrical loop: closing the loop takes the line off-hook to seize it, and reopening the loop puts it back on-hook to release the call.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a><a href=\"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications\" class=\"citation-ref\" data-citation-index=\"11\" target=\"_blank\" rel=\"noreferrer\">[11]</a> To dial, the port sends the digits as DTMF tones, the same tones a push-button phone produces.<a href=\"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications\" class=\"citation-ref\" data-citation-index=\"11\" target=\"_blank\" rel=\"noreferrer\">[11]</a></p>\n<p>On a gateway, the FXO ports are where the outside lines come in. An FXO gateway lets a VoIP phone system reach the PSTN over ordinary analog lines, which suits a site that keeps a few copper lines for local calling or for reliability.<a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> The same design gives you a fallback path, because if the internet or the SIP trunk goes down, calls can route out through the FXO ports to the physical phone lines instead.<a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> Some adapters combine both port types, so a single unit might offer one FXS port for a phone and one FXO port for a PSTN line, with the FXS side hard-relayed to the FXO side during a power outage so the phone still reaches the emergency network.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a></p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":3},{"id":"333cf07f-6386-4689-a2b7-64745b7f373b","sectionKey":"call_setup","sectionType":"markdown_section","heading":"How does the gateway set up a call?","introMarkdown":"The gateway translates between analog line signals and IP call control, so a physical event on the copper pair becomes a message the softswitch understands, and the reverse.[1] When an analog phone on an FXS port goes off-hook, the gateway detects the loop current, plays dial tone, and collects the DTMF digits the caller dials.[3][11] It then builds a call setup request, usually in SIP, and sends it to the IP PBX or trunk that will route the call.[8] For a call coming the other way, the gateway receives the SIP invitation, applies ring voltage to the FXS port so the attached phone rings, and connects the audio once someone answers.[3][4]\n\nUnderneath the signaling, the gateway is also converting the voice. It encodes the analog audio into digital samples and packs them into RTP packets with a codec, most often G.711 for full-quality calls or G.729 where bandwidth is tight, then decodes the packets back into sound for the analog side.[2][3] Two families of control protocol are common. In a decomposed design the gateway is a relatively simple device driven by an external call agent over MGCP or H.248, which keeps the call logic centralized.[1][9] In the design more common today, the gateway runs SIP itself and behaves like an intelligent endpoint that registers to the phone system on its own.[2][8] The gateway also handles the small but real details of an analog line, such as echo cancellation and passing DTMF reliably, so the IP side hears a clean call.[2]","introHtml":"<p>The gateway translates between analog line signals and IP call control, so a physical event on the copper pair becomes a message the softswitch understands, and the reverse.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a> When an analog phone on an FXS port goes off-hook, the gateway detects the loop current, plays dial tone, and collects the DTMF digits the caller dials.<a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a><a href=\"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications\" class=\"citation-ref\" data-citation-index=\"11\" target=\"_blank\" rel=\"noreferrer\">[11]</a> It then builds a call setup request, usually in SIP, and sends it to the IP PBX or trunk that will route the call.<a href=\"https://datatracker.ietf.org/doc/html/rfc3261\" class=\"citation-ref\" data-citation-index=\"8\" target=\"_blank\" rel=\"noreferrer\">[8]</a> For a call coming the other way, the gateway receives the SIP invitation, applies ring voltage to the FXS port so the attached phone rings, and connects the audio once someone answers.<a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a><a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a></p>\n<p>Underneath the signaling, the gateway is also converting the voice. It encodes the analog audio into digital samples and packs them into RTP packets with a codec, most often G.711 for full-quality calls or G.729 where bandwidth is tight, then decodes the packets back into sound for the analog side.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a><a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a> Two families of control protocol are common. In a decomposed design the gateway is a relatively simple device driven by an external call agent over MGCP or H.248, which keeps the call logic centralized.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://www.itu.int/rec/T-REC-H.248.1\" class=\"citation-ref\" data-citation-index=\"9\" target=\"_blank\" rel=\"noreferrer\">[9]</a> In the design more common today, the gateway runs SIP itself and behaves like an intelligent endpoint that registers to the phone system on its own.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a><a href=\"https://datatracker.ietf.org/doc/html/rfc3261\" class=\"citation-ref\" data-citation-index=\"8\" target=\"_blank\" rel=\"noreferrer\">[8]</a> The gateway also handles the small but real details of an analog line, such as echo cancellation and passing DTMF reliably, so the IP side hears a clean call.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a></p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":4},{"id":"4472806e-f488-4390-bb4c-23ccac03880f","sectionKey":"gateway_types","sectionType":"markdown_section","heading":"Where are PSTN gateways used?","introMarkdown":"PSTN gateways come in a few shapes depending on how many lines you have and whether they are analog or digital.[1][7] The right one depends on the equipment you are connecting and the scale, which can run from a single fax machine to a carrier trunk carrying hundreds of calls.\n\n### An analog FXS gateway or ATA\n\nAn analog FXS gateway, in its smallest form an analog telephone adapter, connects individual analog devices to an IP phone system.[3] You use it when you have phones, fax machines, alarm panels, or door intercoms that you want to keep, but the calls behind them should travel over VoIP.[3][5] These units run from a single-port adapter up to rack-mounted gateways with 24 or more FXS ports for an office that still uses analog handsets.\n\n### An analog FXO gateway\n\nAn analog FXO gateway connects a VoIP phone system to physical PSTN lines.[5] You reach for it when you want to keep a handful of copper lines, whether for local calling, for a dedicated fax line, or as a backup route if the internet connection fails.[5] A hybrid adapter such as the Grandstream HT813 pairs an FXO PSTN line port with an FXS port, so one box can bring an outside line into a SIP-based system and still power a local phone.[6]\n\n### A digital trunking gateway\n\nA digital gateway connects TDM circuits rather than individual analog lines, converting voice between PRI, T1, E1, or BRI connections and VoIP.[7] A large site or a carrier uses this kind of gateway to bridge a legacy PBX or the PSTN to SIP at scale, and Sangoma's digital gateways, for instance, come in 1 to 8 ports of T1, E1, or PRI and carry up to 120 simultaneous calls per unit.[7] The standards call this a trunking gateway, one that interfaces the telephone network to a VoIP network and manages a large number of digital circuits.[1]","introHtml":"<p>PSTN gateways come in a few shapes depending on how many lines you have and whether they are analog or digital.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a> The right one depends on the equipment you are connecting and the scale, which can run from a single fax machine to a carrier trunk carrying hundreds of calls.</p>\n<h3>An analog FXS gateway or ATA</h3>\n<p>An analog FXS gateway, in its smallest form an analog telephone adapter, connects individual analog devices to an IP phone system.<a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a> You use it when you have phones, fax machines, alarm panels, or door intercoms that you want to keep, but the calls behind them should travel over VoIP.<a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a><a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> These units run from a single-port adapter up to rack-mounted gateways with 24 or more FXS ports for an office that still uses analog handsets.</p>\n<h3>An analog FXO gateway</h3>\n<p>An analog FXO gateway connects a VoIP phone system to physical PSTN lines.<a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> You reach for it when you want to keep a handful of copper lines, whether for local calling, for a dedicated fax line, or as a backup route if the internet connection fails.<a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> A hybrid adapter such as the Grandstream HT813 pairs an FXO PSTN line port with an FXS port, so one box can bring an outside line into a SIP-based system and still power a local phone.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a></p>\n<h3>A digital trunking gateway</h3>\n<p>A digital gateway connects TDM circuits rather than individual analog lines, converting voice between PRI, T1, E1, or BRI connections and VoIP.<a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a> A large site or a carrier uses this kind of gateway to bridge a legacy PBX or the PSTN to SIP at scale, and Sangoma&#39;s digital gateways, for instance, come in 1 to 8 ports of T1, E1, or PRI and carry up to 120 simultaneous calls per unit.<a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a> The standards call this a trunking gateway, one that interfaces the telephone network to a VoIP network and manages a large number of digital circuits.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a></p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":5},{"id":"9f417d46-00a8-4bb1-9611-712fb6c26c18","sectionKey":"trade_offs","sectionType":"markdown_section","heading":"Trade-offs and what to watch","introMarkdown":"A gateway keeps analog and legacy gear working on an IP network, and a few practical issues are worth knowing before you depend on one.[2]\n\n### Fax needs T.38, not just any codec\n\nFax machines and modems send data as tones that a voice codec can distort once calls are packetized, so a plain VoIP path often fails a fax that worked fine on copper.[10] The fix is T.38, the ITU-T protocol for carrying real-time Group 3 fax over IP, which most fax-capable gateways support.[6][10] If fax matters, confirm that both the gateway and the service on the far side handle T.38 rather than assuming G.711 will carry it.\n\n### Power and lifeline behavior\n\nAn analog phone on a traditional copper line keeps working in a blackout because the line is powered from the exchange, and a gateway on IP does not have that property on its own.[3] Some adapters address this with a lifeline relay that hard-connects the FXS port to an FXO port during a power outage, so the local phone falls back to the physical PSTN line for emergency calls.[6] Where that matters, plan backup power for the gateway and the network gear it depends on.\n\n### Echo, delay, and clocking\n\nBridging two different networks introduces the analog-side issues a gateway has to manage, including echo and the timing differences between a packet network and a TDM circuit.[2] Media gateways include echo cancellation and DTMF handling for this reason, and on a digital gateway the clocking of the T1 or E1 has to line up with the carrier to avoid slips.[2][7] These are usually configuration details rather than dealbreakers, though they are the first things to check when call quality is off.\n\n### Security of a networked voice device\n\nA gateway that faces the internet is a networked computer running a voice stack, so it needs the same care as any edge device.[6] Encryption of the media and signaling, current firmware, and access control all apply, and Grandstream's adapters, for example, ship with AES media encryption and a per-unit certificate.[6] Treat the gateway as part of your security perimeter rather than as a passive phone accessory.","introHtml":"<p>A gateway keeps analog and legacy gear working on an IP network, and a few practical issues are worth knowing before you depend on one.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a></p>\n<h3>Fax needs T.38, not just any codec</h3>\n<p>Fax machines and modems send data as tones that a voice codec can distort once calls are packetized, so a plain VoIP path often fails a fax that worked fine on copper.<a href=\"https://www.itu.int/rec/T-REC-T.38\" class=\"citation-ref\" data-citation-index=\"10\" target=\"_blank\" rel=\"noreferrer\">[10]</a> The fix is T.38, the ITU-T protocol for carrying real-time Group 3 fax over IP, which most fax-capable gateways support.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a><a href=\"https://www.itu.int/rec/T-REC-T.38\" class=\"citation-ref\" data-citation-index=\"10\" target=\"_blank\" rel=\"noreferrer\">[10]</a> If fax matters, confirm that both the gateway and the service on the far side handle T.38 rather than assuming G.711 will carry it.</p>\n<h3>Power and lifeline behavior</h3>\n<p>An analog phone on a traditional copper line keeps working in a blackout because the line is powered from the exchange, and a gateway on IP does not have that property on its own.<a href=\"https://en.wikipedia.org/wiki/Analog_telephone_adapter\" class=\"citation-ref\" data-citation-index=\"3\" target=\"_blank\" rel=\"noreferrer\">[3]</a> Some adapters address this with a lifeline relay that hard-connects the FXS port to an FXO port during a power outage, so the local phone falls back to the physical PSTN line for emergency calls.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a> Where that matters, plan backup power for the gateway and the network gear it depends on.</p>\n<h3>Echo, delay, and clocking</h3>\n<p>Bridging two different networks introduces the analog-side issues a gateway has to manage, including echo and the timing differences between a packet network and a TDM circuit.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a> Media gateways include echo cancellation and DTMF handling for this reason, and on a digital gateway the clocking of the T1 or E1 has to line up with the carrier to avoid slips.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a><a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a> These are usually configuration details rather than dealbreakers, though they are the first things to check when call quality is off.</p>\n<h3>Security of a networked voice device</h3>\n<p>A gateway that faces the internet is a networked computer running a voice stack, so it needs the same care as any edge device.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a> Encryption of the media and signaling, current firmware, and access control all apply, and Grandstream&#39;s adapters, for example, ship with AES media encryption and a per-unit certificate.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a> Treat the gateway as part of your security perimeter rather than as a passive phone accessory.</p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":6},{"id":"193431c8-6b08-4bb9-98f7-096601b8d593","sectionKey":"what_it_is_not","sectionType":"markdown_section","heading":"What a PSTN gateway is not","introMarkdown":"A PSTN gateway is often mixed up with a few neighboring devices, and separating them clarifies what it does.[2]\n\n### It is not a PBX or phone system\n\nA gateway connects phones and lines to a call-control system, but it does not run the call logic itself.[5] The IP PBX or hosted service decides how calls route, who rings, and what features apply, and the gateway simply presents analog or TDM endpoints to that system as if they were IP.[1][5]\n\n### FXS and FXO are not interchangeable\n\nThe two port types face opposite directions, so you cannot swap one for the other.[4] Plugging a device meant for an FXS port into an FXO port, or joining two FXO ports together, leaves nothing supplying dial tone and ring voltage, and the connection fails.[4] Matching the port to the equipment is the most common setup mistake to avoid.\n\n### It is not tied to analog only\n\nAlthough the FXS and FXO ports people ask about are analog, a PSTN gateway can just as easily terminate digital trunks.[7] A digital gateway converts PRI, T1, or E1 circuits to SIP, which is how larger sites and carriers bridge legacy systems without any analog ports at all.[1][7]\n\n### It is not a permanent arrangement\n\nThe FXO side of a gateway depends on live PSTN lines, and those are being retired as carriers move to all-IP.[7] Gateways stay useful for connecting analog devices and legacy PBXs through that transition, though the long-term direction is native IP, which is the destination a gateway is helping older equipment reach.[5][7]","introHtml":"<p>A PSTN gateway is often mixed up with a few neighboring devices, and separating them clarifies what it does.<a href=\"https://en.wikipedia.org/wiki/Media_gateway\" class=\"citation-ref\" data-citation-index=\"2\" target=\"_blank\" rel=\"noreferrer\">[2]</a></p>\n<h3>It is not a PBX or phone system</h3>\n<p>A gateway connects phones and lines to a call-control system, but it does not run the call logic itself.<a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a> The IP PBX or hosted service decides how calls route, who rings, and what features apply, and the gateway simply presents analog or TDM endpoints to that system as if they were IP.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a></p>\n<h3>FXS and FXO are not interchangeable</h3>\n<p>The two port types face opposite directions, so you cannot swap one for the other.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> Plugging a device meant for an FXS port into an FXO port, or joining two FXO ports together, leaves nothing supplying dial tone and ring voltage, and the connection fails.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a> Matching the port to the equipment is the most common setup mistake to avoid.</p>\n<h3>It is not tied to analog only</h3>\n<p>Although the FXS and FXO ports people ask about are analog, a PSTN gateway can just as easily terminate digital trunks.<a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a> A digital gateway converts PRI, T1, or E1 circuits to SIP, which is how larger sites and carriers bridge legacy systems without any analog ports at all.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a></p>\n<h3>It is not a permanent arrangement</h3>\n<p>The FXO side of a gateway depends on live PSTN lines, and those are being retired as carriers move to all-IP.<a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a> Gateways stay useful for connecting analog devices and legacy PBXs through that transition, though the long-term direction is native IP, which is the destination a gateway is helping older equipment reach.<a href=\"https://www.yeastar.com/blog/fxo-vs-fxs/\" class=\"citation-ref\" data-citation-index=\"5\" target=\"_blank\" rel=\"noreferrer\">[5]</a><a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a></p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":null,"noteHtml":null,"sortOrder":7},{"id":"05cbae68-8dc4-483c-9f90-040f126528d7","sectionKey":"contributor_perspective","sectionType":"markdown_section","heading":"How this answer was researched","introMarkdown":"This entry draws its definitions from primary specifications and vendor documentation, then cross-checks them against independent references. The media gateway definition and the split between residential and trunking gateways come from the IETF's MGCP specification, RFC 3435, and the control protocols from the SIP and H.248 standards.[1][8][9] The FXS and FXO behavior, including which port supplies dial tone, battery, and ring voltage and which signals by loop closure, is taken from vendor technical notes and an independent applications reference and checked against each other.[4][11] Product-level examples of analog and digital gateways come directly from current manufacturer pages, and the fax-over-IP requirement from ITU-T T.38.[6][7][10] Gateway hardware and the phone network it connects to keep changing, so the details here reflect what the cited sources stated on the verification date. Engineers and network administrators who work with these devices are welcome to suggest corrections, which are checked against primary sources before any update.","introHtml":"<p>This entry draws its definitions from primary specifications and vendor documentation, then cross-checks them against independent references. The media gateway definition and the split between residential and trunking gateways come from the IETF&#39;s MGCP specification, RFC 3435, and the control protocols from the SIP and H.248 standards.<a href=\"https://datatracker.ietf.org/doc/html/rfc3435\" class=\"citation-ref\" data-citation-index=\"1\" target=\"_blank\" rel=\"noreferrer\">[1]</a><a href=\"https://datatracker.ietf.org/doc/html/rfc3261\" class=\"citation-ref\" data-citation-index=\"8\" target=\"_blank\" rel=\"noreferrer\">[8]</a><a href=\"https://www.itu.int/rec/T-REC-H.248.1\" class=\"citation-ref\" data-citation-index=\"9\" target=\"_blank\" rel=\"noreferrer\">[9]</a> The FXS and FXO behavior, including which port supplies dial tone, battery, and ring voltage and which signals by loop closure, is taken from vendor technical notes and an independent applications reference and checked against each other.<a href=\"https://www.patton.com/technotes/what-are-fxs-and-fxo/\" class=\"citation-ref\" data-citation-index=\"4\" target=\"_blank\" rel=\"noreferrer\">[4]</a><a href=\"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications\" class=\"citation-ref\" data-citation-index=\"11\" target=\"_blank\" rel=\"noreferrer\">[11]</a> Product-level examples of analog and digital gateways come directly from current manufacturer pages, and the fax-over-IP requirement from ITU-T T.38.<a href=\"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813\" class=\"citation-ref\" data-citation-index=\"6\" target=\"_blank\" rel=\"noreferrer\">[6]</a><a href=\"https://www.sangoma.com/voip-gateways/digital/\" class=\"citation-ref\" data-citation-index=\"7\" target=\"_blank\" rel=\"noreferrer\">[7]</a><a href=\"https://www.itu.int/rec/T-REC-T.38\" class=\"citation-ref\" data-citation-index=\"10\" target=\"_blank\" rel=\"noreferrer\">[10]</a> Gateway hardware and the phone network it connects to keep changing, so the details here reflect what the cited sources stated on the verification date. Engineers and network administrators who work with these devices are welcome to suggest corrections, which are checked against primary sources before any update.</p>\n","outroMarkdown":null,"outroHtml":null,"contentJson":{},"configJson":{},"noteMarkdown":"This answer was written and reviewed by the AnswerStack Editorial Team, which has no commercial stake in the products, companies, or methods discussed. Every claim is cited inline and verified on the dates shown.","noteHtml":"<p>This answer was written and reviewed by the AnswerStack Editorial Team, which has no commercial stake in the products, companies, or methods discussed. Every claim is cited inline and verified on the dates shown.</p>\n","sortOrder":8}],"citations":[{"title":"RFC 3435: Media Gateway Control Protocol (MGCP) Version 1.0","url":"https://datatracker.ietf.org/doc/html/rfc3435","excerpt":"a network element that provides conversion between the audio signals carried on telephone circuits and data packets carried over the Internet or over other packet networks","quoteText":null,"sourceRole":"PRIMARY","verifiedAt":"2026-07-18T00:00:00","supportsText":"Definition of a media gateway as conversion between telephone-circuit audio and packet data; residential gateway (analog RJ11 to VoIP) and trunking gateway (large number of digital circuits) types; A-law/mu-law samples into audio packets; call agent handles signaling while the gateway handles media","domain":"datatracker.ietf.org","publisherName":"Internet Engineering Task Force (IETF)"},{"title":"Media gateway","url":"https://en.wikipedia.org/wiki/Media_gateway","excerpt":"A media gateway is a translation device or service that converts media streams between disparate telecommunications technologies.","quoteText":null,"sourceRole":"INDEPENDENT","verifiedAt":"2026-07-18T00:00:00","supportsText":"Media gateway converts media streams between circuit-switched technologies (POTS, SS7, mobile) and packet networks (IP); uses MGCP, H.248/Megaco, and SIP; converts TDM voice to RTP; handles echo cancellation and DTMF","domain":"en.wikipedia.org","publisherName":"Wikipedia"},{"title":"Analog telephone adapter","url":"https://en.wikipedia.org/wiki/Analog_telephone_adapter","excerpt":"a device for connecting traditional analog telephones, fax machines, and similar customer-premises devices to a digital telephone system or a voice over IP telephone network","quoteText":null,"sourceRole":"INDEPENDENT","verifiedAt":"2026-07-18T00:00:00","supportsText":"ATA connects analog phones, fax machines, and similar devices to a digital or VoIP telephone network; provides one or more FXS ports and optionally an FXO interface; uses H.323, SIP, MGCP protocols and G.711, G.729 codecs; supplies dial tone, ringing, and caller ID","domain":"en.wikipedia.org","publisherName":"Wikipedia"},{"title":"What are FXS and FXO?","url":"https://www.patton.com/technotes/what-are-fxs-and-fxo/","excerpt":"A telecommunications line from an FXO port must connect to an FXS port in order for the connection to work.","quoteText":null,"sourceRole":"PRIMARY","verifiedAt":"2026-07-18T00:00:00","supportsText":"FXS (Foreign eXchange Subscriber) delivers POTS service and supplies dial tone, battery current, and ring voltage to subscriber equipment; FXO (Foreign eXchange Office) receives POTS service and provides on-hook/off-hook loop closure; a line from an FXO port must connect to an FXS port","domain":"patton.com","publisherName":"Patton Electronics"},{"title":"FXO vs FXS: What is, Differences and Ports Explained","url":"https://www.yeastar.com/blog/fxo-vs-fxs/","excerpt":"Wall jack or FXS interface delivers dial tone, ringing voltage, and battery power to FXO devices.","quoteText":null,"sourceRole":"INDEPENDENT","verifiedAt":"2026-07-18T00:00:00","supportsText":"FXS delivers dial tone, ringing voltage, and battery power to end devices and connects analog phones, fax, and PABX to VoIP; FXO connects an FXO device to an outside telephone line and connects a VoIP system to PSTN lines; FXO gateway can provide a failover or fallback solution","domain":"yeastar.com","publisherName":"Yeastar"},{"title":"HT813 FXS/FXO Analog Telephone Adaptor","url":"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813","excerpt":"One (1) RJ11 FXS port, One (1) RJ11 FXO PSTN line port with lifeline support","quoteText":null,"sourceRole":"PRIMARY","verifiedAt":"2026-07-18T00:00:00","supportsText":"Hybrid ATA with one FXS port and one FXO PSTN line port; lifeline support hard-relays the FXS port to the FXO port during a power outage; supports two SIP profiles, failover SIP server, T.38 fax over IP, and AES encryption with a per-unit certificate","domain":"grandstream.com","publisherName":"Grandstream Networks"},{"title":"Digital VoIP Gateways","url":"https://www.sangoma.com/voip-gateways/digital/","excerpt":"allow you to convert voice media between PRI connections or BRI lines (UK) and VoIP connections","quoteText":null,"sourceRole":"PRIMARY","verifiedAt":"2026-07-18T00:00:00","supportsText":"Digital gateways convert voice media between PRI (T1/E1) or BRI lines and VoIP connections; connect TDM phone systems to VoIP and IP networks to the PSTN; available in 1 to 8 ports of T1/E1/PRI with up to 120 simultaneous calls per unit","domain":"sangoma.com","publisherName":"Sangoma Technologies"},{"title":"RFC 3261: SIP: Session Initiation Protocol","url":"https://datatracker.ietf.org/doc/html/rfc3261","excerpt":"an application-layer control (signaling) protocol for creating, modifying, and terminating sessions with one or more participants","quoteText":null,"sourceRole":"PRIMARY","verifiedAt":"2026-07-18T00:00:00","supportsText":"SIP is the application-layer control protocol used to create, modify, and terminate call sessions; the VoIP control protocol a gateway commonly uses to set up calls with an IP PBX or trunk","domain":"datatracker.ietf.org","publisherName":"IETF"},{"title":"ITU-T H.248.1: Gateway control protocol","url":"https://www.itu.int/rec/T-REC-H.248.1","excerpt":"Gateway control protocol: Version 3","quoteText":null,"sourceRole":"PRIMARY","verifiedAt":"2026-07-18T00:00:00","supportsText":"H.248.1 (also known as Megaco) is the gateway control protocol used by an external call agent to control a decomposed media gateway; in force","domain":"itu.int","publisherName":"International Telecommunication Union (ITU-T)"},{"title":"ITU-T T.38: Procedures for real-time Group 3 facsimile communication over IP networks","url":"https://www.itu.int/rec/T-REC-T.38","excerpt":"Procedures for real-time Group 3 facsimile communication over IP networks","quoteText":null,"sourceRole":"PRIMARY","verifiedAt":"2026-07-18T00:00:00","supportsText":"T.38 defines real-time Group 3 fax over IP networks, the protocol a gateway uses so fax survives packetization instead of relying on a voice codec; in force","domain":"itu.int","publisherName":"International Telecommunication Union (ITU-T)"},{"title":"FXS and FXO: What They Are and Different Phone Applications","url":"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications","excerpt":"The FXO interface delivers an on-hook/off-hook loop closure.","quoteText":null,"sourceRole":"INDEPENDENT","verifiedAt":"2026-07-18T00:00:00","supportsText":"FXS delivers dial tone, ringing voltage, and battery power to FXO end devices and transmits ring voltage to make them ring; the FXO interface delivers an on-hook/off-hook loop closure and dials using DTMF digits","domain":"tccomm.com","publisherName":"TC Communications"}],"revisions":[],"relatedAnswers":[{"id":"3cc4d7a6-6aed-4446-8dd8-13e022c3e1ba","slug":"is-pstn-secure-and-can-pstn-calls-be-encrypted","question":"Is PSTN secure, and can PSTN calls be encrypted?","publishedAt":"2026-07-20T16:01:27.137","confidenceScore":92,"confidenceLabel":"High","industry":{"id":"ff619d7c-d7d7-485e-a05a-53fba07f33ed","slug":"telecommunications","label":"Telecommunications","description":"Business voice, fiber, UCaaS, and network services"},"topic":{"slug":"pstn","label":"PSTN","description":"The public switched telephone network: how it works, POTS retirement, and the move to VoIP.","schemaKind":null},"contributor":{"id":"ec39deab-44fe-48d8-9029-fefe993ab85a","slug":"answer-stack","displayName":"AnswerStack","websiteUrl":null},"snippet":"Standard PSTN calls are unencrypted, so they are exposed to line taps, interception inside the exchange (which carriers are legally required to support), and SS7 signaling attacks that can redirect calls and track users. The network supplies no encryption of its own. Confidentiality is possible only by adding matched crypto devices at both ends, such as STU-III or STE secure phones, or by carrying the call over encrypted IP using SRTP and TLS. Encryption always lives at the endpoints, never in the PSTN itself.","url":"/q/is-pstn-secure-and-can-pstn-calls-be-encrypted"},{"id":"895bda56-c48a-429f-8f13-53dc29c09b67","slug":"which-legacy-devices-are-still-at-risk-when-pstn-pots-lines-are-retired-or","question":"Which legacy devices are still at risk when PSTN/POTS lines are retired or moved to VoIP?","publishedAt":"2026-07-20T16:01:24.898","confidenceScore":90,"confidenceLabel":"High","industry":{"id":"ff619d7c-d7d7-485e-a05a-53fba07f33ed","slug":"telecommunications","label":"Telecommunications","description":"Business voice, fiber, UCaaS, and network services"},"topic":{"slug":"pstn","label":"PSTN","description":"The public switched telephone network: how it works, POTS retirement, and the move to VoIP.","schemaKind":null},"contributor":{"id":"ec39deab-44fe-48d8-9029-fefe993ab85a","slug":"answer-stack","displayName":"AnswerStack","websiteUrl":null},"snippet":"When copper POTS lines move to VoIP, the equipment that fails is the kind that dials out as data or reaches for help automatically: fire alarm panel communicators, elevator emergency phones, burglar alarm dialers, medical alert pendants, fax machines, and card-payment terminals. They break because packet networks compress and drop the exact tones these machines depend on, and because a VoIP line loses power in an outage that a copper loop survived. Each one needs a cellular, IP, or analog-emulating replacement before its line is cut.","url":"/q/which-legacy-devices-are-still-at-risk-when-pstn-pots-lines-are-retired-or"},{"id":"ef14e83f-e61d-4263-80d2-b759e8ba8101","slug":"what-is-the-difference-between-pstn-and-pbx","question":"What is the difference between PSTN and PBX?","publishedAt":"2026-07-18T15:32:04.773","confidenceScore":93,"confidenceLabel":"High","industry":{"id":"ff619d7c-d7d7-485e-a05a-53fba07f33ed","slug":"telecommunications","label":"Telecommunications","description":"Business voice, fiber, UCaaS, and network services"},"topic":{"slug":"pstn","label":"PSTN","description":"The public switched telephone network: how it works, POTS retirement, and the move to VoIP.","schemaKind":null},"contributor":{"id":"ec39deab-44fe-48d8-9029-fefe993ab85a","slug":"answer-stack","displayName":"AnswerStack","websiteUrl":null},"snippet":"The PSTN is the public, carrier-run network that connects phones worldwide; a PBX is a private switch that routes calls inside one organization and shares a few outside lines among many users. They are not rivals. A PBX plugs into the PSTN through trunk lines so staff can reach outside numbers, which is how a 100-person office runs on about ten external lines. Today most PBXs are IP or cloud-hosted and connect to the PSTN over a SIP trunk.","url":"/q/what-is-the-difference-between-pstn-and-pbx"},{"id":"5b57d468-46b4-435f-b89f-606f48f3ce0b","slug":"what-is-the-difference-between-pstn-and-pots","question":"What is the difference between PSTN and POTS?","publishedAt":"2026-07-18T15:32:02.968","confidenceScore":92,"confidenceLabel":"High","industry":{"id":"ff619d7c-d7d7-485e-a05a-53fba07f33ed","slug":"telecommunications","label":"Telecommunications","description":"Business voice, fiber, UCaaS, and network services"},"topic":{"slug":"pstn","label":"PSTN","description":"The public switched telephone network: how it works, POTS retirement, and the move to VoIP.","schemaKind":null},"contributor":{"id":"ec39deab-44fe-48d8-9029-fefe993ab85a","slug":"answer-stack","displayName":"AnswerStack","websiteUrl":null},"snippet":"POTS and the PSTN describe two layers of the same telephone system. Plain old telephone service is the basic analog voice product on a single copper line, while the PSTN is the whole switched network of exchanges and trunks that carries the call. POTS runs on the PSTN rather than beside it, which is why the two terms get used interchangeably. The core of the PSTN is digital, while POTS stays analog at the edge, and both are now being retired as voice moves to internet protocol.","url":"/q/what-is-the-difference-between-pstn-and-pots"}],"contributorStats":{"verifiedAnswers":224,"openDisputes":0},"schemaJson":{"@context":"https://schema.org","@type":"Question","name":"What is a PSTN gateway, and what do FXS and FXO ports do?","text":"What is a PSTN gateway, and what do FXS and FXO ports do?","url":"https://www.answerstack.io/q/what-is-a-pstn-gateway-and-what-do-fxs-and-fxo-ports-do","answerCount":1,"datePublished":"2026-07-20T16:01:22.747","author":{"@type":"Person","name":"AnswerStack Editorial Team","worksFor":{"@type":"Organization","name":"AnswerStack"},"url":"https://www.answerstack.io/contributors/answer-stack"},"about":[{"@type":"Thing","name":"PSTN"},{"@type":"Thing","name":"Telecommunications"}],"acceptedAnswer":{"@type":"Answer","text":"A PSTN gateway is a device that converts telephone calls between the circuit-switched public telephone network and a packet-based IP network, so analog phones, fax machines, or a legacy PBX can work with a VoIP system.[1][2] On the analog side it uses two kinds of ports. An FXS port, short for Foreign Exchange Subscriber, supplies dial tone, battery current, and ring voltage to an end device such as a phone or fax machine, while an FXO port, short for Foreign Exchange Office, is the line-side interface that receives dial tone from the PSTN or a PBX and signals on-hook and off-hook by opening and closing the electrical loop.[4][11] The two always work as a pair, because a line coming from an FXO port has to terminate on an FXS port for a call to complete.[4] The gateway handles the media conversion, encoding voice with a codec such as G.711 or G.729 into RTP packets, and it speaks a VoIP control protocol such as SIP, MGCP, or H.248 to the phone system that runs the call.[1][3][8]","url":"https://www.answerstack.io/q/what-is-a-pstn-gateway-and-what-do-fxs-and-fxo-ports-do","upvoteCount":0,"datePublished":"2026-07-20T16:01:22.747","dateModified":"2026-07-18T00:00:00","author":{"@type":"Person","name":"AnswerStack Editorial Team","worksFor":{"@type":"Organization","name":"AnswerStack"},"url":"https://www.answerstack.io/contributors/answer-stack"},"citation":[{"@type":"CreativeWork","name":"RFC 3435: Media Gateway Control Protocol (MGCP) Version 1.0","url":"https://datatracker.ietf.org/doc/html/rfc3435"},{"@type":"CreativeWork","name":"Media gateway","url":"https://en.wikipedia.org/wiki/Media_gateway"},{"@type":"CreativeWork","name":"Analog telephone adapter","url":"https://en.wikipedia.org/wiki/Analog_telephone_adapter"},{"@type":"CreativeWork","name":"What are FXS and FXO?","url":"https://www.patton.com/technotes/what-are-fxs-and-fxo/"},{"@type":"CreativeWork","name":"FXO vs FXS: What is, Differences and Ports Explained","url":"https://www.yeastar.com/blog/fxo-vs-fxs/"},{"@type":"CreativeWork","name":"HT813 FXS/FXO Analog Telephone Adaptor","url":"https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht813"},{"@type":"CreativeWork","name":"Digital VoIP Gateways","url":"https://www.sangoma.com/voip-gateways/digital/"},{"@type":"CreativeWork","name":"RFC 3261: SIP: Session Initiation Protocol","url":"https://datatracker.ietf.org/doc/html/rfc3261"},{"@type":"CreativeWork","name":"ITU-T H.248.1: Gateway control protocol","url":"https://www.itu.int/rec/T-REC-H.248.1"},{"@type":"CreativeWork","name":"ITU-T T.38: Procedures for real-time Group 3 facsimile communication over IP networks","url":"https://www.itu.int/rec/T-REC-T.38"},{"@type":"CreativeWork","name":"FXS and FXO: What They Are and Different Phone Applications","url":"https://www.tccomm.com/Literature/Literature/Education/FXS-FXO-Practical-Applications"}]}}}