Cleaning the frist '1' from CID

Any and all non-support discussions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Cleaning the frist '1' from CID

Postby Lincoln » Thu Dec 03, 2015 8:11 am

Dear,

I have an INGROUP, when it receive a callerid beginning with '1', vicidial removes it and send like callerid without it, example, 119XXXXXXX is send like 19XXXXXXX.

I noted this problem don't occurs with others digits, i. e., [2-9]9XXXXXXX.

I think this is controlled by some configuration parameter, but i can't find it. Can you help me?

Thanks in advaced.

Lincoln.
Last edited by Lincoln on Thu Dec 03, 2015 8:24 am, edited 1 time in total.
Lincoln
 
Posts: 6
Joined: Thu Dec 03, 2015 7:34 am

Re: Cleaning the frist '1' from CID

Postby mflorell » Thu Dec 03, 2015 8:24 am

This is a standard feature for when calls come in to a DID. Look for the Clean CID Number feature.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Cleaning the frist '1' from CID

Postby Lincoln » Thu Dec 03, 2015 8:36 am

Lincoln wrote:Dear,

I have an INGROUP, when it receive a callerid beginning with '1', vicidial removes it and send like callerid without it, example, 119XXXXXXX is send like 19XXXXXXX.

I noted this problem don't occurs with others digits, i. e., [2-9]9XXXXXXX.

I think this is controlled by some configuration parameter, but i can't find it. Can you help me?

Thanks in advaced.

Lincoln.


note: the option Clean CID Number is empty.
Lincoln
 
Posts: 6
Joined: Thu Dec 03, 2015 7:34 am

Re: Cleaning the frist '1' from CID

Postby williamconley » Thu Dec 03, 2015 9:55 am

Lincoln wrote:note: the option Clean CID Number is empty.

How do you know that Vicidial removes the 1? How do you know the 1 was there in the first place?
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cleaning the frist '1' from CID

Postby Lincoln » Thu Dec 03, 2015 10:59 am

Because the call comes from a cell phone, in case the ' 1 ' is a part of area code it would be ' 11 ' and we have no 10 digit phone numbers with this area code.

And the call goes through another system integrated with vicidial where can I view the full number

Besides I was in doubt because the code of USA is 1, and it could be influencing


I from Brazil.
Last edited by Lincoln on Thu Dec 03, 2015 11:12 am, edited 1 time in total.
Lincoln
 
Posts: 6
Joined: Thu Dec 03, 2015 7:34 am

Re: Cleaning the frist '1' from CID

Postby williamconley » Thu Dec 03, 2015 11:10 am

Lincoln wrote:Because the call comes from a cell phone, in case the ' 1 ' is a part of area code it would be ' 11 ' and we have no 10 digit phone numbers with this area code.

And the call goes through another system integrated with vicidial where can I view the full number

I from Brazil.

Have a look at the SIP debug or put a "NoOp" in your inbound calls to play the CID to the screen. Until you've seen the CID on THIS server, you're just guessing. I generally have "a talk" with technicians who guess instead of Checking. But you don't work for me, so we'll let it slide this time. LOL 8-)

Add this to the top of [trunkinbound] in extensions.conf:
Code: Select all
[trunkinbound]
exten => _X.,1,NoOp(X|${EXTEN}|CID${CALLERID(NUM)}|SIPID${SIPCALLID}|SIPDO${SIPDOMAIN}|SIPUA${SIPUSERAGENT}|SIPURI${SIPURI}|CODEC${SIP_CODEC}|SIPURIO${SIP_URI_OPTIONS}|AU${RTPAUDIOQOS}|VI${RTPVIDEOQOS}|H${HINT})


Note that you'll need to change the existing ",1," entry to ",2," or perhaps to ",n," (there can only be 1 ... 1, LOL)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cleaning the frist '1' from CID

Postby Lincoln » Thu Dec 03, 2015 12:35 pm

Dear,

Thank you for your cooperation, I will perform more tests and with your suggestion

regards
Lincoln
 
Posts: 6
Joined: Thu Dec 03, 2015 7:34 am

Re: Cleaning the frist '1' from CID

Postby proper » Sun Dec 06, 2015 7:35 pm

Lincoln, phone_number field in vicidial_list table is limited to 10 characters. This means that even if you inserted leads with country code attached, those numbers are not usable because only first 10 characters will make it in to the field.

For example - if you try to insert 12223334444, only 1222333444 will be added. If this happened, your phone numbers are corrupted and you will need to reload your data.

To test, simply search your new leads in lists you suspect to have this issue by going to Admin -> Search for a lead. You can also download the list in question and review it in Excel or just access the database directly and pull up leads in vicidial_list table.

Remember that all numbers you are uploading must be 10 digits and country code is separate value, stored in separate field.

Good luck.
proper
 
Posts: 50
Joined: Sun Dec 06, 2015 7:25 pm

Re: Cleaning the frist '1' from CID

Postby williamconley » Sun Dec 06, 2015 7:56 pm

proper wrote:Lincoln, phone_number field in vicidial_list table is limited to 10 characters. ...

Um ... nope.

Code: Select all
phone_number   varchar(18)   utf8_unicode_ci
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cleaning the frist '1' from CID

Postby proper » Sun Dec 06, 2015 8:29 pm

williamconley wrote:
proper wrote:Lincoln, phone_number field in vicidial_list table is limited to 10 characters. ...

Um ... nope.

Code: Select all
phone_number   varchar(18)   utf8_unicode_ci



You are right, my mistake.

Then these is hope for you, run query like this -

Code: Select all
UPDATE vicidial_list SET phone_number = TRIM(LEADING '1' FROM phone_number)


To prevent this query from touching normal records you can add char_lenght to make sure phone number is over 10 characters before updating, like this:

Code: Select all
 UPDATE vicidial_list SET phone_number = TRIM(LEADING '1' FROM phone_number) WHERE CHAR_LENGTH(phone_number)>'10'


Make sure to backup your list table and do limited tests before running full scale.

Hope it helps - good luck
Last edited by proper on Sun Dec 06, 2015 8:43 pm, edited 1 time in total.
proper
 
Posts: 50
Joined: Sun Dec 06, 2015 7:25 pm

Re: Cleaning the frist '1' from CID

Postby williamconley » Sun Dec 06, 2015 8:41 pm

proper wrote:UPDATE vicidial_list SET phone_number = TRIM(LEADING '1' FROM phone_number) WHERE list_id IN ('100','200') LIMIT 200

Hope it helps - good luck

Um ... LOL ... but he's NOT in the US, and it appears his area codes could start with 1. Which means he would be killing part of the area code in some situations. Probably not the goal. Not everyone dials in the US. :)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cleaning the frist '1' from CID

Postby proper » Sun Dec 06, 2015 8:49 pm

williamconley wrote:
proper wrote:UPDATE vicidial_list SET phone_number = TRIM(LEADING '1' FROM phone_number) WHERE list_id IN ('100','200') LIMIT 200

Hope it helps - good luck

Um ... LOL ... but he's NOT in the US, and it appears his area codes could start with 1. Which means he would be killing part of the area code in some situations. Probably not the goal. Not everyone dials in the US. :)


You have a valid point William, that is why I recommended to limit update to specific list, it is likely that only some lists were affected. It can be tricky to spot affected lists for someone unfamiliar with DB, so I added query with char_lenght to size the number before making changes.

If his numbers are not US then he needs to adjust lenght limit to what ever fits to his phone number structure.
proper
 
Posts: 50
Joined: Sun Dec 06, 2015 7:25 pm

Re: Cleaning the frist '1' from CID

Postby williamconley » Sun Dec 06, 2015 11:03 pm

We have a number validator, which we acquired from google code, that we've used for several international clients who need to fix their incoming lists. The google code does require identification of the country in some cases, but it's capable of fully formatting numbers as long as there is enough available to technically identify it, and the final number will be proper for dialing in Vicidial.

It's also been installed with a "drag and drop" interface we built to allow moving lists between Campaigns for one special client. Each campaign is a column header with all its lists beneath. Dragging a list moves it to the new campaign. Not sure why they need it, but they do apparently like to be able to move lists between campaigns "at will", LOL.

That being said: Caution is definitely called for, and creating a filter that will properly format a number for the country in question is MUCH better than "remove 1 from the start of a string". This can also be done with mysql, of course ... IF you know the dial pattern for the country.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cleaning the frist '1' from CID

Postby rasel » Mon Jan 18, 2021 9:35 am

Was there a solution to this?

Ive tried Clean CID Number:
aswell as
editing the trunkinbound extension and resetting the server with different changes tryng to troubleshoot.
Clean CID Number: R10 also L1 and nothing

also tried changing extensions.conf of trunkinbound

exten => _+1X.,1,Goto(trunkinbound,${EXTEN:2},1)
and exten => _1X.,1,Goto(trunkinbound,${EXTEN:1},1)
and nothing


centos7

VERSION: 2.14-772a
BUILD: 201004-1045
© 2020 ViciDial Group
rasel
 
Posts: 8
Joined: Sun Jan 26, 2020 3:25 pm

Re: Cleaning the frist '1' from CID

Postby williamconley » Mon Jan 18, 2021 10:23 am

"and nothing"? Did the server shut off? what happened? Show some asterisk CLI with what actually happened and what you would like to have happen and perhaps someone can assist.

Are you simply trying to remove the +, 1, +1 prefixes if/when present? Or something more?

Code: Select all
[trunkinbound]
; DID call routing process
; use this one instead of the one below if you are having delay issues,
; and match to number of received digits
; exten => _XXXXXXXXXX,n,AGI(agi-DID_route.agi)
; For even more speed, you can put in the real DIDs instead of XXXXXXXXXX
; (remove the _ in that case)
exten => _X.,1,NoOp(X,${EXTEN},${CALLERID(NUM)})
exten => _X.,n,AGI(agi-DID_route.agi)
; Catch all even with unexpected first digits (will show in CLI for troubleshooting)
exten => _!,1,Noop(!,${EXTEN},${CALLERID(NUM)})
exten => _!,n,AGI(agi-DID_route.agi)
exten => s,1,NoOp(${EXTEN},${CALLERID(NUM)})
exten => s,n,AGI(agi-DID_route.agi)
; removal of Leading Plus Sign from the the phone
exten => _+X!,1,Noop(Stripping + from start of number, for annoying carriers who insist)
exten => _+X!,n,Goto(trunkinbound,${EXTEN:1},1)
; removal of Leading 1 from the the phone (US numbers only, for annoying carriers who insist)
exten => _1!,1,Noop(Stripping 1 from start of number)
exten => _1!,n,Goto(trunkinbound,${EXTEN:1},1)

; FastAGI for VICIDIAL/astGUIclient call logging
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cleaning the frist '1' from CID

Postby rasel » Mon Jan 18, 2021 11:19 am

Hi William,

I appreciate the response,

I have a crm that requires 10digits, however inbound keeps adding a 1 infront of incoming lead phone number.

my current settings are
[trunkinbound]
; DID call routing process
; exten => _XXXXXXXXXX,1,AGI(agi-DID_route.agi) ; use this one instead of the one below if you are having delay issues, and match to number of received digits
exten => _X.,1,AGI(agi-DID_route.agi)
exten => _X.,n,Hangup()
; If you have DIDs that arrive with a plus sign at the beginning then uncomment
;exten => _+X.,1,AGI(agi-DID_route.agi)
;exten => _+X.,n,Hangup()
exten => _1X.,1,Goto(trunkinbound,${EXTEN:1},1)

sip set debug on
<--- Reliably Transmitting (no NAT) to 46.19.209.14:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 46.19.209.14;branch=z9hG4bKr3iTSaUE;received=46.19.209.14;rport=5060
From: "167883586xx" <sip:167883586xx@46.19.209.xx>;tag=24-5D86F21A-6005B36400012B75-FE4E6700
To: <sip:67821864xx@209.126.x.xx:2560>;tag=as7bfe45ff

I need for the "From" number to be 10 digits inorder for crm to recognize it. How can i do this?

thank you




williamconley wrote:"and nothing"? Did the server shut off? what happened? Show some asterisk CLI with what actually happened and what you would like to have happen and perhaps someone can assist.

Are you simply trying to remove the +, 1, +1 prefixes if/when present? Or something more?

Code: Select all
[trunkinbound]
; DID call routing process
; use this one instead of the one below if you are having delay issues,
; and match to number of received digits
; exten => _XXXXXXXXXX,n,AGI(agi-DID_route.agi)
; For even more speed, you can put in the real DIDs instead of XXXXXXXXXX
; (remove the _ in that case)
exten => _X.,1,NoOp(X,${EXTEN},${CALLERID(NUM)})
exten => _X.,n,AGI(agi-DID_route.agi)
; Catch all even with unexpected first digits (will show in CLI for troubleshooting)
exten => _!,1,Noop(!,${EXTEN},${CALLERID(NUM)})
exten => _!,n,AGI(agi-DID_route.agi)
exten => s,1,NoOp(${EXTEN},${CALLERID(NUM)})
exten => s,n,AGI(agi-DID_route.agi)
; removal of Leading Plus Sign from the the phone
exten => _+X!,1,Noop(Stripping + from start of number, for annoying carriers who insist)
exten => _+X!,n,Goto(trunkinbound,${EXTEN:1},1)
; removal of Leading 1 from the the phone (US numbers only, for annoying carriers who insist)
exten => _1!,1,Noop(Stripping 1 from start of number)
exten => _1!,n,Goto(trunkinbound,${EXTEN:1},1)

; FastAGI for VICIDIAL/astGUIclient call logging
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
rasel
 
Posts: 8
Joined: Sun Jan 26, 2020 3:25 pm

Re: Cleaning the frist '1' from CID

Postby williamconley » Mon Jan 18, 2021 11:22 am

Sorry: I understood DID instead of CID.

Striker's answer appears to be on point:

viewtopic.php?f=4&t=40597&p=145816#p145816

However, I've never had the Clean CID Number (in the Modify DID settings) fail.

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.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 50 guests