SuiteCRM Integration With PBX: Number lookups

I am working on integrating in my CRM with my 3CX PBX. I have gotten the integration to the point that I can successfully do lookups, but now I have the problem of dealing with different number formats.

When the PBX sends the API call to the CRM, it sends it the number as (15552223333). If the number happens to be in the CRM in that format, then it will return the right contact.

The problem is when a number in 10-digit format. Even if that contact is in the CRM, it won’t find it (because it only looks for exactly that number).

Is there any way around this?

You can try getting SQL to strip unwanted characters (like spaces, (, ), +) before comparing. You might need to also remove country prefixes…

Something like this

This problem has been solved before, you will find some solutions online (not specific to SuiteCRM, but to MySQL)