Caller Name / dial plan issue

We have a trunk provider that (using SIP) passes the DID dialed as: ###########;phone-context=national (Using from-trunk context).

I couldn’t find a context that would correctly identify the DID passes without the other garbage so I created a new context:

[from-trunk-custom]
exten => _X.,1,Set(IncomingNumber=${CUT(EXTEN,;,1)})
exten => _X.,1,Set(__FROM_DID=${CUT(EXTEN,;,1)})
exten => _X.,n,Set(CALLERID(name)=${CUT(SIP_HEADER(From),",2)})
exten => _X.,n,Goto(from-pstn,${CUT(EXTEN,;,1)},1)

This context works fine with this provider except the Caller Id Name always get’s set to the Caller Id Number even tho it’s coming in on the from of the sip invite:

<— SIP read from UDP:10.185.17.141:5060 —>
INVITE sip:##########;[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 10.185.17.141:5060;branch=z9hG4bKm9sae5jnanbcdm2jqej3p97s91
From: "Jane Smith"sip:##########;[email protected];user=phone;isup-oli=00;tag=SDno1a401-36626

My above context set’s the CALLERID(name) correctly but it get’s overridden by the from-pstn context.

How can I fix this and I have to be careful because we have other trunks using the from-trunk correctly, caller Id and all so I need to have both cases working.

Thanks.