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




<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.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers, David Lee and Matt Jordan.</div>
<div>By Kevin Harwell.</div>


<p style="color: grey;"><i>Updated Nov. 22, 2013, 10:52 a.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Fixed a small problem that occurred when trying to delete a device that was not in the cache.  Also made a change to the ari.make template to use the c_name.</pre>
  </td>
 </tr>
</table>





<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-22838">ASTERISK-22838</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;">Created a data model and implemented functionality for an ARI device state resource.  The following operations have been added that allow a user to manipulate an ARI controlled device:

PUT    /device-states/{deviceName}&{deviceState} - Create/Change the state of an ARI controlled device
GET    /device-states/{deviceName} - Retrieve the current state of a device
DELETE /device-states/{deviceName} - Destroy a device-state controlled by ARI

The ARI controlled device must begin with 'Stasis:'.  An example controlled device name would be Stasis:Example.

A 'DeviceStateChanged' event has also been added so that an application can subscribe and receive device change events.  Any device state, ARI controlled or not, can be subscribed to.

While adding the event, the underlying subscription control mechanism was refactored so that all current and future resource subscriptions would be the same.  Each event resource must now register itself in order to be able to properly handle [un]subscribes.</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;">Some basic testing done using the swagger framework and a websocket connection.  Testing adding, changing, and removing device state with regards to an ARI controlled device were successful.  Also tested [un]subscribing to the events from device with success.  Planning on writing some testsuite test cases as well.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>branches/12/rest-api/resources.json <span style="color: grey">(402993)</span></li>

 <li>branches/12/rest-api/api-docs/events.json <span style="color: grey">(402993)</span></li>

 <li>branches/12/rest-api/api-docs/deviceStates.json <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/rest-api/api-docs/applications.json <span style="color: grey">(402993)</span></li>

 <li>branches/12/rest-api-templates/ari.make.mustache <span style="color: grey">(402993)</span></li>

 <li>branches/12/res/stasis/app.c <span style="color: grey">(402993)</span></li>

 <li>branches/12/res/stasis/app.h <span style="color: grey">(402993)</span></li>

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

 <li>branches/12/res/res_stasis_device_state.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/res_stasis.c <span style="color: grey">(402993)</span></li>

 <li>branches/12/res/res_ari_device_states.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/ari/resource_device_states.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/ari/resource_device_states.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/ari/resource_applications.h <span style="color: grey">(402993)</span></li>

 <li>branches/12/res/ari/ari_model_validators.c <span style="color: grey">(402993)</span></li>

 <li>branches/12/res/ari/ari_model_validators.h <span style="color: grey">(402993)</span></li>

 <li>branches/12/res/ari.make <span style="color: grey">(402993)</span></li>

 <li>branches/12/main/devicestate.c <span style="color: grey">(402993)</span></li>

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

 <li>branches/12/include/asterisk/stasis_app.h <span style="color: grey">(402993)</span></li>

 <li>branches/12/include/asterisk/devicestate.h <span style="color: grey">(402993)</span></li>

</ul>

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







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




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