Add Asterisk Extension Language support (AEL) from Astricon talk
[asterisk/asterisk.git] / configs / extensions.ael.sample
1 //
2 // Example AEL config file
3 //
4
5 macro std-exten-ael( ext , dev ) {
6         Dial(${ext}/${dev},20);
7         switch(${DIALSTATUS) {
8         case BUSY:
9                 Voicemail(b${ext});
10                 break;
11         default:
12                 Voicemail(u${ext});
13         };
14         catch a {
15                 VoiceMailMain(${ext});
16                 return;
17         };
18 };
19
20 context ael-demo {
21         s => {
22                 Wait(1);
23                 Answer();
24                 TIMEOUT(digit)=5;
25                 TIMEOUT(response)=10;
26 restart:
27                 Background(demo-congrats);
28 instructions:
29                 for (x=0; ${x} < 3; x=${x} + 1) {
30                         Background(demo-instruct);
31                         WaitExten();
32                 };
33         };
34         2 => {
35                 Background(demo-moreinfo);
36                 goto instructions;
37         };
38         3 => {
39                 LANGUAGE()=fr;
40                 goto restart;
41         };
42         500 => {
43                 Playback(demo-abouttotry);
44                 exten => 500,n,Dial(IAX2/guest@misery.digium.com)
45                 Playback(demo-nogo);
46                 goto instructions;
47         };
48         600 => {
49                 Playback(demo-echotest);
50                 Echo();
51                 Playback(demo-echodone);
52                 goto instructions;
53         };
54         _1234 => &std-exten-ael(${EXTEN});
55         # => {
56                 Playback(demo-thanks);
57                 Hangup();
58         };
59         t => jump #;
60         i => Playback(invalid);
61 };
62