If you are trying to detect fax tones, using mod_spandsp spandsp_start_fax_detect is recommended.
Updated, preferred behavior:
This method will execute the application immediately. If you actually like to run the app async on the media stream specify this:
Older, still working behavior:
|key||Name of the tone (user defined)||busy, fax, mytone|
|freqs||Frequencies to "listen" for||425 - 480,620|
|flags||Which direction to sniff the tones in (r = read (default), w = write)||r|
|timeout||Window of time to listen for the tones in (0 = forever, +<milliseconds> = milliseconds relative to the time tone_detect is called (now), = time in "epoch" (ie. seconds since January 1, 1970))||+2000 (2 seconds) or 1227132612 (absolute example)|
|app||Optional. Application to call when the tone detect conditions are met||transfer, hangup|
|appdata||Optional. Argument to the application specified above|
'1000 XML default' , 'normal_clearing'
|hits||Number of hits needed before calling app/appdata (useful to avoid false positives)|
Once tone_detect is triggered, it won't be triggered again ''unless'' you have specified the "hits" argument in which case it will only get triggered once the "hits" count has been reached
- Only "key" and "frequencies" are required (the rest are optional)
- If you want to catch the DETECTED_TONE event with the channel-uuid use something like this:
Specifies the application and arguments to be executed when the tone_detect application gets a positive detection. This represents the new, preferred behavior for using tone_detect. However, the older method will still work.
Specifies the number of "hits" that the tone_detect app needs to see before considering a positive detection. This represents the new, preferred behavior for using tone_detect. However, the older method will still work.
Some of the advanced knowledge about tone_detect is actually found in this nice little IRC exchange with anthm and MikeJ.
Detect the fax tone and receive a fax with mod_spandsp.
Detect the fax tone and receive a fax with socket2me.
Detect an inband busy signal and send a real busy message.
Detect some SIT tones:
Detect 3 consecutive busy tones any time during a call and hangup when detected.
How to use tone_detect and originate for automatic test calls to detect missing or corrupt audio.
On B side of the call simply answer the call and do echo loopback. The A side of the call like below. Control is done by external script that does "originate", "show calls", "uuid_kill" and "uuid_dump". You can even make your script collect tcpdump for you based on IP:port from "uuid_dump".