Multiple Trunks

I have a situation where each extension on a system is provided with its own local telco number, a US telephone number and a UK telephone number. The system has a DID pri for local connectivity, a US multi channel SIP trunk with multiple DID’s for US connectivity and a UK multi channel SIP trunk with multiple DID’s for UK connectivity.

The problem is that I need to send the right CID depending on which trunk is selected. In FreePBX I can setup the extensions to send one CID when they access any of the three trunks but not three separate CID’s that are trunk specific.

Has anyone any suggestions how I might achieve the required result? Help would be very much appreciated.

I have now written a small routine that overcomes this problem, I use code inserted in macro-dialout-trunk-predial-hook to analyze CID numbers entered in a delimited form in the Outbound CID field of the Extensions section of the web GUI and to select the appropriate DID based upon the trunk selected. If anyone is interested I would be glad to share the solution.