Outbound CID based on extension

Hi there.
I have some problems to configure the outbound CID based on trunk (Freepbx
I have some extensions based on 2 digit number format, XX, and 2 different trunks for outgoing calls: a dahdi ISDN trunk and an IAX2 trunk.
My need is to modify the outbound CID based on the trunk i’m using:
DAHDI Trunk -> DID := 0123456XX
IAX2 Trunk -> DID := 18XX

Is this function supported by Freepbx or i have to write my own outbound custom application ?

Thanks in advance.

Sorry for my bad english.