How to handle different number formats?

Status
Not open for further replies.

rmnnet

Customer
Joined
Feb 12, 2021
Messages
13
Reaction score
4
I'm working on a CRM integration with ERPNext. ERPNext will allow users to input phone numbers in pretty much any format (11-digit, E.164, 7-digit, whatever).

I'm trying to figure out the best way to ensure that 3CX will find the appropriate Contact/Lead, even if the format doesn't actually match the dialed number.

Is there a way to concatenate and strip digits from the number variable?
 
  • Like
Reactions: ENG
Unfortunately, 3CX is going to look for the phone number based on what comes in from your SIP provider. Maybe you could clean up the phone numbers a bit with number reformatting on your inbound rules, but (801) 642-4655 and +18016424655 and 8016424655 Ext 100, and 6424655 are all different strings.

The first step would be to run an update query that cleans up ERPNext phone number data. However, usually a CRM will display a phone number in one format and save the data in the database table with just digits and no spaces. If that is not the case with ERPNext, perhaps they will allow you to employ a phone number mask? Alternatively, I would submit an enhancement request with ERPNext to enforce the desired format.

You are going to struggle to make the CRM integration work consistently even after initially cleaning up the data and training your users to enter phone numbers in a specific format. Users are inconsistent.
 
Unfortunately, 3CX is going to look for the phone number based on what comes in from your SIP provider. Maybe you could clean up the phone numbers a bit with number reformatting on your inbound rules, but (801) 642-4655 and +18016424655 and 8016424655 Ext 100, and 6424655 are all different strings.

The first step would be to run an update query that cleans up ERPNext phone number data. However, usually a CRM will display a phone number in one format and save the data in the database table with just digits and no spaces. If that is not the case with ERPNext, perhaps they will allow you to employ a phone number mask? Alternatively, I would submit an enhancement request with ERPNext to enforce the desired format.

You are going to struggle to make the CRM integration work consistently even after initially cleaning up the data and training your users to enter phone numbers in a specific format. Users are inconsistent.
I'm not sure what you mean by "what comes in from your SIP provider"? I use Twilio as my SIP provider, and Twilio requires numbers to be sent to them with E.164 format. So, I have outbound rules that add/strip digits as needed. If I dial 5551234 with 3CX, and there's a record in ERPNext with 5551234 as the number, 3CX will find it, even though the outbound rules would add +1541

I'm thinking a better option might be to just create a remote procedure call on the ERPNext instance. That way 3CX can send numbers in whatever format it wants, and ERPNext can make sense of it and find the corresponding record.
 
If I understand correctly, you are attempting to query the ERPNext database to see if it can find someone with a matching phone number. Twilio is going to send inbound calls to you with a caller ID number similar to +18016424655. If ERPNext will allow end users to create contacts and assign a 7 digit phone number, the 3CX CRM integration template will not be able to find this number since +18016424655 is not the same as 642-4655. If you are not using the 3CX template, then I suppose you could use whatever logic you want to search for a matching number.
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Forum statistics

Threads
112,322
Messages
591,882
Members
165,467
Latest member
EMMEPICASA