User Tools

Site Tools


pstn

Telephone lines

This is a placeholder. Coin lines and B1 (analog / POTS) lines will be explained here, as well as how to emulate the B1 line, where to get a number, how to set up a dial plan etc.

Basic terms

POTS (Plain Old Telephone Service) is a conventional analog signal transmission over physical copper wires (twisted pair). This technology originates from Alexander Graham Bell’s phone system, which dates back to 1876. It was the basic telephone call service that individuals and businesses used until recently. Basic principles of the analog line are:

  • A current loop over one pair of copper wires (Tip and Ring). Tip is at ground level, Ring voltage is -48V at standby (on-hook), operating current usually 20mA, meaning the off-hook voltage - depending on the resistance of the phone, cable loop and central office type - approximately 6-12V.
  • Ringing voltage of 70-90V AC, applied in series with the -48V, frequency of 20Hz (USA) or 25Hz (Europe).
  • Pulse dialing (introduced in late 19th century) or DTMF (multi-frequency aka. touch-tone, introduced 1963)
  • Polarity reversal upon call answer (so Ring voltage becomes positive). Common across Europe for all systems, from pre-WW2 SxS (Strowger), cross-bar systems (Pentaconta 1000C), thru electronic and digital systems (Alcatel E10, S12, Siemens EWSD, AT&T/Lucent 5ESS etc.). In the USA polarity reversal was not so common past the step-by-step systems and considered a special feature, therefore COCOT payphones were utilizing different methods (IAS - Inferred Answer Supervision).

Coin line is an addition to the POTS line, usually within the central office, so that it can control the payphone operation in the following way:

  • make sure initial charge has been deposited
  • check if a coin jam situation is signaled by the payphone
  • make sure additional charge is deposited for a long distance call (and count the deposit), ask for the extra charge
  • directly operate the escrow delay by applying a positive or negative voltage (±130V) towards the Tip wire and ground, after the call is completed, to collect or return the deposit.
  • European “coin lines” were (since ca. 90s) regular lines with 16kHz ultrasound signalling from the CO towards the payphone indicating a charge of a fixed amount (a 'pulse'). Intervals varied depending on a rate, e.g. local calls would have a pulse each 3 minutes, long distance could be 30 seconds or so. In some setups, payphone would acknowledge a successful charge with a 12kHz pulse reply.

There are independent projects aiming to add the coin control over the POTS / VoIP line. Some are commercially available, but limited and pricey.

End of POTS in America

Recently (2022-2023), lot of news have been released and most of them sound like this: On August 2, 2019, the FCC Forbearance Order 19-72A1 was issued. The order dictated that by August 2, 2022, all POTS lines in the U.S. needed to be replaced with an alternative service, effectively spelling the end for traditional analog copper phone line systems.
This is a big misunderstanding and effectively a fake news. Many have interpreted this order to mean that plain-old-telephony-service (POTS) lines are going away in August 2022. However, this order is not a mandate, and it just allows carriers to no longer offer discounted rates to competitors for POTS line resale (and other copper services). That being said, indeed many companies do not offer new POTS lines anymore (for example CenturyLink), or they just don't advertise it anymore, but still connect new lines.

In their release announcing the order, the FCC said: “Recognizing sweeping changes over the past two decades in the market for voice telephone service, the Federal Communications Commission issued an Order today granting certain local phone companies relief from two 1996-era regulatory obligations that no longer serve their intended purpose.”

Order 10-72A1 - still valid ???

POTS equivalents

PSTN (Public Switched Telephone Network) as existed thru 2000s is coming to an end. There is a variety of reasons: mobile network maturity reached long ago and the internet, making the existence of separate, copper-line based network unnecessary. I miss the quality and reliability of the analog / TDM telephony, but it is what it is. There are a few options to consider if you need analog line for your payphone or a regular landline phone:

  • VoIP adapter. Advantage: acts like a regular landline. You can have your own number.
  • Bluetooth adapter, like Xlink series. Advantages: easy setup using your own mobile phone
  • Analog PBX (eg. Panasonic). Truly analog experience, but can only dial internal numbers
  • Asterisk server + TDM cards, or a TDM module. Real TDM experience with low latency (dial-up modems work!) but difficult setup taking space and energy. Examples are: Carrier Access 600, Cisco IAD series. PCI express cards exist as well but you need a PC.

With the VoIP you need a provider. The one I successfully use is voip.ms. Reasonable pricing, great selection of the phone numbers. If you want your phone to ring together with your mobile phone, you may consider the XLink option, or Google Fi. It allows you to forward a call to another number - your VoIP number for example - and ring both at the same time.

As for the VoIP adapter, Grandstream HT812 would be the most recommended if you need pulse (rotary) dialing. It has two lines (4- and 8- line versions exist, HT814 and HT818 respectively). If you don't need the rotary dialing, Linksys/Cisco SPA112 would be better, giving higher ringing voltage to power up really old phones.

Emulating analog exchange with a VoIP ATA for modem calls

Modem (dial-up) connection is needed to program most of the COCOT phones. In most cases, you don't have two landlines needed for the call, not even one. VoIP adapter is the most obvious solution, but unfortunately modems won't communicate correctly, despite of fine-tuning certain settings (disable echo suppression, enable high end codecs etc; Cisco has even a special *99 code to enable “modem line” per call). This is a case for both Protel and Elcotel, even if the call is entirely local (within the ATA, not over the internet). You may buy a small PBX or a line emulator, but that is expensive and pretty useless for anything else. Here's the solution that worked for me though. Any regular VoIP adapter (in this example Grandstream HT502) with two ports can provide the line and ringing voltage, dial detection etc. All we have to do is:

  • make it deaf, so the (troublesome) digital voice transmission won't work
  • couple the lines in an analog way so the modems will talk flawlessly

Usually people fight the opposite issues with VoIP, ie. they can't hear one or both ways :) There are several ways to break it, for example:

  • make the config intentionally bad inside the ATA. It worked to some extent but call would hang up after the timeout period, eg. 30 seconds
  • cut one pin of the SLIC chip inside the ATA, so there's no voice transmission (difficult and possibly irreversible)
  • disable certain network traffic - the best solution

I picked the last option. I have a FreePBX running on a Linux computer. This solution works also if you use external VoIP provider and might be actually easier to implement.
First, determine your ATA's local RTP ports. Each line has it's own SIP port and RTP port. SIP is used for signalling, RTP - for transmitting the voice. The latter one needs to be cut out on the router. Also determine your ATA's IP address. In this case, it is 192.168.0.99 and the RTP ports are 5004 and 5012.

iptables -A OUTPUT -d 192.168.0.99 -p udp –dport 5004 -j DROP
iptables -A OUTPUT -d 192.168.0.99 -p udp –dport 5012 -j DROP

If you don't run your own SIP switch (PBX), and you registered your ATA ports to a VoIP provider, just go to your home router settings and forward the two RTP ports determined earlier to a non existent address in your local network (eg. if your addresses are like 192.168.0.x, forward it to 192.168.0.250 - this address is most likely not in use. The voice data will just go nowhere).

Finally, to couple the lines permanently, add two capacitors of 470nF (160V min.) between Tip ends of each line and so with Ring ends. I soldered them to the PCB, but it can be done outside, attaching to the wires. Now the lines can dial as programmed in the ATA and the Asterisk server, hear progress tones and transmit modem signal just like on analog lines.

Coin line emulation

Old-style “dumb” phone (either 3-slot or single slot) works well with a regular line. However, if you need a full experience - ie. collecting & returning coins, you need a payphone controller. Several projects exist, either entirely electronic circuits or a box working with Asterisk scripts.
https://github.com/hharte/1dcoinctrl - unfinished coin line controller project to work with Asterisk, but also a good explanation on how the coin line works
https://github.com/jcs/payphone - interesting project, different approach. Works with DTF (dial tone first) phones. ATA autodials DISA feature on Asterisk on off-hook and Asterisk does the coin tone recognition.

pstn.txt · Last modified: 2024/02/22 16:50 by admin