Use the "change isdn public" table on the pbx. The first item is the extension length, then extension range (closest match counts, like ARS), what you want to prepend the extension with, and then the CPN length. For example if you have extensions start with 22xx you woul make the entries as follows:
Ext ext-code cpn-prefix cpn-length
4 4 212-832 10
4 221 212-833 10
The above would send 21283222xx for any call sent from an extension start with 4. It would send 212833221X for any call send from an extension starting with 221X. The provider of the ISDN can also an ANI number by befault so this may come into play also.
Hope this helps
Chris