<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/4101/">https://reviewboard.asterisk.org/r/4101/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On November 5th, 2014, 5:43 p.m. UTC, <b>Joshua Colp</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;">Matt brought it up that this is actually a backwards incompatible change - specifically changing priority into a string from an integer. What about having label as a separate argument that is optional? If present it's treated as a label and if not then the priority is used as normal. This allows labels to be used with no backwards incompatible changes and also makes it a bit more explicit from a developer side of what they want.</pre>
</blockquote>
<p>On November 6th, 2014, 2:18 p.m. UTC, <b>greenfieldtech</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;">Wow, that was actually my initial idea almost 4 weeks ago - the only issue was that I was feeling it was truly unclean. If you look into Asterisk docs, priority and labels and normally mixed. For example, if you use Goto in dialplan - you can do Goto(context,exten,priority) or Goto(context,exten,label). I personally feel it should work exactly the same, I see no point in having two methodologies. In addition, what should be used if both are defined? which has the stronger priority here? I feel this will also bring much confusion into the mix. Again, I can easily revert my original code work, but in my opinion it is very much confusing.
Anyone else would like to share their thought?</pre>
</blockquote>
<p>On November 6th, 2014, 8:30 p.m. UTC, <b>Scott Griepentrog</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 it would be easier to include this patch if it did not alter the existing API, only add an additional optional field.
</pre>
</blockquote>
<p>On November 13th, 2014, 11:24 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;">This is one of those cases where - unfortunately - changing the type of the field would break existing clients and libraries.
For example, if I were using Python and wanted to pass a priority into an origination, I might use the following:
channels.originate(endpoint='PJSIP/bob', context='default', extension='1000', priority=1)
That's different than:
channels.originate(endpoint='PJSIP/bob', context='default', extension='1000', priority='1')
I don't think we can change the type of the field without having to bump the ARI version to 2.0. That means using a different field, as was originally proposed.
I do think that if we bump the major version to 2.x, this needs to be merged with the existing priority field. I've got a wiki page started for these kinds of things:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+API+Improvements</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ok, so let's agree on the functionality:
adding a new argument called "label". If present in the REST request, will take precedence to the priority argument - and will be used.
If not defined, the "priority" argument will be used.
I can accept the idea of breaking the existing API as a consideration. If we can agree on the above, I'll work on the patch to do that.
</pre>
<br />
<p>- greenfieldtech</p>
<br />
<p>On November 5th, 2014, 2:16 p.m. UTC, greenfieldtech 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.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By greenfieldtech.</div>
<p style="color: grey;"><i>Updated Nov. 5, 2014, 2:16 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-24412">ASTERISK-24412</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;">This patch changes the current behavior of ARI, to allow channel originate/continue requests to be performed with labels as the priority, not only integer values.</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;">Testing was performed by testing the following scenarios:
1. Originating a call to a numeric priority - works
2. Originating a call to a null priority - works
3. Originating a call to a label - works
4. Continue a call to a label - not tested yet</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/rest-api/api-docs/channels.json <span style="color: grey">(425359)</span></li>
<li>/trunk/res/res_ari_channels.c <span style="color: grey">(425359)</span></li>
<li>/trunk/res/ari/resource_channels.c <span style="color: grey">(425359)</span></li>
<li>/trunk/res/ari/resource_channels.h <span style="color: grey">(425359)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/4101/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>