<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2049/">https://reviewboard.asterisk.org/r/2049/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/2049/diff/3/?file=30393#file30393line1218" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/main/xmldoc.c</a>
<span style="font-weight: normal;">
(Diff revision 3)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int xmldoc_parse_common_elements(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1218</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">return</span> <span class="p">(</span><span class="n">xmldoc_parse_para</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">tabs</span><span class="p">,</span> <span class="n">posttabs</span><span class="p">,</span> <span class="n">buffer</span><span class="p">)</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1219</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="o">||</span> <span class="n">xmldoc_parse_specialtags</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">tabs</span><span class="p">,</span> <span class="n">posttabs</span><span class="p">,</span> <span class="n">buffer</span><span class="p">)</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1220</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="o">||</span> <span class="n">xmldoc_parse_info</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">tabs</span><span class="p">,</span> <span class="n">posttabs</span><span class="p">,</span> <span class="n">buffer</span><span class="p">));</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This is just a styling preference and could be ignored:
Why indent more than one level on a line continuation?</pre>
</div>
<br />
<p>- rmudgett</p>
<br />
<p>On July 19th, 2012, 9:30 a.m., Matt Jordan wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers and rmudgett.</div>
<div>By Matt Jordan.</div>
<p style="color: grey;"><i>Updated July 19, 2012, 9:30 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">A number of applications/AMI commands in Asterisk have specific behavioral differences depending on the resource or channel technology those applications are executed on. For example, while the MessageSend application is technology agnostic, how the channel drivers that support the MessageSend application behave is dependent on those the protocols and the channel driver implementation. Prior to this patch, those details were either documented in the application/command documentation itself, or were left undocumented.
Documenting technology specific information with the items that use that information tends to be problematic for the following reasons:
1) Sometimes, the documentation more naturally belongs in the channel driver or resource that implements that technology, as opposed to the consumer that uses it.
2) There may be multiple consumers that produce the technology specific behavior. It is not always clear who should provide the documentation for a technology specific behavior when multiple applications/commands share that behavior. This leads to confusion between documented applications, or inconsistency. For example, many technology specific behaviors documented for the Dial application can also apply to the Originate manager command (and possible FollowMe or Queue as well).
This patch adds a new element to the documentation schema, <info/>. An info node is essentially a piece of technology specific reference information that can be included by any top level XML documentation node. For example, the MessageSend application has historically had a note describing how the SIP channel driver interprets the From: field:
<note>
<para>For SIP the from parameter can be a configured peer name
        or in the form of "display-name" &lt;URI&gt;.</para>
</note>
This information was replicated for the MessageSend AMI command. As the information is SIP specific information, it may be beneficial to document this information in chan_sip. As such, this can now be represented as an info node:
<info name="SIPMessageFromInfo" language="en_US" tech="SIP">
        <para>The <literal>from</literal> parameter can be a configured peer name
                or in the form of "display-name" &lt;URI&gt;.</para>
</info>
The MessageSend application/command can then reference this information using standard XInclude:
<xi:include xpointer="xpointer(/docs/info[@name='XMPPMessageToInfo'])" />
Note that while an application/command can use XInclude to pull the <info/> elements in, it is still possible to document the <info/> elements with the application/commands itself, as has been done historically.
An example of how this appears for the AMI command MessageSend is shown below. Note that technology specific information is given yellow markup in the CLI, in a manner similar to the <note/> elements.
*CLI> manager show command MessageSend
[Syntax]
Action: MessageSend
[ActionID:] <value>
To: <value>
[From:] <value>
[Body:] <value>
[Base64Body:] <value>
[Variable:] <value>
[Synopsis]
Send an out of call message to an endpoint.
[Description]
Not available
[Arguments]
ActionID
ActionID for this transaction. Will be returned.
To
The URI the message is to be sent to.
Technology: SIP
Specifying a prefix of 'sip:' will send the message as a
SIP MESSAGE request.
Technology: XMPP
Specifying a prefix of 'xmpp:' will send the message as an
XMPP chat message.
From
A From URI for the message if needed for the message technology being
used to send this message.
Technology: SIP
The 'from' parameter can be a configured peer name or in
the form of "display-name" <URI>.
Body
The message body text. This must not contain any newlines as that
conflicts with the AMI protocol.
Base64Body
Text bodies requiring the use of newlines have to be base64 encoded
in this field. Base64Body will be decoded before being sent out.
Base64Body takes precedence over Body.
Variable
Message variable to set, multiple Variable: headers are allowed.
The header value is a comma separated list of name=value pairs.
[See Also]
Not available
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/channels/chan_sip.c <span style="color: grey">(370240)</span></li>
<li>/trunk/doc/appdocsxml.dtd <span style="color: grey">(370240)</span></li>
<li>/trunk/main/message.c <span style="color: grey">(370240)</span></li>
<li>/trunk/main/xmldoc.c <span style="color: grey">(370240)</span></li>
<li>/trunk/res/res_xmpp.c <span style="color: grey">(370240)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2049/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>