<div dir="ltr"><div class="gmail_default" style="color:rgb(102,0,0)">If you want to add the label option, my first thought would be to recommend you look at the implementation of ​app GoTo() for the api to lookup/specify a label.  Then you would need to modify the channels.json in rest_api/api-docs to specify the new/different parameters to the rest methods, do a make ari-stubs to rebuild the rest handlers, and finally make the change to the method implementation in res/ari/resource_channels.c.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 9, 2014 at 4:56 AM, Nir Simionovich <span dir="ltr"><<a href="mailto:nir.simionovich@gmail.com" target="_blank">nir.simionovich@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">"Forgive me father for I have sinned, it has been over 25 years since I've used GWBasic/Basica - please spare thy humble servant from doom, as I repent my sins and go back in time 25 years" :-) <div><br></div><div>Now seriously, this may work nicely for classic dialplan, but for AEL that's a no go - don't even want to think about LUA at this point. </div><div><br></div><div>Any prospects in regards to this development? I've hadn't ever dug into this part of the code, but, how does Asterisk keep the dialplan in memory? is it a simple data structure? how do labels are manifested in that data structure? </div><div><br></div><div>Point me in the right direction for the information (apart from the code itself) - and I'll have a look at it.</div><div><br></div><div>Nir S</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 8, 2014 at 9:01 PM, Scott Griepentrog <span dir="ltr"><<a href="mailto:sgriepentrog@digium.com" target="_blank">sgriepentrog@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="color:#660000">The only two ARI methods I'm seeing where a priority is used are:</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">1) Channel origination (optionally sending channel to dialplan instead of into a Stasis app)</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">2) Channel continue (jump out of application into a specific point in dialplan)</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">And yes, you are correct in pointing out that the continue is using an int rather than a long, which is clearly a consistency mistake in the API.</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">In both cases, the priority is given as a part of typical context/extension/priority method of addressing where exactly in the dialplan you want to send the channel to.  The most common scenario is to have a priority 1 as the starting point.  The other numbers (using same => n) are then sequential but arbitrary, and it is generally not necessary to know what they actually are to jump to them directly.</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">As you point out, labels in dialplan are a convenient way of allowing dialplan execution to jump or goto a specific point without needing to know the actual priority number.  Unfortunately, the implementation in ARI does not (currently) allow for a label to be specified.  This is a limitation that should probably be fixed - possibly a topic of discussion for Astridevcon.</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">For a workaround, I would suggest using arbitrarily large priorities to jump to the correct label where this functionality is needed.</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">For example:</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">exten => _x.,1,Answer()</div><div class="gmail_default" style="color:#660000">   same => n,GoToIf($["${GOTTAGONOW}" = "1"]?louie)</div><div class="gmail_default" style="color:#660000">   same => n,Playback(tt-monkeys)</div><div class="gmail_default" style="color:#660000">   same => n,Hangup()</div><div class="gmail_default" style="color:#660000">   same => n(louie),Playback(lyrics-louie-louie)</div><div class="gmail_default" style="color:#660000">   same => n,Hangup()</div><div class="gmail_default" style="color:#660000"><br></div><div class="gmail_default" style="color:#660000">exten => _x.,10001,GoTo(louie)</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, Oct 8, 2014 at 8:33 AM, Nir Simionovich <span dir="ltr"><<a href="mailto:nir.simionovich@gmail.com" target="_blank">nir.simionovich@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi Guys,<div><br></div><div>  While working on PHPARI, I've come to a realization that the channels REST API<br>has a slight issue - primarily, its usage of the "priority" member in the REST API.</div><div><br></div><div>  Currently, the specification states that "priority" is either "int" or "long" (depending <br>on the request). </div><div><br></div><div>  The problem with that is for someone like myself, who codes dialplan in AEL or<br>using the "same => n," or the "exten => _X.,n," methodology - we have no visibility<br>of priority numbers - we use labels.</div><div><br></div><div>  I'm not that familiar with the ARI part of the Asterisk code yet, as I'm focused on how<br>to actually work with it, but this is somewhat of a show stopper in my book, as all my<br>existing code relies heavily on label usage.</div><div><br></div><div>  Btw, I tried pushing a label into the REST interface, got a 500 error - which means <br>it's designed to work with numbers and not labels. </div><div><br></div><div>Regards,</div><div>  Nir S</div><div><br></div><div><br></div></div>
<br></div></div><span><font color="#888888">--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><img alt="Digium logo" src="https://my.digium.com/images/graphics/digium_RGB_signature.gif" width="288" height="50" style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><div>Scott Griepentrog<br>Digium, Inc · Software Developer<br>445 Jan Davis Drive NW · Huntsville, AL 35806 · US<br>direct/fax: <a href="tel:%2B1%20256%20428%206239" value="+12564286239" target="_blank">+1 256 428 6239</a> · mobile: <a href="tel:%2B1%20256%20580%206090" value="+12565806090" target="_blank">+1 256 580 6090</a><br>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> · <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br></div></div>
</font></span></div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br></div>
</div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><img alt="Digium logo" src="https://my.digium.com/images/graphics/digium_RGB_signature.gif" width="288" height="50" style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><div>Scott Griepentrog<br>Digium, Inc · Software Developer<br>445 Jan Davis Drive NW · Huntsville, AL 35806 · US<br>direct/fax: +1 256 428 6239 · mobile: +1 256 580 6090<br>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> · <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br></div></div>
</div>