How to remove + from caller ID

zigg.z

New Member
Joined
Feb 24, 2010
Messages
58
Reaction score
0
I am using a SIP trunk that gives me caller ID of +1xxxxxxxxxx
I would like to know how to remove the + from the caller ID in the scripts or rules etc.
 

Lost Trunk

Guru
Joined
Aug 5, 2008
Messages
228
Reaction score
0
Here's one way that should work - in extensions_custom.conf add this:

Code:
[custom-strip-plus]
exten => _X!,1,GotoIf($["${CALLERID(num):0:1}" != "+"]?noplus)
exten => _X!,n,Set(CALLERID(num)=${CALLERID(num):1})
exten => _X!,n(noplus),Goto(from-trunk,${EXTEN},1)
exten => h,1,Macro(hangupcall,)
Then in your trunk change the context from from-trunk to custom-strip-plus.
 
Joined
Apr 22, 2009
Messages
230
Reaction score
0
in your case just change the context in your trunk from 'from-trunk' to 'from-pstn-e164-us'
 

zigg.z

New Member
Joined
Feb 24, 2010
Messages
58
Reaction score
0
I tried the suggestion from both Lost Trunk and Patrick_elx.
Patrick's did not work, and the system stopped receiving calls until I moved it back. (I am using CogentVoip for a trunk)
Lost Trunk's idea didn't break anything, but the + is still coming in.
context=custom-strip-plus
is that correct?
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
Instead of stripping it on the way in, strip it off on the way out. Add this line to extensions_custom.conf in the from-internal-custom context.

Code:
[from-internal-custom]

exten => _+.,1,goto(from-internal,${EXTEN:-11},1)

This line of code strips the "+" from any number dialed and send the remaining 11 digits.
 

zigg.z

New Member
Joined
Feb 24, 2010
Messages
58
Reaction score
0
Ok, I just tried it.
So that we are on the same page again, my only issue is that + is always on incoming CID, and it still is.
I am not sending "+" on my outbound calls, nor is that my problem. For now it is not stripping the + still.
 

jades

Guru
Joined
Oct 6, 2008
Messages
160
Reaction score
0
On your sip trunk you need to have the context=from-internal-custom if you are using jmullinix's code.
 

zigg.z

New Member
Joined
Feb 24, 2010
Messages
58
Reaction score
0
So what is the successful way to remove + from the INCOMING caller ID on 2.6.0.2?
 
Joined
Nov 20, 2010
Messages
159
Reaction score
0
This one strips the "+" from the front of the CID. It also cleans up the CID and CID ANI so things look good in the CDR as well. Taken from here.

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

Then change the context of the SIP trunk to from-trunk-custom
 

Members online

Forum statistics

Threads
25,782
Messages
167,512
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top