Page tree
Skip to end of metadata
Go to start of metadata

About

About text.

 Click here to expand Table of Contents

Usage

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:

FieldDescriptionExamples
keyName of the tone (user defined)busy, fax, mytone
freqsFrequencies to "listen" for425 - 480,620
flagsWhich direction to sniff the tones in (r = read (default), w = write)r
timeoutWindow 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)
appOptional. Application to call when the tone detect conditions are mettransfer, hangup
appdataOptional. Argument to the application specified above

'1000 XML default' , 'normal_clearing'

hitsNumber of hits needed before calling app/appdata (useful to avoid false positives) 

Notes:

  • 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: 

Variables

execute_on_tone_detect

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.

tone_detect_hits

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.

Comments

Some of the advanced knowledge about tone_detect is actually found in this nice little IRC exchange with anthm and MikeJ.

Samples

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".

See Also

stop_tone_detect

mod_spandsp Call Progress