<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/2042/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/Objects">Objects</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~lmadsen">Leif Madsen</a>
</h4>
<div id="versionComment">
<b>Comment:</b>
Spacing.<br />
</div>
<br/>
<h4>Changes (8)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-unchanged" >Some Asterisk configuration files also create objects. The syntax for objects is slightly different than for settings. To create an object, you specify the type of object, an arrow formed by the equals sign and a greater-than sign (=>), and the settings for that object. <br>{code}[section-name] <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">some_object=>settings{code} <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">some_object => settings{code} <br></td></tr>
<tr><td class="diff-unchanged" >{tip}Confused by Object Syntax? <br>In order to make life easier for newcomers to the Asterisk configuration files, the developers have made it so that you can also create objects with an equal sign. Thus, the two lines below are functionally equivalent. <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" > <br>{noformat} <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">some_object=>settings <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">some_object => settings <br></td></tr>
<tr><td class="diff-unchanged" >some_object=settings <br>{noformat} <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >label1=value1 <br>label2=value2 <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">object1=>name1 <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">object1 => name1 <br></td></tr>
<tr><td class="diff-unchanged" > <br>label1=value0 <br>label3=value3 <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">object2=>name2{code} <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">object2 => name2{code} <br></td></tr>
<tr><td class="diff-unchanged" >In this example, *object1* inherits both *label1* and *label2*. It is important to note that *object2* also inherits *label2*, along with *label1* (with the new overridden value *value0*) and *label3*. <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<p>Some Asterisk configuration files also create objects. The syntax for objects is slightly different than for settings. To create an object, you specify the type of object, an arrow formed by the equals sign and a greater-than sign (=>), and the settings for that object.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: java; gutter: false"><![CDATA[[section-name]
some_object => settings]]></script>
</div></div>
<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Confused by Object Syntax?<br/>
In order to make life easier for newcomers to the Asterisk configuration files, the developers have made it so that you can also create objects with an equal sign. Thus, the two lines below are functionally equivalent.
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>some_object => settings
some_object=settings
</pre>
</div></div>
<p>It is common to see both versions of the syntax, especially in online Asterisk documentation and examples. This book, however, will denote objects by using the arrow instead of the equals sign.</p></td></tr></table></div>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: javascript; gutter: false"><![CDATA[[section-name]
label1=value1
label2=value2
object1 => name1
label1=value0
label3=value3
object2 => name2]]></script>
</div></div>
<p>In this example, <b>object1</b> inherits both <b>label1</b> and <b>label2</b>. It is important to note that <b>object2</b> also inherits <b>label2</b>, along with <b>label1</b> (with the new overridden value <b>value0</b>) and <b>label3</b>.</p>
<p>In short, objects inherit all the settings defined above them in the current section, and later settings override earlier settings.</p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;">
<a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/Objects">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=4817451&revisedVersion=7&originalVersion=6">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Objects?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>