The regexes and commands we use to manipulate phone numbers have bugs when dealing with numbers in different countries and odd phone numbers. Clearly phone numbers are more complicated than our regexes. We should use an existing library for manipulating phone numbers.
See discussion here: https://lists.sr.ht/~mil/sxmo-devel/patches/22646#%3C87zgwwncb6.fsf@momi.ca%3E
I suggest using this program https://github.com/Orange-OpenSource/pn (validation + format)
tested using variable length phone numbers - it considers correctly formatted ones in range 7:13 valid (minus the +x country code), resolving #249
On 21-05-19 08:07, ~noneofyourbusiness wrote:
I suggest using this program https://github.com/Orange-OpenSource/pn
That looks promising! Thanks
--
Maarten van Gompel (proycon) https://proycon.anaproy.nl
Oh nice ! And we can also reformat the number. We should then adapt the commit 91fe7fb to use pn. We also use the DEFAULT_NUMBER_PREFIX in the modemmonitor IIRC.
Just for reference, the current implementation for this issue, by ~noneofyourbusiness, is in this patch (v11): https://lists.sr.ht/~mil/sxmo-devel/patches/23028 ... some discussion points are raised there too.
The current plan is to get it packaged, a v12 has been sent to match that https://lists.sr.ht/~mil/sxmo-devel/patches/23075
staceee is working on a v13