Transfer an outgoing call transfer to an extension doesn't preserve internal CID

Hello,

I’m encountering an issue with FreePBX 16.

The behavior is inconsistent when I make an external call using an extension with an Outbound CID set and then perform an attended transfer using the In-Call Asterisk Attended Transfer code to another extension.

In most cases, the call arrives internally displaying my Outbound CID, but occasionally it arrives correctly with the internal number.

I’ve attached the output of the Asterisk console with PJSIP debug enabled, along with the dumpchan output captured before the transfer dial.

The channel variables appear to be set correctly before the dial, but the subsequent INVITE does not reflect those values.

From what I can infer, this inconsistent behavior might be related to how the channel bridge is being established, but that’s just a hypothesis.

Does anyone have any insights or suggestions that could help resolve this?

Thank you!