Skip to main content

Module dtmf

Module dtmf 

Source
Expand description

In-band DTMF: keypad tones found in the call audio itself.

Carriers deliver keypresses in two ways. Out of band, as RFC 4733 telephone-events or a platform’s dtmf message; those are handled by the SIP and Twilio bridges. Or in band, as the dual tones themselves inside the audio: a SIP trunk without telephone-events, a transferred call, or a caller pressing keys while the platform forwards raw media.

DtmfDetector finds in-band tones with the Goertzel algorithm over the eight DTMF frequencies, in blocks of 25.6 ms (205 samples at 8 kHz), with the checks ITU-T Q.24 receivers use: both a row and a column tone must be strong, dominate their groups, sit within 8 dB of each other, and carry most of the block’s energy, which is what keeps speech and music from registering as digits.

Structs§

DtmfDetector
Streaming in-band DTMF detector. See the module docs.