主权项 |
1. A method for a telephone to detect dial tone on a telephone line, the method comprising:
detecting, at a telephone, that the telephone caused an off-hook condition on a telephone line associated with the telephone; taking, at the telephone, a predetermined number of samples of incoming audio from a telephone exchange on the telephone line with each sample having a predetermined length; determining, at the telephone, volumes of the samples, the determining of the volumes of the samples including, for each of the samples:
measuring volumes of the sample at discrete time intervals in the sample;normalizing the measured volumes to a 0-to-1 scale;squaring each of the normalized volumes;adding the squared volumes together to arrive at a sum;dividing the sum by a number of discrete time intervals in the sample to arrive at a quotient;taking the log base 10 of the quotient to arrive at a first answer; andmultiplying the first answer by 20 to arrive at the volume of the sample; determining, at the telephone, whether the volumes of a threshold number of the samples are at or above a threshold volume; and in response to determining, at the telephone, that the volumes of a threshold number of the samples are at or above a threshold volume, determining, at the telephone, that the incoming audio on the telephone line includes a dial tone. |