Over-Writing CID

I have a FreePBX install at a client site which is used to connect a traditional PBX for local users to remote SIP extensions and a SIP trunk to the PSTN. The traditional PBX connects to my FreePBX server via PRI x-over cables (I have a Digium TE220 dual span PRI card installed on the server).

30,000 ft view:
[PSTN] <–> [SIP GATEWAY] <-- [I’Net] --> [FreePBX] <-- [PRI] --> PBX

Everything seems to be working properly except outbound CID for calls originating at the traditional PBX. Their system cannot set CID internally as they expect it to be set by the LEC. For some reason, even though I have CID set on both the DAHDI and SIP trunks we are still passing a NULL CID to the upstream provider.

My upstream provider expects a valid CID and if they do not see one (like NULL), they automatically set our BTN to the outbound call. As you can imagine, this has caused some problems when people return calls based solely on CID. I’m sure it will also cause some billing problems at some point in the future…

Does anyone have any thoughts on what I might be able to do to force CID on the calls coming in from the PRI before I send them out to my SIP Gateway?

This is currently a FreePBX 2.6.0.1 system running Asterisk 1.6.2.6.