<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I think the function was mainly made to check if it is a
telephone number in international format.</p>
<p>It could be better to make this function more strict in following
the e.164 specs, there is another function to check if it looks
like a telephone number, and as pointed in another response, there
is a module for more strict checking on validity of a phone number
per country...</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 05.12.18 04:10, Patrick Wakano
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAPu3kNUacVaPavP+6BxHp8_TGapQdQMHi36-5-91tAS+zctHtQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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"
moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">https://skalatan.de/blog/</a><br>
Kamailio services - <a href="https://skalatan.de/services"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://skalatan.de/services</a><br>
Kamailio security assessment - <a
href="https://skalatan.de/de/assessment" rel="noreferrer"
target="_blank" moz-do-not-send="true">https://skalatan.de/de/assessment</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a>
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a></pre>
</body>
</html>