Keeping PJSIP Headers on outbound Extension

I’ve been using Asterisk and FreePBX for a very long time, and have setup a few custom contexts to handle DID/CID over trunks and between multiple FreePBX systems. I’ve recently been playing around with v13 and I seem to have an issue with setting a JPSIP header and that header being kept.

What my basic context does is:

Strips out the number from the To header on the original inbound trunk, saves this number on the SIP header as a new field. Again this worked fine in my previous version of Asterisk (10.2 and older versions). Not sure what is going on.

Am also getting the receiving extension get the call to [email protected] rather than the associate extension number. Probably some major changes between PJSIP and chan_sip that I’m not aware of yet.

Any help much appreciated.