Supporting 12.5 Pulses Per Second with Loop Disconect Phones

Old rotary dial telephones emit pulses to dial numbers.
Normally there are 10 pulses per second with a 33 millisecond part and a 66 millisecond part for each pulse.

But some phones have rotary diallers that turn faster than normal (and emit 12.5 pulses per second) and some turn slower (and emit 8 pulses per second);

Asterisk, the DAHDI drivers and Digium (or clone) PCI cards with FXS slots can handle phones at 8 pulses per second and 10 pulses per second. But they failed with phones that emitted pulses to quickly.

This is because the dahdi driver (wctdm.c) only checks the ‘hook status’ (ie on-hook or off-hook) every 16 milliseconds and requires a minimum of 2 readings with the same hook status before issuing a Confirmed On-Hook or a Confirmed Off-Hook event to Asterisk.

So I modified the dahdi driver source code (wctdm.c) so that the Hook Status is checked every 8 milliseconds.

This allows dahdi to cope with faster pulse trains and our phone set to 12.5 pulses per second now works with the FXS port on the Dahdi PCI card.

This opens the door to support phones on the railway where the rotary dial mechanism rotates slightly faster than normal.

 

I’m just glad that we have the dahdi source code and could dig into the device driver source code to resolve this problem.