Stripping +1 from CID has changed

For a few years I have used

exten => _X!,1,GotoIf($["${CALLERID(num):0:2}" != “+1”]?noplusatstart)
exten => _X.,n,NoOp(Changing Caller ID number from ${CALLERID(num)} to ${CALLERID(num):2})
exten => _X.,n,Set(CALLERID(num)=${CALLERID(num):2})
exten => _X.,n,Set(CALLERID(ANI)=${CALLERID(num)})
exten => _X!,n(noplusatstart),Goto(from-trunk,${EXTEN},1)

to strip +1 from my incoming CID. Now the resulting outcome only strips the + from the CID.

Can anyone explain what edits I need to make to get this to strip the 1 now from the CID as well?

Here is the setup:

Built from scratch.
FreePBX: 2.8.15
Asterisk (Ver.
Provider: SIPStation

The code to strip the +1 is located in:

Both trunks that we have are going to;

Outgoing Settings:

context=from-ptsn-custom ( I know that it’s misspelled, but it’s the same everywhere so it works.

Incoming Settings:
USER Context: from-ptsn-custom

Thanks in advance.

No answers for you, but looks like someone a few threads down from you is having the same issue:

Well after several hours of working on this, I found a temporary fix.
What you have to do is change the nice code to this simple one.

exten => _X!,1,Set(CALLERID(num)=${CALLERID(num):1:12})
exten => _X!,n,Goto(from-trunk,${EXTEN},1)
type = friend

For SipStation this leaves just the 10 digit number, but will still remove 2 characters no matter what is to the left of the area code or “pre 10 digits”. What I mean is that if the caller ID is “Unknown caller” or something, it will be “known caller” after the script is done stripping the numbers. Not such a big deal for me, because I’m using “Privacy Manager” from my “SmartRoute” to ask the caller for their CID.
I’m still working on this and I will paste the resolution as soon as I find the answer.

I have just discovered today that the temporary fix no longer works as well. This is only effecting the displayed caller ID +1 for the phones and the CDR. As of today I believe that My Trunk provider has made some changes to their system because the automatic setting for the Sip-Station module that adds the peer details context for dtmfmode=rfc2833 no longer allows callers to use the touch tones in your IVR. You must set this to dtmfmode=auto for calls to work as normal.

dtmf still works fine for me with rfc2833