<div><div dir="auto">You might also want to have a look at the “phonenum” module...</div></div><div dir="auto"><br></div><div dir="auto"><div><a href="https://www.kamailio.org/docs/modules/5.2.x/modules/phonenum.html">https://www.kamailio.org/docs/modules/5.2.x/modules/phonenum.html</a></div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 4, 2018 at 19:12 Patrick Wakano <<a href="mailto:pwakano@gmail.com">pwakano@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Thanks for the replies guys!</div><div>I will probably add a length test to invalidate too short numbers!<br></div><div>By the way, I had a quick look in the ITU recommendation (<a href="https://www.itu.int/rec/T-REC-E.164/en" target="_blank">https://www.itu.int/rec/T-REC-E.164/en</a>) and looks like the short numbers are for local purposes only being part of the "Non-ITU-T E.164 numbers" section, so I guess the function should return false in this case. Also it seems the + sign is recommended but not mandatory for a E.164 number, which is quite confusing.....<br></div><div><br></div><div>Kind regards,</div><div>Patrick Wakano<br></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 4 Dec 2018 at 08:57, Henning Westerholt <<a href="mailto:hw@kamailio.org" target="_blank">hw@kamailio.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Montag, 3. Dezember 2018, 06:08:27 CET schrieb Patrick Wakano:<br>
> I am using the is_e164() function to validate the number we receive, and I<br>
> come to see that the number +555 was accepted....<br>
> After some googling it looks like(it is not very clear though) that 7<br>
> digits are the minimum we could have for e164 numbers but after checking<br>
> the source code, I saw it accepts anything starting with + and having<br>
> between 2 and 16 numbers. So is it really valid to have a number with just<br>
> 2 digits? What is the case?<br>
<br>
Hello Patrick,<br>
<br>
I think the implementation was done with a pragmatic approach, to make sure <br>
that we don't reject numbers that are used in the field. The ITU standard <br>
Amendment A mentions the possibility to use national short numbers, for <br>
example. The standard mentions that the maximal length should be 15, but I <br>
think in this case this was also implemented a bit more relaxed.<br>
<br>
The original implementation from the enum module allows even longer numbers, I <br>
will check if this should be synchronized.<br>
<br>
Best regards,<br>
<br>
Henning<br>
<br>
<br>
-- <br>
Henning Westerholt - <a href="https://skalatan.de/blog/" rel="noreferrer" target="_blank">https://skalatan.de/blog/</a><br>
Kamailio services - <a href="https://skalatan.de/services" rel="noreferrer" target="_blank">https://skalatan.de/services</a><br>
Kamailio security assessment - <a href="https://skalatan.de/de/assessment" rel="noreferrer" target="_blank">https://skalatan.de/de/assessment</a><br>
</blockquote></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>