This page was translated from Japanese by machine translation. The Japanese page is the original.

Connecting Phone and Fax to a Server

Illustration showing a modem connected to a line coming out of a telephone, then connected via USB to a server. The line is marked 47 V

We tried connecting the phone and fax machine in our small office to an Ubuntu server running on an ordinary PC. It is just a combination of small, off-the-shelf devices and a classic fax software package, but once we actually tried it, quite a few things only became clear after hooking everything up.

Our biggest lesson was that rebooting the server left the phone busy for an entire day. We have gathered what we learned here, hoping it might help anyone who wants to try doing the same thing.

A quick safety request regarding phone lines first. Telephone lines carry tens of volts of electricity even while nobody is using them (the value measured on this page was about 46–47 V). During ringing, even higher AC voltage is applied (estimated). Please keep any reconnecting strictly to plugging and unplugging modular jacks, and do not touch the metal contacts inside the wiring. Work such as in-wall wiring requires certification (an installation technician qualification in Japan). For equipment connected to the line, please use devices that carry marks certifying compliance with technical standards (such as the Giteki mark in Japan).

What We Wanted to Achieve

  1. When an incoming call arrives, automatically log who called and when.
  2. Receive and send faxes through the server instead of on paper. Received faxes can be read as PDFs, and faxes can be sent from a PC.
  3. When you click "Call" on a PC screen, make the office telephone dial out to the recipient.

What We Used

All of them are commercially available products costing from a few thousand yen to around the 10,000-yen range (prices are estimated).

How Everything Is Connected

Connection diagram. From the fiber-optic line into the home gateway. TEL1 passes through the caller ID adapter and splits between the telephone and the modem for making calls. TEL2 goes to the modem for faxing. The adapter and both modems connect to the server via USB

Solid lines are telephone lines, and dashed lines are USB cables. On the TEL1 line, the telephone and the "dialing" modem are connected in parallel.

What We Learned

To show the number, you need a line subscription

When we first connected the caller ID adapter, nothing showed up at all. Looking closely, the office telephone itself had never displayed caller numbers either. When we checked, our line did not have a subscription for the Caller ID service (Number Display). Once we added the subscription, we were able to read the incoming caller's number.

Having two identical modems makes them harder to tell apart

Both modems are the same model, and even their serial numbers were identical. Linux assigns names (ttyACM0, ttyACM1) in the order it discovers devices, so there is a risk they could swap places on every reboot. Therefore, we wrote rules (udev rules) to distinguish them by the USB port they are plugged into, ensuring the fax modem and dialing modem always get the exact same names.

When calling from a PC, pick up the handset first

We set things up so the modem dials the number, and you talk on the telephone. At first, we tried the order "modem dials the number → pick up the handset once ringing starts," but the call disconnected the moment the modem released the line. While the modem is holding the line, it seems a telephone picked up afterward cannot seize it.

So, we reversed the order.

  1. First, pick up the handset on the telephone.
  2. Click "Call" on the PC. The modem dials the number.
  3. Once dialing finishes, the modem immediately releases the line. From there, you can talk normally on the telephone.

We also learned the following:

Line voltage tells you the state of the line

This modem has a command to read the telephone line voltage (AT-TRV). Being able to read it without seizing the line was very handy. Here are the values we measured on our office line.

Line voltage scale. About 5.6 V while the modem is holding the line, about 7 V when the handset is off the hook, and about 46–47 V when nobody is using it

Telephone line voltage (measured values)
Line stateVoltage
Nobody using it (handset on the hook)Approx. 46–47 V
Handset is off the hookApprox. 7 V
Modem keeps holding the line (more on this below)Approx. 5.6 V

Using this, we set it up so that "if the handset isn't off the hook, don't dial the number." This is to follow the order mentioned above, where the handset must be picked up first.

After a reboot, the phone was busy for a whole day

This was our biggest takeaway.

So, we fixed it as follows:

  1. Every time the dialing tool starts up, it sends the "hang up" command to the modem. After a reboot, it now always starts in a state where it is disconnected from the line.
  2. It reads the line voltage every 5 minutes. If it's low, it first sends the "hang up" command and reads the voltage again. If the voltage recovers, it means the modem had been holding the line, so it alerts our smartphone. If it doesn't recover, another phone is in use, so it only alerts us if that lasts longer than 60 minutes (such as a forgotten off-hook handset).
  3. The "hang up" command only disconnects that specific modem, so it doesn't cut off calls on other phones. There is no problem sending it every 5 minutes.

The fax modem also answers incoming phone calls

To check if the fax line was working, we tried calling the fax number from a mobile phone. The modem answered with a high-pitched beep, waited about 40 seconds (measured at 43 seconds) for a fax tone from the other end, then hung up on its own and returned to standby.

Summary

Comments

No comments yet.

Comments with links, phone numbers or email addresses appear after the site approves them.

Sending needs JavaScript in your browser.

QR code for this page

https://robo100.jp/en/000031