<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2171/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+10+Application_ReadExten">Asterisk 10 Application_ReadExten</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_ReadExten-ReadExten%28%29"></a>ReadExten()</h1>

<h3><a name="Asterisk10Application_ReadExten-Synopsis"></a>Synopsis</h3>
<p>Read an extension into a variable.</p>

<h3><a name="Asterisk10Application_ReadExten-Description"></a>Description</h3>
<p>Reads a <tt>#</tt> terminated string of digits from the user into the given variable. </p>

<p>Will set READEXTENSTATUS on exit with one of the following statuses: </p>
<ul>
        <li><tt>READEXTENSTATUS</tt> -
        <ul>
                <li><tt>OK</tt> - A valid extension exists in ${variable}.</li>
                <li><tt>TIMEOUT</tt> - No extension was entered in the specified time. Also sets ${variable} to "t".</li>
                <li><tt>INVALID</tt> - An invalid extension, ${INVALID_EXTEN}, was entered. Also sets ${variable} to "i".</li>
                <li><tt>SKIP</tt> - Line was not up and the option 's' was specified.</li>
                <li><tt>ERROR</tt> - Invalid arguments were passed.</li>
        </ul>
        </li>
</ul>


<h3><a name="Asterisk10Application_ReadExten-Syntax"></a>Syntax</h3>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>ReadExten(variable[,filename[,context[,option[,timeout]]]])</pre>
</div></div>

<h5><a name="Asterisk10Application_ReadExten-Arguments"></a>Arguments</h5>

<ul>
        <li><tt>variable</tt></li>
        <li><tt>filename</tt> - File to play before reading digits or tone with option <tt>i</tt></li>
        <li><tt>context</tt> - Context in which to match extensions.</li>
        <li><tt>option</tt>
        <ul>
                <li><tt>s</tt> - Return immediately if the channel is not answered.</li>
                <li><tt>i</tt> - Play <em>filename</em> as an indication tone from your <tt>indications.conf</tt> or a directly specified list of frequencies and durations.</li>
                <li><tt>n</tt> - Read digits even if the channel is not answered.</li>
        </ul>
        </li>
        <li><tt>timeout</tt> - An integer number of seconds to wait for a digit response. If greater than <tt>0</tt>, that value will override the default timeout.</li>
</ul>



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



<h3><a name="Asterisk10Application_ReadExten-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_ReadExten">View Online</a>
              |
       <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_ReadExten?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>