Remove Multiple Phone Codes from Inbound CallerID

All installation and configuration problems and questions

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

Remove Multiple Phone Codes from Inbound CallerID

Postby elyc1990 » Wed Aug 29, 2018 11:32 am

We are running a campaign to multiple countries. The outbound phone number is the same for all destination numbers (e.g. 1X.)

When we receive call backs from clients, the inbound clients' callerID will be a mixture of callerID from multiple countries with multiple country codes in E164 format. Hence Vicidial is unable to do CIDLookupRC because the phone code and phone numbers are stored separately in vicidial.

1. How do I configure vicidial to parse the country code from the incoming callerID for CIDLookup in Vicidial. If the phone number not available, then Vicidial should store the country code as phone code and phone number in Vicidial database.
2. If the above is not possible, how do I remove the first digit or first 2 digits before passing to Vicidial so that CIDLookupRC can be done. Clean CID Number does not work for multiple country codes. E.g. L1 L44

I'm running VERSION: 2.14-678a BUILD: 180613-0943

Thanks!
elyc1990
 
Posts: 26
Joined: Fri Dec 16, 2016 5:35 am

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby mflorell » Wed Aug 29, 2018 1:36 pm

The only time I've ever run into that the client solved the issue by using a different outbound CID for each country they called.

Other than that, it would probably take some custom dialplan entries to selectively strip down the CID before the calls go to CID routing, or it would take quite a bit of new programming and configuration settings to be able to do this in VICIdial.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby elyc1990 » Wed Aug 29, 2018 1:44 pm

Thanks Matt for your reply!

Is there any way to set different outbound CID according to the destination's country code other than using the security_phrase field? The custom callerID > Area Code doesn't seem to work for country code (what I did was to set custom callerID > Area Code, key in country code under "Area Code" of AC-CID page).
elyc1990
 
Posts: 26
Joined: Fri Dec 16, 2016 5:35 am

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby williamconley » Wed Aug 29, 2018 1:54 pm

DID modify: Clean CID Number will allow some rudimentary editing.

There is also a Javascript/PHP function out there in the wild that will determine a true phone number given the full dial string. It will split the number into the various component parts quite well as long as it's all there to begin with. We've used it for a few clients over the years, although we've had to debug the ones we've found first (ie: debug the code, as it inevitably has a bug in the country our "LIVE" client is actually using) .

I'm surprised that code has never found its way inside Vicidial, honestly. It would be a great option for the clean cid number routine. When combined with an appropriate AGI script, it could edit the channel before continuing quite nicely.

If you have no luck finding it, let me know. Our cleaned up version isn't a secret, it's just buried in "old code" somewhere.
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: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby mflorell » Wed Aug 29, 2018 8:08 pm

Our client separated each country's leads into it's own lists and used the List's "Campaign CID Override" setting to do that.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby williamconley » Wed Aug 29, 2018 8:30 pm

Considering how cheap DIDs are these days, that's a worthy, simple method. May not work as well for clients who have hundreds of campaigns spannin multiple countries, though. (Yep, we've got a few of those.)

But those guys have never complained of CID issues. May be a carrier-based issue or ... maybe they just store the entire number as phone number and skip the phone code entirely. Or a little of both.
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: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby dspaan » Thu May 23, 2019 1:26 pm

williamconley wrote:DID modify: Clean CID Number will allow some rudimentary editing.

There is also a Javascript/PHP function out there in the wild that will determine a true phone number given the full dial string. It will split the number into the various component parts quite well as long as it's all there to begin with. We've used it for a few clients over the years, although we've had to debug the ones we've found first (ie: debug the code, as it inevitably has a bug in the country our "LIVE" client is actually using) .

I'm surprised that code has never found its way inside Vicidial, honestly. It would be a great option for the clean cid number routine. When combined with an appropriate AGI script, it could edit the channel before continuing quite nicely.

If you have no luck finding it, let me know. Our cleaned up version isn't a secret, it's just buried in "old code" somewhere.


Hey William, can you please share this script? Setting up multiple CID's and lists won't do much good if you have clients from multiple countries just dialing in and wanting to use the PRESS_CALLBACK_QUEUE feature for instance. It only works if you leave clean CID number and phone code empty in the DID but then the CIDLOOKUP feature won't work anymore for potential outbound leads.
Regards, Dennis

Vicibox 9.0.1
Version: 2.14b0.5
SVN Version: 3199
DB Schema Version: 1588
Build: 200310-1801
dspaan
 
Posts: 1377
Joined: Fri Aug 21, 2009 1:40 pm
Location: The Netherlands

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby williamconley » Thu May 23, 2019 4:24 pm

I will see if I can find a copy. Wait! I think I put it on one of our internal "main wiki pages" for easy reference. Lemme check ...

https://github.com/googlei18n/libphonenumber/

Not only did I post it on one of our internal "quik linx" pages, the bottom of the page has a link to the apparent original source.

We did have to make some repairs, but we imported this several years ago so it may be better by now.

We run it in php and have used it to validate entire massive lists of phone numbers in sequence, however, and I can tell you that it works really well even if the "defaults" are ignored and left blank.
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: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby dspaan » Fri May 24, 2019 3:32 am

Thanks! And at which point in the process would you advise to run this script? Can trigger the script somewhere in the modify DID page?
Regards, Dennis

Vicibox 9.0.1
Version: 2.14b0.5
SVN Version: 3199
DB Schema Version: 1588
Build: 200310-1801
dspaan
 
Posts: 1377
Joined: Fri Aug 21, 2009 1:40 pm
Location: The Netherlands

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby williamconley » Fri May 24, 2019 12:39 pm

Filter URL

but if this is not yet a lead, there may be a ... challenge. You'll have to play with it to see how useful that is OR perhaps push to an AGI after creating the lead or ...?
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: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby jamiemurray » Sun Aug 23, 2020 8:29 am

Just checking if anything came of this before I embark on some customisation (that I'll of course be happy to share back for consideration with inclusion in trunk).

My situation is that I always deliver callerid(num) in E164 to my clients' dialers and sometimes rather than them agreeing to use multiple DID's for multi country dialing, they'll use the same one. EG: UK (44) and Ireland (353) will both get called from a 44 caller ID. Or 49 (Germany), 41 (Switzerland), 43 (Austria) always get called from a 43 Caller ID. Mainly because 49 DID's require physical address in Germany to obtain and use one. I guess an easier way to think of it is that it's a caller id per language, not country.

My thoughts on achieving this would be:

Per DID Settings added to Add / Edit DID:
* E164 Caller ID Cleaning (0,1) [Help: If set to 1, all calls on this did will have the country code split from the callerid. Any ingroup routing that occurs after passing through this DID will use the country code split from this caller ID as the phone_code before doing lookups or adding new leads. ]

* Caller ID Number Prefix for Phones: [Help: This allows you to add a prefix to the caller id such as 9 for an outside line or international trunk prefix like 00 or 011 to an e164 callerid before passing the call to a phone, this is useful if you have custom dialplan contexts for the destination phone and you want to make the number in the call register dialable for end users without having to edit before dialing.] Nice to have since some of my clients have prefixes on their manual phones to switch caller id dynamically by placing codes like 901, 902, 903 before the number they're dialing but I can see it being useful in many situations especially for users with little asterisk dialplan knowledge.

agi-DID_route.agi would be edited to run a lookup on vicidial_phone_codes table and find a valid country code using the first 3, 2 or 1 digits of the caller id and strip that country_code from the caller_id if E164 Caller ID Cleaning is set to 1 in did settings.

agi-VDAD_ALL_inbound.agi would be edited to check if E164 caller id cleaning was carried out on the call before, and replace the phone_code with the stripped country code from the callerid before performing any lead lookups or adding new leads.

As all checking and editing of caller ID would be done before any lead lookup or addition, I can't think of any ill effects of these changes unless I'm mistaken?
jamiemurray
 
Posts: 179
Joined: Fri Jan 11, 2013 4:12 pm
Location: Tenerife, Canary Islands

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby dspaan » Mon Aug 24, 2020 4:54 pm

We also had a coder who had modified those agi files to clean incoming calls but we didn't get it to work correctly for 100% so we rolled back.

I got a simple solution from vicidial support:

1.Enable custom dialplans in system settings
2.create a callmenu with the name of 'cleaninbound' for instance
3.at the bottom of the callmenu in the custom dialplan add:

exten => _XXXXX.,1,Set(TEMPVAR=${CALLERID(num)})
exten => _XXXXX.,n,Set(CALLERID(num)=${TEMPVAR:2})
exten => _XXXXX.,n,Goto(trunkinbound,${EXTEN},1)

(depending how the call comes in from your provider change :2 to :4 to strip the first 2 or 4 characters)

4.In the carrier add this line: context=cleaninbound

Of course it would be better if the vicidial group would modify the clean CID feature so you can do the above with a code like L2 or L4.

I did ask them to build a feature that allows you to clean calls that are manually dialed and uploaded through the lead loader so the first 0 is stripped. This will also help with matching inbound calls with outbound placed calls.
Regards, Dennis

Vicibox 9.0.1
Version: 2.14b0.5
SVN Version: 3199
DB Schema Version: 1588
Build: 200310-1801
dspaan
 
Posts: 1377
Joined: Fri Aug 21, 2009 1:40 pm
Location: The Netherlands

Re: Remove Multiple Phone Codes from Inbound CallerID

Postby jamiemurray » Sat Aug 29, 2020 4:13 am

I have successfully added e164 cleaning of caller ID without any ill effects.

It is set at DID level so can be enabled or disabled on the add/edit DID administration section and runs before any other caller ID cleaning.

The phone_code is set by the cleaning before onward routing ignoring the phone_code set on either did or call menu routing settings if the e164 clean was used on that call and successful.

All tests have gone well so far. Testing it in production next week, all going well, will post diff files to tracker once production tests are complete.
Skype: live:support_71847 | Tel: (US) +1 646 647 8850 (CA) +1 613 900 6456 (MX) +52 55 9990 3550 (UK) +44 1324 285022 (ES) +34 922 937 384
Managed Hosting - No tech skills required | VoIP Termination & DID numbering | https://jmurraysolutions.com
jamiemurray
 
Posts: 179
Joined: Fri Jan 11, 2013 4:12 pm
Location: Tenerife, Canary Islands


Return to Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 52 guests