<br><br><div class="gmail_quote">On Mon, May 11, 2009 at 1:30 AM, Olivier <span dir="ltr"><<a href="mailto:oza-4h07@myamail.com">oza-4h07@myamail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I'm using asterisk 1.6.1 and AEL2.<br>I'm trying to find the best way to write my own custom functions ?<br><br><br>At the moment, I'm using this pattern (extensions.ael) :<br><br>context foo {<br>123 => {<br>
&myfunc(123456);<br> NoOp(${GOSUB_RETVAL});<br>};<br><br>macro myfunc (arg) {<br> Return (${arg});<br>}<br><br>1. First, I keep getting warnings like<br>Warning: file /etc/asterisk/extensions.ael, line 446-446: application call to Return affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!<br>
and I would like to get rid of them.<br></blockquote><div><br>This is easily done. Return() is calling the Return application; 'return', however, is the keyword the AEL uses. Note the lack of a capital R at the beginning of<br>
the word "return". AEL is case sensitive and "Return" is not equal to "return". <br><br>Also note that, as a previous reply mentions, that return takes no args, that there is a patch available to upgrade to do that.<br>
You don't need the patch to do what the patch does, tho. But, not having refreshed my memory on the particulars, I will say<br>no more!<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>2. Secondly, I would like not to use GOSUB_RETVAL and call a custom function just like I'm calling other functions with statements like :<br>123 => {<br> NoOp(TOLOWER(fOo BaR));<br>
NoOp(myfunc(123456));<br>};<br><br></blockquote><div><br>Again, check your version of Asterisk against whether AEL uses Gosub() to implement macros. <br>The AEL2 wiki page on <a href="http://voip-info.org">voip-info.org</a> ( <a href="http://voip-info.org/wiki/view/Asterisk+AEL2">http://voip-info.org/wiki/view/Asterisk+AEL2</a> ) can also<br>
be quite helpful at times!<br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>What would you advise me to do ?<br><br>Regards<br><br><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-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Steve Murphy<br>ParseTree Corp<br>
<br>