CID passthrough on calls relayed through FreePBX

FreePBX V12 (latest)
Official Distro

OK so I have been searching for an hour and while I find things that were close I could not find a resolution to my situation.

Basically I have calls coming into DIDs on a SIP trunk. The inbound routes pick these up and send out to a misc destination which is generally a cellphone. The CID that shows up is my trunk info and not the original calling number. I have the CID currently set on the trunk and it is not set to force.

I am using Vitelity which I believe will pass any number. Also as far as I can tell in the logs I am actually sending the trunk CID.

Is there anyway to “passthrough” the original CID to the misc destination in my situation?

Thank You

Alright in case anyone else has this question/issue I am posting my solution here.

I was able to solve my own problem by removing ALL outbound CID manipulation on the route and trunk.

What I did was use the existing outbound route for all calls NOT related to an extension and created another outbound route that extensions would use. The first outbound route that all calls (ie the system forwarding for not an extension) would use had no manipulation on it so that the CID would pass through for relayed calls. The second outbound route was set to force the main number so that extensions dialing outbound would show the proper company CID.

The trick for extensions to select the second outbound route was to put “[456]xx” in the “caller id” field of the patterns. Extensions would match that and use that route while anything coming from the outside and being relayed (NxxNxxxxxx) would use the other route.

Ordering them correctly was important as well. I made sure the more exact match (the route for the extensions) was first.

Hope this helps someone else.