Telegraph equation describing the compression of electromagnetic waves in a waveguide (resonator) with moving boundary are derived. It is shown that the character of oscillations of the compressed electromagnetic field depends on the parameters of the resonator, and under certain conditions, the oscillations of voltage (current) yield the exponential growth, leading to a noticeable change in the radiation losses.