Например
где-то в начала обработки входящих
same => n,GoSub(aon,${CALLERID(num)},1);
[aon]
exten => _XXXXXXXXXX,1,Set(CALLERID(num)=8${CALLERID(num)})
same => n,Return()
exten => _7XXXXXXXXXX,1,Set(CALLERID(num)=8${CALLERID(num):-10})
same => n,Return()
exten => _87XXXXXXXXXX,1,Set(CALLERID(num)=8${CALLERID(num):-10})
same => n,Return()
exten => _XXXXXXX,1,Set(CALLERID(num)=7495${CALLERID(num)})
same => n,Return()
exten => _XXXXXXXXXX.,1,Goto(other_numbers,1); если нужно...