[sr-dev] [kamailio/kamailio] Parsing a number using `phonenum_match_cn()` doesn't restrict the rules with the country name code (#2495)

Daniel-Constantin Mierla notifications at github.com
Fri Oct 2 21:45:58 CEST 2020


The purpose of the country code name is fill full number value when it is in local or national format, not for numbers in the international the format. It doesn't have the role to restrict to be an international number for that country, but to detect if it is a valid local or national format within the country. I added in the docs of the module a note taken from the docs of libphonenumber parse() function:

  * https://javadoc.io/static/com.googlecode.libphonenumber/libphonenumber/8.4.1/com/google/i18n/phonenumbers/PhoneNumberUtil.html#parse-java.lang.String-java.lang.String-

If you want to do country code restrictions, once the match is done, then compare `$phn(src=>ccname)` value.

Of course, a new function can be added to do such extra check internally.

I am going to close this issue, not being a bug, but what libphonenumber is expected to do in such case. For further discussions use sr-users or make PR with a new function.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2495#issuecomment-702924995
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20201002/80504773/attachment-0001.htm>


More information about the sr-dev mailing list