[asterisk-users] AEL: CID match and pattern in switch statement

jbauer at teec.com jbauer at teec.com
Fri Dec 15 07:12:02 MST 2006


Hi all,

I am using Asterisk 1.2.10 on Debian Sarge and currently I am rewriting my
extensions.conf with ael.

The replacement of the following part makes me mad:

[set-language]
exten => _X./_0031.,1,Set(incoming_call=1|lang=nl)
exten => _X./_0031.,2,Goto(incoming,${EXTEN},1)
exten => _X./_0049.,1,Set(incoming_call=1|lang=de)
exten => _X./_0049.,2,Goto(incoming,${EXTEN},1)
exten => _X.,1,Set(incoming_call=1|lang=en)
exten => _X.,2,Goto(incoming,${EXTEN},1)

First I tried it this way:

context set-language {
    _X./_0031. => {
        Set(incoming_call=1|lang=nl);
        jump ${EXTEN}@incoming;
    };
    _X./_0049. => {
        Set(incoming_call=1|lang=de);
        jump ${EXTEN}@incoming;
    };
    _X. => {
        Set(incoming_call=1|lang=en);
        jump ${EXTEN}@incoming;
    };
};

The CID match did not seem to work so I tried to solve it with a switch
statement:

context set-language {
    _X. => {
        Set(original_extension=${EXTEN});
        switch (${CALLERID(num)}) {
            pattern 0031.:
                Set(incoming_call=1|lang=nl);
                jump ${original_extension}@incoming;
            pattern 0049.:
                Set(incoming_call=1|lang=de);
                jump ${original_extension}@incoming;
            default:
                Set(incoming_call=1|lang=en);
                jump ${original_extension}@incoming;
        };
    };
};

Unfortunately pattern does not work at all. I would be very happy if someone
can enlighten me what I am doing wrong here.

Are there any other solutions for replacing that part of my extensions.conf?

Is there any AEL documentation available in addition to the information in
the wiki and doc/README.ael?

Regards, Jens


More information about the asterisk-users mailing list