extensions.ael
Код: Выделить всё
context incoming {
        _!      => {
                Hangup(21);
        };
};
context f_scs {
        _!      => {
                Ringing();
                Wait(1);
                Read(DTMF_INPUT,/usr/local/asterisk/data/sounds/ru/welcome-1-2,1,,1,5);
                switch (${DTMF_INPUT}) {
                        case 1:
                                goto office_1,1;
                        case 9:
                                goto test,1;
                        default:
                                goto office_2,1;
                };
        };
        office_1      => {
                Set(CALLERID(name)=${CALLERID(num)});
                Dial(H323/7000@scs1,,rt);
                if ("${DIALSTATUS}" = "CHANUNAVAIL")
                        Dial(H323/3000@scs2,,rt);
                Hangup();
        };
        test    => {
                Set(CALLERID(name)=${CALLERID(num)});
                Dial(H323/04951355@scs1,,rt);
                if ("${DIALSTATUS}" = "CHANUNAVAIL")
                        Dial(H323/03431304@scs2,,rt);
                Hangup();
        };
        office_2  => {
                Dial(H323/9999@office_2,,rt);
                if ("${DIALSTATUS}" = "CHANUNAVAIL" || "${DIALSTATUS}" = "BUSY" || "${DIALSTATUS}" = "NOANSWER")
                        goto office_1,1;
                Hangup();
        };в голосовом меню 2 цифры, цифра 1 переадресация в office_1, цифра 2 переадрессация в office_2, если ничего не жать то вызов уходит в office_2

