Define outbound number

hi.
i do have an installation of asterisk with some extensions numbers rangings from 21 to 30.
the lines that i do have are 1 ISDN with 4 msns (5 numbers in total) going each number directly to a particular extension.
also i do have a SPA 3000 with a PSTN line that directs the call to a particular extension. to call from ISDN all i have to do is to lift the handset (no prefix). The spa3000 is configured to dial 9.
My mumbers on the isdn are 123456 directed to 21, 123457 directed to 22, 123458 directed to 23, 123459 directed to 24, 123455 directed to 25, 123454 directed to 26. The SPA number is 222345 directed to 30.

My question is how to define particular extensions without dialing a prefix to show out a particular number.
for example when i lift the hanset from extension 21 to show as outbound number 123456, the 22 to show the 123457. The extension 30 to be able to call without the user to dial prefix 9 and show the 222345.

could someone be able to give me some help to overcome this issue?

This is the wrong forum for support questions.

What technology are you using for the extensions? For SIP, you will need to configure this on the phones themselves.