Giter Site home page Giter Site logo

Comments (12)

cbetta avatar cbetta commented on July 30, 2024

@sammachin can't be used for what?

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

So the following doesnt work:

~  nexmo ns NL --sms  
3197010240036
➜  ~  nexmo nb NL 3197010240036
Buying 3197010240036. This operation will charge your account.

Please type "confirm" to continue: confirm

Invalid request :: Not valid number format detected [ 3197010240036 ]

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

So the problem with this is in the API, not the CLI. We have a ticket on Jira to look into this.

It would be nice if we could replace the country lookup the country code from a static file (libphonenumber?) if NI fails.

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

Still an issue.

from nexmo-cli.

sammachin avatar sammachin commented on July 30, 2024

The response I got from Eng. was that we just expose libphonenumber in NI basic and there's an on-going debate there about adding M2M numbers https://github.com/googlei18n/libphonenumber/issues/680

from nexmo-cli.

sammachin avatar sammachin commented on July 30, 2024

I think we might have to put some sort of local workaround in the CLI to catch these dutch numbers so that the CLI can be used with them

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@sammachin so what would that look like?

from nexmo-cli.

sammachin avatar sammachin commented on July 30, 2024

basically a regex thats checked before the NI call and locally returns the country. at the moment its just the dutch M2M numbers which are +31 970 XXXX XXXX so I think the regex would be ^31970\d{8}$

So some sort of function in the code that checks if the number matches the regex and returns NL first and if there's no match falls through to doing an NI check.
Ideally structure it such that we can add more regex's for weird country scenarios in the future if we need to

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

That sounds straightforward. I'll have a look at it.

from nexmo-cli.

sammachin avatar sammachin commented on July 30, 2024

We have a similar issue thats just arisen with using the CLI to set up linking for shortcodes, (eg 61234) There isn't a pattern that we can use to determine the shortcode as potentially the same shortcode could exist in 2 countries as a different address.

As a workaround for thie and the NL issue along with any other 'invald' number formats could we look to see if the number starts with 2 alpha characters and if so skip the NI lookup and force the country code to whatever the letters are, so entering the number as NL31970XXXXXXXX would set to NL, similarly entering US61234 would set the country to US and the number to 61234

This needs to work on the link:sms as well as the number buy functions

from nexmo-cli.

sammachin avatar sammachin commented on July 30, 2024

thinking a bit more about this I think just providing an optional --country_code flag on the number:buy and link:x functions would be the best option, we already have that flag on buy but it doesn't seem to skip the insight function at the moment

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@sammachin agreed, that seems to be the way to go.

from nexmo-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.