remove 11th digit from CID

Joined
Apr 17, 2009
Messages
829
Reaction score
9
I am wondering how to remove the "1" from the CID on incoming calls.

I am using a DIDFORSALE.COM for my incoming DID. this is what i have from their site to remove the "+" from CID

exten => _X.,1,Set(CALLERID(num)=${CALLERID(num):1})
include => from-trunk
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
i must be missing something then because I still get "+1" before the area code and number
 

Boolah

Guru
Joined
Nov 16, 2007
Messages
331
Reaction score
20
You might look at this problem in a different way... Instead of removing the "1" in from of the 10-digit number (which, apparently is sometimes "+1"), try keeping the last 10 digits of the number, like so:

exten => _X.,1,Set(CALLERID(num)=${CALLERID(num):-10:10})
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
I prefer to deal with things like this in a script - you have a lot more flexibility in terms of parsing the CID and what you do. I have a script (php) which does various tweaks to the incoming CID info, including removing a leading '+1', and it is a lot cleaner because it doesn't need to be wedged into the dial plan. One other thing I have it do: whenever you see a name like "OUT OF AREA", "RESTRICTED", etc... I null out the CID name & number, so zapateller will give the disconnect tone to the other caller - a lot of telemarketers' computer systems will hang up then and there and I don't get even a single ring :)
 

frontline

Member
Joined
Oct 18, 2007
Messages
110
Reaction score
0
Does the script also change the data recorded in the CDR record. I have no trouble modifying the CID by several of the published methods. However, none seem to make the modification to the data stored in the CDR.
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
It happens at the very beginning of the process where call is received, so, yes, it does affect the CDR.
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
still get the same thing.

i am putting this in the extensions_custom.conf file

which appears to be where I keep reading that it needs to go.:banghead::banghead::banghead::banghead::banghead:
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
line? you mean my number??

i would assume so. to test this process out i am calling into PiAF Box and ringing extension and havea softphone open for that extension and it is showing it as +1:banghead::banghead:
 

klingon888

Guru
Joined
Nov 23, 2007
Messages
90
Reaction score
4
This is what I did. In your trunks, set your

context=from-trunk-custom (instead of context=from-trunk)

Then in extensions_customs.conf, add the following. This will take care of 1 as well as + for those international calls.

[from-trunk-custom]
exten => _X.,1,GotoIf($["${CALLERID(num):0:1}" = "+"]?30)
exten => _X.,n,GotoIf($["${CALLERID(num):0:1}" = "1"]?30)
exten => _X.,n,Goto(from-trunk,${EXTEN},1)
exten => _X.,30,Set(CALLERID(num)=${CALLERID(num):1})
exten => _X.,31,Goto(from-trunk,${EXTEN},1)
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
no, i mean look in /var/log/asterisk/full when you make a call, and see if you set the dialplan stuff you put in.
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
This is what I did. In your trunks, set your

context=from-trunk-custom (instead of context=from-trunk)

Then in extensions_customs.conf, add the following. This will take care of 1 as well as + for those international calls.

[from-trunk-custom]
exten => _X.,1,GotoIf($["${CALLERID(num):0:1}" = "+"]?30)
exten => _X.,n,GotoIf($["${CALLERID(num):0:1}" = "1"]?30)
exten => _X.,n,Goto(from-trunk,${EXTEN},1)
exten => _X.,30,Set(CALLERID(num)=${CALLERID(num):1})
exten => _X.,31,Goto(from-trunk,${EXTEN},1)


i will give it a shot. i just dont feel like having to change everthing to from-trunk-custom on everything i have setup.
 

angoyr

Guru
Joined
Apr 1, 2008
Messages
171
Reaction score
0
completetech,

I feel your pain. The last solution presented would solve your problem if you need to remove one or the other, that would work perfectly.

You really don't have to change your current setup to accomplish your goal. The [from-trunk-custom] is just the context that is used within the trunk to tell asterisk what to do when a call comes in on that trunk. You can make it [from-mars] and it would still work. The important thing is where you want it to go after the processing is done. Here is what I use to remove both if they exist.
Code:
; This section will remove '+1' from the numbers coming from e164 provider
[from-jupiter-custom]
exten => _X.,1,GotoIf($["${CALLERID(num):0:2}" != "+1"]?noplus)
exten => _X.,n,Set(CALLERID(num)=${CALLERID(num):2})
exten => _X.,n(noplus),Goto(from-trunk,${EXTEN},1)

What that would do is check the callerID number to see if it starts with "+1". If it doesn't it jumps to n(noplus). If it does, it goes to the second line and set callerID number to everything from the third character to the end.

Just remember, whatever you use must be the context in the trunk.

Good luck.

Robin A.
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
i have tried all of the suggestions in this thread. however. when i look at my logs it show that there is still the + in front of the CID.

also on my phone it shows it as well.

any other ideas?
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
The Caller ID Superfecta module should remove the + automatically when processing. Have you thought to give it a try in this situation?
 

angoyr

Guru
Joined
Apr 1, 2008
Messages
171
Reaction score
0
completetech,

Maybe a look at your inbound trunk would help. The solution klingon888 and I posted should work perfectly. The context in that trunk would get executed first then whatever is in your inbound route.

Check your logs to see if any errors are being generated.

RobinA.
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
The Caller ID Superfecta module should remove the + automatically when processing. Have you thought to give it a try in this situation?


it is already there and setup. so that should not be a issue. i updated my password in the module. and I still have this issue.

I added the lines below to [mycontextname]


exten => _X.,1,GotoIf($["${CALLERID(num):0:2}" != "+1"]?noplus)
exten => _X.,n,Set(CALLERID(num)=${CALLERID(num):2})
exten => _X.,n(noplus),Goto(from-trunk,${EXTEN},1)



then i went to the trunk and added
context=from-mycontextname

and i am still getting the + symbol... what else could i try
 

angoyr

Guru
Joined
Apr 1, 2008
Messages
171
Reaction score
0
Try removing the "from-"
Use context=mycontextname

Hope that helps.
 

Members online

Forum statistics

Threads
25,825
Messages
167,850
Members
19,250
Latest member
mark-curtis
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