<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/en/2171/18/9/_/styles/combined.css?spaceKey=AST&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_WaitForSilence">Asterisk 10 Application_WaitForSilence</a></h2>
<h4>Page <b>added</b> by <a href="https://wiki.asterisk.org/wiki/display/~wikibot">Wiki Bot</a>
</h4>
<br/>
<div class="notificationGreySide">
<h1><a name="Asterisk10Application_WaitForSilence-WaitForSilence%28%29"></a>WaitForSilence()</h1>
<h3><a name="Asterisk10Application_WaitForSilence-Synopsis"></a>Synopsis</h3>
<p>Waits for a specified amount of silence.</p>
<h3><a name="Asterisk10Application_WaitForSilence-Description"></a>Description</h3>
<p>Waits for up to <em>silencerequired</em> milliseconds of silence, <em>iterations</em> times. An optional <em>timeout</em> specified the number of seconds to return after, even if we do not receive the specified amount of silence. Use <em>timeout</em> with caution, as it may defeat the purpose of this application, which is to wait indefinitely until silence is detected on the line. This is particularly useful for reverse-911-type call broadcast applications where you need to wait for an answering machine to complete its spiel before playing a message. </p>
<p>Typically you will want to include two or more calls to WaitForSilence when dealing with an answering machine; first waiting for the spiel to finish, then waiting for the beep, etc. </p>
<p>Examples: </p>
<p>WaitForSilence(500,2) will wait for 1/2 second of silence, twice </p>
<p>WaitForSilence(1000) will wait for 1 second of silence, once </p>
<p>WaitForSilence(300,3,10) will wait for 300ms silence, 3 times, and returns after 10 sec, even if silence is not detected </p>
<p>Sets the channel variable Sets the channel variable <tt>None</tt> - <tt>WAITSTATUS</tt> to one of these values: </p>
<ul>
        <li><tt>WAITSTATUS</tt> -
        <ul>
                <li><tt>SILENCE</tt> - if exited with silence detected.</li>
                <li><tt>TIMEOUT</tt> - if exited without silence detected after timeout.</li>
        </ul>
        </li>
</ul>
<h3><a name="Asterisk10Application_WaitForSilence-Syntax"></a>Syntax</h3>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>WaitForSilence(silencerequired[,iterations[,timeout]])</pre>
</div></div>
<h5><a name="Asterisk10Application_WaitForSilence-Arguments"></a>Arguments</h5>
<ul>
        <li><tt>silencerequired</tt></li>
        <li><tt>iterations</tt> - If not specified, defaults to <tt>1</tt>.</li>
        <li><tt>timeout</tt> - Is specified only to avoid an infinite loop in cases where silence is never achieved.</li>
</ul>
<h3><a name="Asterisk10Application_WaitForSilence-SeeAlso"></a>See Also</h3>
<p><a href="/wiki/pages/createpage.action?spaceKey=AST&title=Asterisk+10+Application_WaitForNoise&linkCreation=true&fromPageId=19005819" class="createlink">Asterisk 10 Application_WaitForNoise</a></p>
<h3><a name="Asterisk10Application_WaitForSilence-ImportVersion"></a>Import Version</h3>
<p>This documentation was imported from Asterisk version SVN-branch-10-r340810.</p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;" class="grey">
<a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
<span style="padding: 0px 5px;">|</span>
<a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_WaitForSilence">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_WaitForSilence?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>