[asterisk-users] AEL and swap from macros to contexts

Pavel Jezek pavel.jezek at i.cz
Mon Oct 6 11:25:19 CDT 2008



Atis Lezdins wrote:
> On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek <pavel.jezek at i.cz> wrote:
>   
>> Hi, according to discussion on asterisk IRC, where people said, that
>> macros will be depracated, I tried to migrate from macros to contexts
>> and Gosub
>> but if I try to use gosub in extensions.ael, ael compiler complains,
>> that I shouln't use Gosub app,
>> but I can't find ael keyword, that will be Gosub equivalent, or can I
>> ignore this ael warnings? thanks
>> PJ
>>
>>
>> LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
>> /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
>> affects flow of control, and needs to be re-written using AEL if, while,
>> goto, etc. keywords instead!
>>     
>
> Hi,
>
> In definition use:
>
> macro set_record(A,B) {
>   // do something
> }
>
> And for calling:
>
> &set_record(${CALLERID(NUM)},${EXTEN});
>
> It will automatically be translated to GoSub in 1.6, but will remain
> as Macro in 1.4.
>   

yes, I know, but I hear on IRC, that macros will be deprecated and 
suggestion was to move to contexts,
personaly I would like also move away from macros, because macros have 
some limitations, eg. variable number of arguments isn't possible with 
classic macros,
macros also require variable to be defined in macro definition (that is 
needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
so I definitively agree with moving from macros to contexts, only one 
bad thing is compiler warning, when I try to Gosub to context (as macro 
replacement)
PJ



> Regards,
> Atis
>
>
>
>   



More information about the asterisk-users mailing list