[asterisk-users] Re: AEL Question

Steve Murphy murf at parsetree.com
Fri Oct 13 07:14:41 MST 2006


On Fri, 2006-10-13 at 06:30 -0700,
asterisk-users-request at lists.digium.com wrote:
>             Hi, all.  I'm making my first foray into AEL.  I'm
>         starting with a 
>         simple macro, but I've already encountered an odd behaviour.
>         I'm 
>         wondering if someone can shed some insight:
>         
>         Asterisk 1.2.9.1
>         
>         macro newPlaceCallPSTN {
>             s => {
>                 TIMEOUT(absolute)=7200;
>                 NoOp(Analog Out List: ${ANALOGOUT});
>                 ChanIsAvail(${ANALOGOUT});
>                 NoOp(Available Out List: ${});
>                 // --
>                 theChannel=Cut(AVAILCHAN|-|1);
>                 NoOp(Now Calling ${MACRO_EXTEN} on ${theChannel}....);
>                 // --
>                 Dial(${theChannel}/${MACRO_EXTEN:${TRUNKMSD}});
>             };
>         };
>         
>         ...  I get:
>         
>             -- Executing macro("SIP/162-4c8b", "newPlaceCallPSTN")
>         Oct 13 08:57:22 WARNING[15320]: ast_expr2.fl:183 ast_yyerror: 
>         ast_yyerror(): syntax error: syntax error, unexpected TOK_GT,
>         expecting 
>         TOK_MINUS or TOK_COMPL or TOK_LP or TOKEN; Input:
>          > {            TIMEOUT(absolute)=7200;         NoOp(Analog
>         Out List: 
>         ZAP/4&ZAP/3&ZAP/2&ZAP/1);         
>         ChanIsAvail(ZAP/4&ZAP/3&ZAP/2&ZAP/1);           NoOp(Available
>         Out List: 
>         );                               theChannel=Cut(AVAILCHAN|-|
>         1);          
>         NoOp(Now Calling 95145121677 on ....);                   
>         Dial(/5145121677);       }
>          ^
>         Oct 13 08:57:22 WARNING[15320]: ast_expr2.fl:187 ast_yyerror:
>         If you 
>         have questions, please refer to doc/README.variables in the
>         asterisk source.
>             -- Executing Set("SIP/162-4c8b", "s =0") in new stack
>           == Auto fallthrough, channel 'SIP/162-4c8b' status is
>         'UNKNOWN'
>         
>         
>             From what I can see, ChanIsAvail() is not actually
>         populating 
>         AVAILCHAN the way it should.  Is there a different syntax I
>         should be 
>         using with AEL for this function?

I wish all AEL problems were this easy!

The complaints are coming from the fact that you have to call the
built-in function
TIMEOUT from within the ${ } notation, or its equivalent... 

To do this you need an app call to put it in...
Try:           Set(TIMEOUT(absolute)=7200);
instead.

And, Function names (last time I checked) are case sensitive, so the
line:

theChannel=Cut(AVAILCHAN|-|1);

Should most likely be:

Set(theChannel=${CUT(${AVAILCHAN}|-|1)});

So, don't forget to wrap your variable names in ${} and don't forget
that
the first argument to the app Set() is treated as a variable name
without having
to have it wrapped in ${}.

murf


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3239 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20061013/8602f9d5/smime.bin


More information about the asterisk-users mailing list