<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/en/2172/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+11+Application_ReadExten">Asterisk 11 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="Asterisk11Application_ReadExten-ReadExten%28%29"></a>ReadExten()</h1>
<h3><a name="Asterisk11Application_ReadExten-Synopsis"></a>Synopsis</h3>
<p>Read an extension into a variable.</p>
<h3><a name="Asterisk11Application_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>READEXTENSTATUS
        <ul>
                <li>OK - A valid extension exists in $
<div class="error"><span class="error">Unknown macro: {variable}</span> <p>.</p>
<ul>
        <li>
        <ul>
                <li>TIMEOUT - No extension was entered in the specified time. Also sets $</li>
        </ul>
        </li>
</ul>
</div>
<p> to "t".</p></li>
                <li>INVALID - An invalid extension, $
<div class="error"><span class="error">Unknown macro: {INVALID_EXTEN}</span> </div>
<p>, was entered. Also sets $</p>
<div class="error"><span class="error">Unknown macro: {variable}</span> </div>
<p> to "i".</p></li>
                <li>SKIP - Line was not up and the option 's' was specified.</li>
                <li>ERROR - Invalid arguments were passed.</li>
        </ul>
        </li>
</ul>
<h3><a name="Asterisk11Application_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="Asterisk11Application_ReadExten-Arguments"></a>Arguments</h5>
<ul>
        <li>variable</li>
        <li>filename - File to play before reading digits or tone with option <tt>i</tt></li>
        <li>context - Context in which to match extensions.</li>
        <li>option
        <ul>
                <li>s - Return immediately if the channel is not answered.</li>
                <li>i - 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>n - Read digits even if the channel is not answered.</li>
        </ul>
        </li>
        <li>timeout - 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="Asterisk11Application_ReadExten-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_ReadExten">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_ReadExten?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>