JohnFF / Phone-Number-Validator

Tool for CiviCRM to identify and fix phone numbers according to user defined rules. Unlike the previous version, this supports phone numbers from many countries.
Other
3 stars 4 forks source link

Extension numbers? #27

Closed JoeMurray closed 3 years ago

JoeMurray commented 3 years ago

I was looking through the regex's in Utils and it seems that there is no support for extension numbers. My understanding is that syntax for autodialers is to use a comma , to insert a brief pause. I don't see a need myself for using semicolons for autodialers as they typically require an additiinal user input before continuing with dialing the remaining characters. See e.g. https://support.xmatters.com/hc/en-us/articles/208650746-Mobile-tip-Pauses-and-waits

Would you be willing to accept a pull request in the coming months that made something to support this an optional feature? I would want to figure out the best way to handle cleanup of the various ways that people input extensions so that we could confidently handle most cases. Note this is currently unfunded.

Cheers, Joe

JohnFF commented 3 years ago

Hi Joe,

Yes.

That is a convention I was unaware of. Maybe it's just the US?

One option may be a PR for a regex "US with extension" Another may be to add a hook that would allow people to do their own extensions.

Interested to hear more from you about this.

John.

On Wed, 3 Mar 2021 at 14:45, Joe Murray notifications@github.com wrote:

I was looking through the regex's in Utils and it seems that there is no support for extension numbers. My understanding is that syntax for autodialers is to use a comma , to insert a brief pause. I don't see a need myself for using semicolons for autodialers as they typically require an additiinal user input before continuing with dialing the remaining characters. See e.g. https://support.xmatters.com/hc/en-us/articles/208650746-Mobile-tip-Pauses-and-waits

Would you be willing to accept a pull request in the coming months that made something to support this an optional feature? I would want to figure out the best way to handle cleanup of the various ways that people input extensions so that we could confidently handle most cases. Note this is currently unfunded.

Cheers, Joe

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JohnFF/Phone-Number-Validator/issues/27, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIXUSCJUJ6N3BPF2KQYL3DTBZDPJANCNFSM4YRLRHVQ .

JoeMurray commented 3 years ago

Sounds good. I think there is a standard. I'll try to align this with recent work by @mikey on a dialer extension if we get to it. Cheers!

mikey commented 3 years ago

Wrong @mikey.

JoeMurray commented 3 years ago

Sorry, I meant @MikeyMJCO .

homotechsual commented 3 years ago

Commas are also supported for UK dialing and I believe are pretty much defacto international dialing standard for "Pause". Our recent work resulted in https://civicrm.org/extensions/commlink

Happy to help out with this extension - supporting extension numbers in click-to-call links is a goal along with sms: link handling which there's a core change going for!

homotechsual commented 3 years ago

I think longer-term a version of this extension that uses https://github.com/brick/phonenumber to validate is probably a better solution and a potential candidate for a core extension (we use brick/money already!)

Advantages? You can pass it the extension and it'll format the number properly for that country's dialing conventions.

JohnFF commented 3 years ago

Good suggestion @MikeyMJCO. I've a few other changes I want to make. Before committing, please could you outline what the benefits of using that library over the regexes are?

homotechsual commented 3 years ago

It's well maintained, supports all phone formats, can generate national (local dial) and international dialing formats, supports extensions and I suspect will lessen the maintenance burden of having to maintain the regexes.

JohnFF commented 3 years ago

The purpose of the regices is to surface phone numbers which are incorrect. For example, phone numbers with text in them. It sifts the table and returns any that don't match the pattern. If that extension can help with that, e.g. by providing the regices, great, but at first glance that doesn't appear to be what it would do. I'm not sure how you would visualise it being used in this instance, @mikeyMJCO?