[asterisk-users] Re: Calling Functions from AEL2

Steve Murphy murf at parsetree.com
Wed Oct 4 21:32:44 MST 2006


On Wed, 2006-10-04 at 15:14 -0700, dgarstang at oneeighty.com wrote:
>         I am trying to call the DUNDILOOKUP dialplan function from
>         ael2, like this:
>         
>         context route {
>                 Set(PATH=${DUNDILOOKUP(${EXTEN},DUNDIRegistr)});
>         }
>         
>         The DUNDILOOKUP function returns no data. However, when I call
>         it exactly the same way in a regular context, it DOES return
>         data.
>         
>         [route]
>         
>                 exten => _X.,n,Set(PATH=
>         ${DUNDILOOKUP(${EXTEN},DUNDIRegistr)})
>         
>         That works. Could this possibly be an AEL2 bug? This is
>         Asterisk 1.4 beta2.
>         
>         Doug.
>         
>         

Interesting!

When I use aelparse -w, a closely adapted version of the above:

context extensions {
        84 => {
                Set(PATH=${DUNDILOOKUP(${EXTEN},DUNDIRegistr)});
        }
}

turns into:

exten => 84,1,Set(PATH=${DUNDILOOKUP(${EXTEN},DUNDIRegistr)})

Which is pretty much what you had.

However, if I put in exactly what you specified:

context route {
                Set(PATH=${DUNDILOOKUP(${EXTEN},DUNDIRegistr)});
        }
        
Then I get:
        
File: /etc/asterisk/extensions.ael, Line 140, Cols: 20-20: Error: syntax
error, unexpected '(', expecting '=' or '=>'
LOG: lev:4 file:pbx_ael.c  line:3938 func: pbx_load_module  Sorry, but 1
syntax errors and 0 semantic errors were detected. It doesn't make sense
to compile.

So, I'd have to assume that you typed in the route context from memory
into your post, and forgot to include the _X. => { ... }   part.

So, from here, I think AEL would have handled this correctly. So,
something else is going on, and I wish you luck on nailing down what it
might be! Use aelparse to check your file,
and double checking the logs won't hurt, either. Sometimes, we forget to
reload the dialplan, and can get thoroughly confused thereby (I know I
do!)... also, the "dialplan show route" command to the CLI will list out
what's in the 'route' context, which can also be informative.

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/20061004/3d2f56b8/smime.bin


More information about the asterisk-users mailing list