extensions.ael:
// File extensions.ael roundrobin context { _X. => { Set(max=10); Set(n=0); repeat: Set(n=${n}+1); Set(last=$[(${DB(rr/last)} + 1) % ${max}]); Set( DB(rr/last) = ${last} ); Dial(${DB(rr/trunk${last})}/${EXTEN},30,g); if ( ${DIALSTATUS} != "ANSWERED" ) { if ( ${n} < ${max} ) { // Repeat cycle goto repeat; }; }; Hangup; }; };
TIPs:
Set(last=$[(${DB(rr/last)} + 1) % ${max}]); 這行是用來確保 last 是小於 ${max} 的整數。
其他步驟