[SR-Users] is_e164 logic to detect valid number

Henning Westerholt hw at kamailio.org
Mon Dec 3 22:57:21 CET 2018


Am Montag, 3. Dezember 2018, 06:08:27 CET schrieb Patrick Wakano:
> I am using the is_e164() function to validate the number we receive, and I
> come to see that the number +555 was accepted....
> After some googling it looks like(it is not very clear though) that 7
> digits are the minimum we could have for e164 numbers but after checking
> the source code, I saw it accepts anything starting with + and having
> between 2 and 16 numbers. So is it really valid to have a number with just
> 2 digits? What is the case?

Hello Patrick,

I think the implementation was done with a pragmatic approach, to make sure 
that we don't reject numbers that are used in the field. The ITU standard 
Amendment A mentions the possibility to use national short numbers, for 
example. The standard mentions that the maximal length should be 15, but I 
think in this case this was also implemented a bit more relaxed.

The original implementation from the enum module allows even longer numbers, I 
will check if this should be synchronized.

Best regards,

Henning


-- 
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
Kamailio security assessment - https://skalatan.de/de/assessment



More information about the sr-users mailing list