<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/2492/">https://reviewboard.asterisk.org/r/2492/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On May 6th, 2013, 1:48 p.m. UTC, <b>Matt Jordan</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<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/2492/diff/1/?file=37116#file37116line123" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/main/stasis_endpoints.c</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <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">123</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">        </span><span class="kt">int</span> <span class="n">v</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I don&#39;t care for variables that are a single character that are not used as a counter in a loop - and it doesn&#39;t appear like &#39;v&#39; is really needed either, as the return value of ast_json_object_set/ast_json_array_append could be checked directly.</pre>
 </blockquote>



 <p>On May 6th, 2013, 9:42 p.m. UTC, <b>David Lee</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I agree that v was a poor choice in naming, but I dislike both multi-line if clauses and lines extending too far past 80 columns. Introducing the extra variable alleviates both.</pre>
 </blockquote>





 <p>On May 6th, 2013, 10:17 p.m. UTC, <b>Matt Jordan</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Our line length is 90 columns :-)

https://wiki.asterisk.org/wiki/display/AST/Coding+Guidelines#CodingGuidelines-Codeformatting</pre>
 </blockquote>





 <p>On May 7th, 2013, 1:26 p.m. UTC, <b>David Lee</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">And none of my lines exceed 90 columns :-P</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">No, but it does mean you don&#39;t have to limit yourself to a single character variable in order to not exceed 80 columns. You have another 10 characters to use!</pre>
<br />




<p>- Matt</p>


<br />
<p>On May 6th, 2013, 9:48 p.m. UTC, David Lee wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/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.</div>
<div>By David Lee.</div>


<p style="color: grey;"><i>Updated May 6, 2013, 9:48 p.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-21421">ASTERISK-21421</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<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;">An endpoint is an external device/system that may offer/accept
channels to/from Asterisk. While this is a very useful concept for end
users, it is surprisingly not a core concept within Asterisk itself.

This patch defines ast_endpoint as a separate object, which channel
drivers may use to expose their concept of an endpoint. As the channel
driver creates channels, it can use ast_endpoint_add_channel() to
associate channels to the endpoint. This updated the endpoint
appropriately, and forwards all of the channel&#39;s events to the
endpoint&#39;s topic.

In order to avoid excessive locking on the endpoint object itself, the
mutable state is not accessible via getters. Instead, you can create a
snapshot using ast_endpoint_snapshot_create() to get a consistent
snapshot of the internal state.

This patch also includes a set of topics and messages associated with
endpoints, and implementations of the endpoint-related RESTful
API. chan_sip was updated to create endpoints with SIP peers, but the
state of the endpoints is not updated with the state of the peer.

Along for the ride in this patch is a Stasis test API. This is a
stasis_message_sink object, which can be subscribed to a Stasis
topic. It has functions for blocking while waiting for conditions in
the message sink to be fulfilled.

(closes issue ASTERISK-21421)
Review: https://reviewboard.asterisk.org/r/2492/</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">Unit tests!</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">(387290)</span></li>

 <li>/trunk/channels/sip/include/sip.h <span style="color: grey">(387290)</span></li>

 <li>/trunk/include/asterisk/astobj2.h <span style="color: grey">(387290)</span></li>

 <li>/trunk/include/asterisk/endpoints.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/include/asterisk/stasis.h <span style="color: grey">(387290)</span></li>

 <li>/trunk/include/asterisk/stasis_endpoints.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/include/asterisk/stasis_test.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/main/asterisk.c <span style="color: grey">(387290)</span></li>

 <li>/trunk/main/astobj2.c <span style="color: grey">(387290)</span></li>

 <li>/trunk/main/channel_internal_api.c <span style="color: grey">(387290)</span></li>

 <li>/trunk/main/endpoints.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/main/stasis_cache.c <span style="color: grey">(387290)</span></li>

 <li>/trunk/main/stasis_endpoints.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/res/res_stasis_http_endpoints.c <span style="color: grey">(387290)</span></li>

 <li>/trunk/res/res_stasis_test.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/res/res_stasis_test.exports.in <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/res/stasis_http/resource_endpoints.h <span style="color: grey">(387290)</span></li>

 <li>/trunk/res/stasis_http/resource_endpoints.c <span style="color: grey">(387290)</span></li>

 <li>/trunk/rest-api/api-docs/endpoints.json <span style="color: grey">(387290)</span></li>

 <li>/trunk/tests/test_endpoints.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/tests/test_stasis_endpoints.c <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/2492/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>