Strip +1
Posted:
Tue Dec 08, 2015 5:25 pm
by J-Rod1988
My carrier sends the calls as +1xxxxxxxxxx, I was able to uncomment the line in the extensions.conf and then add the DID to VICI as +1xxxxxxxxxx. I set up another VICI server about a year ago and found a modification that to the extensions.conf that removed the +1 so the DID's could be added as normal US 10 digit numbers but have been unable to find one that works this time around.
Re: Strip +1
Posted:
Tue Dec 08, 2015 6:10 pm
by mflorell
That's what the DID feature "Clean CID Number" is for:
Clean CID Number -This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L.
Re: Strip +1
Posted:
Tue Dec 08, 2015 7:24 pm
by J-Rod1988
Wouldn't I still have to put +1xxxxxxxxxx in the DID extension when adding it?
Re: Strip +1
Posted:
Tue Dec 08, 2015 8:33 pm
by mflorell
Sorry, I thought you were asking about caller ID numbers, I haven't seen a US-based carrier that sends a plus sign with the DID. Who is your carrier?
Yes, you should be able to add the DIDs with the plus sign within the Vicidial web admin.
Re: Strip +1
Posted:
Tue Dec 08, 2015 9:53 pm
by J-Rod1988
The carrier is Twilio, the backup carrier sends the DID normal. The people that would be adding numbers is not very technical and I would like to make it uniform for them to avoid any confusion if you know what I mean. I just can't seem to find the right config this time, it was a lot of searching and of trial and error. I had saved the configuration but haven't been able to find it as of yet
Re: Strip +1
Posted:
Tue Dec 08, 2015 10:41 pm
by J-Rod1988
Everything I had been finding was for free PBX which stated to change the context to from-pstn-e164-us. I went ahead and found a copy of the extensions.conf for free PBX and added the contents for "from-pstn-e164-us" above trunkinbound and named it "from-carrier". After changing the "Goto" from "from-pstn" to "trunkinbound" and updating the context in the carrier to "from-carrier" with just a simple reload in asterisk the calls were coming in with no issues. From what I can see it will accept and change anything to 10 digits. Below is exactly what I added to the asterisk's extensions.conf just above "trunkinbound" to resolve the issue.
[from-carrier]
exten => _+1NXXNXXXXXX/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _+1NXXNXXXXXX/_NXXNXXXXXX,2,Goto(trunkinbound,${EXTEN:2},1)
exten => _+1NXXNXXXXXX/_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _+1NXXNXXXXXX/_011X.,n,Goto(trunkinbound,${EXTEN:2},1)
exten => _+1NXXNXXXXXX,1,Goto(trunkinbound,${EXTEN:2},1)
exten => _[0-9+]./_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _[0-9+]./_NXXNXXXXXX,n,Goto(trunkinbound,${EXTEN},1)
exten => _[0-9+]./_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _[0-9+]./_011X.,n,Goto(trunkinbound,${EXTEN},1)
exten => _[0-9+].,1,Goto(trunkinbound,${EXTEN},1)
exten => s/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => s/_NXXNXXXXXX,n,Goto(trunkinbound,${EXTEN},1)
exten => s/_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => s/_011X.,n,Goto(trunkinbound,${EXTEN},1)
exten => s,1,Goto(trunkinbound,${EXTEN},1)
Re: Strip +1
Posted:
Wed Dec 09, 2015 6:45 am
by mflorell
Just add this to your [trunkinbound] context in extensions.conf:
; If you have DIDs that arrive with a plus and 1 at the beginning that you want to filter out, then uncomment
exten => _+1X.,1,Goto(trunkinbound,${EXTEN:2},1)