O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

BackgroundDetect() — Plays a file in the background and detects talking

Synopsis

    BackgroundDetect(filename[,sil[,min[,max]]])

Similar to Background(), but attempts to detect talking.

During the playback of the file, audio is monitored in the receive direction. If a period of non-silence that is greater than min milliseconds yet less than max milliseconds and is followed by silence for at least sil milliseconds occurs, the audio playback is aborted and processing jumps to the talk extension, if available.

If unspecified, sil, min, and max default to 1,000 ms, 100 ms, and infinity, respectively.

Returns -1 on hangup, and 0 on successful playback completion with no exit conditions.

               exten => 123,1,BackgroundDetect(tt-monkeys)
    exten => 123,2,Playback(im-sorry)
    exten => talk,1,Playback(yes-dear)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required