Need your help to adapt my dial plan

Hello I have just installed my asterisk server on debian. this sever has a digium card TDP04B (which can take 4 PSTN line)

But I have a serious problem I do not know how to make my dial plan and routing of the calls to and from PSTN line

I would be be very hapy if you help me to make my dial plan of routing of the calls

Here the list of my purpose

  1. in local network calls between users of the local network are direct (user with a station sip or a softphone can join directly another) and the number vary between 1000 and 1200

This first purpose is working fine

  1. calls towards line PSTN use the chart diguim: user uses an extension “8” for example to take line PSTN: each call begining by 8 is transfered to PSTN line

  2. Every call begining by 9 are transfered on our FAI sip account(we have an sip account giving by our VoIP provider)

For the reception of the calls all the calls coming from outside (line PSTN) are:

  • tranfered to the standard (1000) and it is the standard which transmits the call to the person indicated in local network

please help me to adapt my dial plan (extention.conf) for PSTN call and international call
If you have any exemple of dial plan worked good , send me it and i would try to adapt
Thank you in advance for your assistance