[asterisk-users] Any reason to *not* use AEL? (Also, MixMonitor q)
Atis Lezdins
atis at iq-labs.net
Tue Jun 3 12:38:03 CDT 2008
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.
Regards,
Atis
--
Atis Lezdins,
VoIP Project Manager / Developer,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835
More information about the asterisk-users
mailing list