[asterisk-dev] API call to wait for a specific tone?

Nic Bellamy nicb-lists at vadacom.co.nz
Mon Aug 27 17:36:21 CDT 2007


Bryan Field-Elliot wrote:
> We need to write an Asterisk module which, among other things, needs 
> to wait for a specific tone and then continue. For example, "Wait for 
> a 2000hz tone lasting 1 second", and "timeout if the tone isn't heard 
> within 30 seconds".
>
> Does such an API call exist? Or any modules which do this?
No API that I'm aware of (although parts of dsp.c are close to what you 
want), but you could do it through either (a) an EAGI script that does 
DSP on the incoming audio stream to detect the tone (a simple Goertzal 
detector should do the job), or (b) by doing the same thing but in a 
custom dialplan application.

I did something quite similar a while ago, as a dialplan application, to 
detect and report on the level of a 1Khz tone to help with tuning the 
gain on FXO interfaces.

Cheers,
    Nic.

-- 
Nic Bellamy,
Head Of Engineering, Vadacom Ltd - http://www.vadacom.co.nz/




More information about the asterisk-dev mailing list