Am I doing something really stupid in this AEL macro, or is nesting an
'if' inside a 'switch', inside an 'if' not supported in the 1.2 AEL
parser?

macro stdexten( ext , dev ) {
        // First determine if the SIP peer is registered here
        Set(aretheyhere=${SIPPEER(${ext}:status)});
        if(${aretheyhere:0:2}) == "OK") {
                MixMonitor(${UNIQUEID}.wav|b);
                Dial(${dev},30);
                switch(${DIALSTATUS}) {
                case BUSY:
                        MailboxExists(${ext});
                        if("${VMBOXEXISTSSTATUS}" != "SUCCESS") {
                                Busy(5);
                                };
                        Voicemail(b${ext});
                        Hangup();
                        break;
                default:
                        MailboxExists(${ext});
                        if("${VMBOXEXISTSSTATUS}" != "SUCCESS") {
                                Congestion(5);
                                };
                        Voicemail(u${ext});
                        Hangup();
                        break;
                };
        };
};

When I do an AEL reload, I get 

2007-01-23 16:11:31 WARNING[10795]: pbx_ael.c:102 __grab_token: Syntax error at 
line 370 of 'extensions.ael', too many closing braces!
    -- Registered extension context 'macro-stdexten'
    -- Added extension 's' priority 1 to macro-stdexten
    -- Added extension 's' priority 2 to macro-stdexten
    -- Added extension 's' priority 3 to macro-stdexten
    -- Added extension 's' priority 4 to macro-stdexten
2007-01-23 16:11:31 WARNING[10795]: pbx_ael.c:102 __grab_token: Syntax error at 
line 371 of 'extensions.ael', too many closing braces!
2007-01-23 16:11:31 NOTICE[10795]: pbx_ael.c:1146 handle_root_token: Unknown 
root token '}'


Cheers,
Gavin.
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to