# Asterisk Project : AEL Examples

Added by mdavenport , edited by mdavenport on Aug 31, 2010

    context demo {
        s => {
            Wait(1);
            Answer();
            TIMEOUT(digit)=5;
            TIMEOUT(response)=10;
        restart:
            Background(demo-congrats);
        instructions:
            for (x=0; ${x} < 3; x=${x} + 1) {
                Background(demo-instruct);
                WaitExten();
            }
        }
        2 => {
            Background(demo-moreinfo);
            goto s,instructions;
        }
        3 => {
            LANGUAGE()=fr;
            goto s,restart;
        }
        500 => {
            Playback(demo-abouttotry);
            Dial(IAX2/guest@misery.digium.com);
            Playback(demo-nogo);
            goto s,instructions;
        }
        600 => {
            Playback(demo-echotest);
            Echo();
            Playback(demo-echodone);
            goto s,instructions;
        }
        # => {
            hangup:
                Playback(demo-thanks);
                Hangup();
        }
        t => goto #,hangup;
        i => Playback(invalid);
    }