<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/en/2160/1/7/_/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/Dialplan+to+Lua+Reference">Dialplan to Lua Reference</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~mnicholson">Matthew Nicholson</a>
</h4>
<br/>
<h4>Changes (1)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-unchanged" >Below is a quick reference that can be used to translate traditional {{extensions.conf}} dialplan concepts to their analog in {{extensions.lua}}. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h2. Extension Patterns <br> <br>h2. Context Includes <br>{section} <br>{column:width=50%} <br>{panel} <br> <br>h2. extensions.conf <br> <br>{code} <br>[users] <br>exten => 100,1,Noop <br>exten => 100,n,Dial("SIP/100") <br> <br>[demo] <br>exten => s,1,Noop <br>exten => s,n,Playback(demo-congrats) <br> <br>[default] <br>include => demo <br>include => users <br> <br>{code} <br>{panel} <br>{column} <br> <br> <br>{column:width=50%} <br>{panel} <br> <br>h2. extensions.lua <br> <br>{code} <br>extensions = { <br> users = { <br> [100] = function() <br> app.dial("SIP/100") <br> end; <br> }; <br> <br> demo = { <br> ["s"] = function() <br> app.playback(demo-congrats) <br> end; <br> }; <br> <br> default = { <br> include = {"demo", "users"}; <br> }; <br>{code} <br>{panel} <br>{column} <br>{section} <br> <br>h2. Loops <br> <br>h2. Macros <br> <br>h2. Goto <br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<p>Below is a quick reference that can be used to translate traditional <tt>extensions.conf</tt> dialplan concepts to their analog in <tt>extensions.lua</tt>.</p>
<h2><a name="DialplantoLuaReference-ExtensionPatterns"></a>Extension Patterns</h2>
<h2><a name="DialplantoLuaReference-ContextIncludes"></a>Context Includes</h2>
<table class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><tbody><tr>
<td class="confluenceTd" valign="top" width="50%">
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<h2><a name="DialplantoLuaReference-extensions.conf"></a>extensions.conf</h2>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false">[users]
exten => 100,1,Noop
exten => 100,n,Dial("SIP/100")
[demo]
exten => s,1,Noop
exten => s,n,Playback(demo-congrats)
[default]
include => demo
include => users</pre>
</div></div>
</div></div></td>
<td class="confluenceTd" valign="top" width="50%">
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<h2><a name="DialplantoLuaReference-extensions.lua"></a>extensions.lua</h2>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false">extensions = {
users = {
[100] = function()
app.dial("SIP/100")
end;
};
demo = {
["s"] = function()
app.playback(demo-congrats)
end;
};
default = {
include = {"demo", "users"};
};</pre>
</div></div>
</div></div></td></tr></tbody></table>
<h2><a name="DialplantoLuaReference-Loops"></a>Loops</h2>
<h2><a name="DialplantoLuaReference-Macros"></a>Macros</h2>
<h2><a name="DialplantoLuaReference-Goto"></a>Goto</h2>
</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/Dialplan+to+Lua+Reference">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=16548022&revisedVersion=3&originalVersion=2">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Dialplan+to+Lua+Reference?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>