<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2172/18/9/_/styles/combined.css?spaceKey=AST&amp;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+11+Application_WaitForSilence">Asterisk 11 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="Asterisk11Application_WaitForSilence-WaitForSilence%28%29"></a>WaitForSilence()</h1>

<h3><a name="Asterisk11Application_WaitForSilence-Synopsis"></a>Synopsis</h3>

<p>Waits for a specified amount of silence.</p>
<h3><a name="Asterisk11Application_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 <tt>WAITSTATUS</tt> to one of these values:</p>
<ul>
        <li>WAITSTATUS
        <ul>
                <li>SILENCE - if exited with silence detected.</li>
                <li>TIMEOUT - if exited without silence detected after timeout.</li>
        </ul>
        </li>
</ul>


<h3><a name="Asterisk11Application_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="Asterisk11Application_WaitForSilence-Arguments"></a>Arguments</h5>


<ul>
        <li>silencerequired</li>
        <li>iterations - If not specified, defaults to <tt>1</tt>.</li>
        <li>timeout - Is specified only to avoid an infinite loop in cases where silence is never achieved.</li>
</ul>


<h3><a name="Asterisk11Application_WaitForSilence-SeeAlso"></a>See Also</h3>


<ul>
        <li><a href="/wiki/pages/createpage.action?spaceKey=AST&amp;title=Asterisk+11+Application_WaitForNoise&amp;linkCreation=true&amp;fromPageId=20187141" class="createlink">Asterisk 11 Application&#95;WaitForNoise</a></li>
</ul>


<h3><a name="Asterisk11Application_WaitForSilence-ImportVersion"></a>Import Version</h3>

<p>This documentation was imported from Asterisk Version SVN-trunk-r370322</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+11+Application_WaitForSilence">View Online</a>
              |
       <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_WaitForSilence?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>