[SOLVED] External Trunk to Internal Trunk DNIS/DID getting lost

FreePBX Distro 2.11 32 bit
Asterisk 11.2.1

I am attempting to use a trunk from a SIP provider in the from-trunk context to hit an inbound route in FreePBX to go out a trunk in the from-internal context.

The call makes it through, but the PBX at the receiving end of the from-internal trunk, doesnt get a dialed number or DID number. The target internal PBX supports getting the DID/DNIS from the SIP TO: header field and the SIP request URI and neither one works.

In the opposite direction, a call from the internal PBX in the from-internal context follows the outbound routes and the dialed numbers work flawlessly with multiple outbound routes.

I have tried:

  1. Connecting the SIP provider directly to the SIP PBX eliminating FreePBX in the middle and things work perfectly.

  2. Changing the inbound trunk from the SIP provider to from-pstn context.

  3. Making a misc destination of 999 and pointing it to the trunk for the internal PBX and having the internal PBX routing 199 to an IVR and still didnt work.

I need FreePBX in the middle to allow intercom calls between the PBX and FreePBX as well as record calls, and other things the internal PBX cant do.