The main point is to have different POTS peers for the 3 types of calls out each one of the FXO ports:
1. National 7 digits - these would be starting with 2 to 9 so say [2-9].......
2. National 0 + 7 digits - these would be starting with 0 and then say 0[2-9]......
3. International 011 + digits - these would be as 011T
SO, your configuration should be:
dial-peer cor custom
name national
name international
name local (local means no calls out FXO ports!!)
!
dial-peer cor list national
member national
!
dial-peer cor list international
member international
!
dial-peer cor list local
member local
!
dial-peer cor list nationalcalls
member national
member local
!
dial-peer cor list internationalcalls
member national
member international
member local
!
dial-peer cor list localcalls
member local
!
dial-peer voice xx pots
destination-pattern [2-9].......
port x/y
cor outgoing nationalcalls
!
dial-peer voice yy pots
destination-pattern 0[2-9]......
port x/y
cor outgoing nationalcalls
prefix 0
!
dial-peer voice zz pots
destination-pattern 011T
port x/y
cor
outgoing internationalcalls prefix 011
!
ephone-dn 1 (all calls allowed for this phone)
cor incoming international
!
ephone-dn 2 (only national calls)
cor incoming national
!
ephone-dn 3 (no calls out the FXO)
cor incoming local