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

Sherwood McGowan sherwood.mcgowan at gmail.com
Tue Jun 3 11:59:33 CDT 2008


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;
        }
    }
}

-- 
Sherwood McGowan
VoIP / Telecom Solutions
sherwood.mcgowan at gmail.com




More information about the asterisk-users mailing list