This application relates to a method, device, device and medium for detecting and processing line faults in an analog telephone system. The method preliminarily connects the telephone set to the analog chip of the voice gateway through the A line and the B line, and pre-sets the voltage of the A line to 0V, and the voltage of the B line is 0V. The voltage is ‑48V, the voltage of A line and B line is ‑48V; regularly detect the line voltage value between AB; when the detected voltage value between AB lines and the output voltage becomes 0V, it is judged as a ground fault of B line; when detected When the output voltage of the voltage value between the A and B lines becomes 0V, it will automatically control the polarity reversal of the A line and the B line, control the voltage of the A line to ‑48V, and the B line voltage to 0V, and automatically repair the fault. The invention can automatically repair the line failure of the analog telephone system and ensure normal communication. The operation is simple and convenient, manpower is saved, the efficiency of fault repair is improved, and the cost of fault repair is saved; and the implementation is easy and the reliability is high.