[asterisk-users] Any reason to *not* use AEL? (Also, MixMonitor q)

Steve Murphy murf at digium.com
Tue Jun 3 13:04:10 CDT 2008


On Tue, 2008-06-03 at 20:38 +0300, Atis Lezdins wrote:
> On Tue, Jun 3, 2008 at 7:59 PM, Sherwood McGowan
> <sherwood.mcgowan at gmail.com> wrote:
> > Atis Lezdins wrote:
> >> On Tue, Jun 3, 2008 at 6:23 PM, Sherwood McGowan
> >> <sherwood.mcgowan at gmail.com> wrote:
> >>
> >>> Tilghman Lesher wrote:
> >>>
> >>>> On Tuesday 03 June 2008 09:03:16 Sherwood McGowan wrote:
> >>>>
> >>>>
> >>>>> The only thing you need to watch for is falling into some basic
> >>>>> "traps" like calling ${EXTEN} from within a switch (the AEL compiler
> >>>>> uses sw-xxxx extensions for case instances).
> >>>>>
> >>>>>
> >>>> This should already be solved in the latest release.  The extension will
> >>>> be saved in an alternate variable, and references to ${EXTEN} below
> >>>> a switch will be converted to use that alternate variable.
> >>>>
> >>>>
> >>>>
> >>> Actually, no they're not converted to the alternate variable. Guess I
> >>> should contact Murf, because now that I think of it I had mentioned this
> >>> to Murf before I think.
> >>>
> >>>
> >>
> >> They are on 1.4.19, but this works invisible to user:
> >>
> >> exten => _X.,76,Set(~~EXTEN~~=${EXTEN})
> >> exten => _X.,77,Goto(sw-98-${DIALSTATUS}|10)
> >> exten => _X.,78,NoOp(Finish switch-if-if-local_dial-95-97-98)
> >> exten => _X.,79,Goto(103)
> >>
> >> Regards,
> >> Atis
> >>
> >>
> > Yes, but if you call ${EXTEN} within the switch, it does not (at least
> > on my Asterisk 1.4.20 system) jump transparently to ${~~EXTEN~~} it
> > still attempts to use ${EXTEN}.
> >
> > [new_test]
> > exten => _X.,1,Goto(sw-24-${CHANNEL}|10)
> > exten => _X.,2,NoOp(Finish switch-new_test-24)
> > exten => _sw-24-.,10,Goto(${EXTEN}|tests)
> > exten => sw-24-,10,Goto(sw-24-.|10)
> >
> > AEL Code:
> > context new_test {
> >    _X. => {
> >        switch(${CHANNEL}) {
> >        default:
> >            jump ${EXTEN},tests;
> >        }
> >    }
> > }
> >
> 
> Well, exactly the same code on 1.4.19 parser (aelparse -d -n -w -q
> extensions.ael):
> 
> [new_test]
> exten => _X.,1,Set(~~EXTEN~~=${EXTEN})
> exten => _X.,2,Goto(sw-90-${CHANNEL}|10)
> exten => _X.,3,NoOp(Finish switch-new_test-90)
> exten => _sw-90-.,10,Goto(${~~EXTEN~~}|tests)
> exten => sw-90-,10,Goto(sw-90-.|10)
> 
> Could it be that you have old version of "aelparse" in system?
> However, i think I have seen that "make install" copies it to system.

Phew! Thanks!

I was just about to go look this up and see if I forgot something.

murf

-- 
Steve Murphy
Software Developer
Digium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080603/24a61edb/attachment.bin 


More information about the asterisk-users mailing list