B.13. BackgroundDetect()

Plays a sound file while listening for sound from the caller.
BackgroundDetect(soundfile[,silence[,min[,max]]])
Similar to Background(), but listens for sound also.
During playback of the sound file, the application monitors audio on the incoming audio channel. If it detects a sound longer than min milliseconds in duration but shorter than max milliseconds, followed by a period of silence of at least silence milliseconds, it stops playback and passes the call to the talk extension, if it exists.
If silence, min and max are not specified, the defaults are used: 1000 ms, 100 ms and unlimited, respectively.
Returns -1 on hangup, otherwise returns 0 (such as when playback is interrupted due to input).
exten => 123,1,BackgroundDetect(symphony)
exten => 123,n,Playback(vm-sorry)
exten => talk,1,Playback(yes-please)

Note

Internal help for this application in Asterisk 1.4:
  -= Info about application 'BackgroundDetect' =- 

[Synopsis]
Background a file with talk detect

[Description]
  BackgroundDetect(filename[|sil[|min|[max]]]):  Plays  back  a  given
filename, waiting for interruption from a given digit (the digit must
start the beginning of a valid extension, or it will be ignored).
During the playback of the file, audio is monitored in the receive
direction, and if a period of non-silence which is greater than 'min' ms
yet less than 'max' ms is followed by silence for at least 'sil' ms then
the audio playback is aborted and processing jumps to the 'talk' extension
if available.  If unspecified, sil, min, and max default to 1000, 100, and
infinity respectively.
diff output to internal help in Asterisk 1.2:
- none -