[Home]

Summary:ASTERISK-02431: [new app] WaitForSilence application
Reporter:davetroy (davetroy)Labels:
Date Opened:2004-09-19 11:51:58Date Closed:2008-01-15 15:14:52.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_waitforsilence.c
( 1) app_waitforsilence.c
Description:This app was put together so as to be able to deal with answering machines when making outbound calls.  The idea is that you probably don't want to start playing your soundfile until there has been a given amount of silence.

Here is a simple implementation; note that it can be called repeatedly to deal with cadences of different situations:

Exten => 7001,1,WaitForSilence(200,7)
Exten => 7001,2,WaitForSilence(700,1)
Exten => 7001,3,Playback,outboundmsg
Exten => 7001,4,Hangup

This in (1) waits for silence 200ms, 7 times (1.4 seconds).  Then upon that being done, it waits for silence 700ms once.

This deals with the possibility of multiple short periods of silence occuring within or before an answering machine message (200 x 7 instances), and then waits for 700ms of silence to be SURE that the remote side really is ready for you to talk.  This essentially emulates human behavior when calling an answering machine, and in my tests, this configuration works very well.

This code is based on *'s internal DSP functions.  It should be ready for inclusion in the CVS head.  Just edit apps/Makefile to include app_waitforsilence.c in app list.

This app can be used for good or for evil; please use only for good.
Comments:By: Brian West (bkw918) 2004-09-19 12:11:00

Please review doc/CODING-GUIDELINES

By: Mark Spencer (markster) 2004-09-19 13:20:24

Have you seen BackgroundDetect application?

By: davetroy (davetroy) 2004-09-19 16:37:16

Brian -- assume you are referring to the use of C++ // comments primarily; I had not seen that document til now and can make that change easily enough.

Mark -- I had not seen BackgroundDetect app til now.  While this provides similar functionality to that, I don't think it's duplicative.  The ability to detect multiple sets of silence seems to provide good results in a variety of circumstances.  Perhaps some merging of the logic of these two apps is in order.  Thoughts?

By: Brian West (bkw918) 2004-09-24 07:00:09

I think taking the best of both would be something that would rock.  We just end up with a better more flexable app in the end.  Dave I kinda figured that you didn't see those guidelines they were added in the past few months to help keep the code clean and readable. :P

bkw

By: davetroy (davetroy) 2004-09-24 14:50:02

OK, this should be corrected and ready to go -- done here at Astricon during
the SIP breakout. Yes, I have a disclaimer on file. :)

I will review BackgroundDetect; for now I think these serve unique purposes.

Good show guys!  See you in Boston?

By: twisted (twisted) 2004-10-27 15:47:45

Need a status update.  It's been little over a month since this was last touched.

--Housekeeping

By: davetroy (davetroy) 2004-10-28 14:01:46

Been using this for some time without incident; no further changes to report.  Should be good to go.

By: twisted (twisted) 2004-11-14 21:33:28.000-0600

still going okay here?

Markster, any ideas on if this will go in or not?  I'd like to see something happen one way or the other..

By: Mark Spencer (markster) 2004-11-24 00:02:22.000-0600

Added to CVS with modifications.

By: Russell Bryant (russell) 2004-11-25 13:20:38.000-0600

not in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:14:52.000-0600

Repository: asterisk
Revision: 4329

U   trunk/apps/Makefile
A   trunk/apps/app_waitforsilence.c

------------------------------------------------------------------------
r4329 | markster | 2008-01-15 15:14:52 -0600 (Tue, 15 Jan 2008) | 2 lines

Add WaitForSilence application (bug ASTERISK-2431)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4329