Module: kamailio
Branch: master
Commit: 9b6243d20a4dd27e44c6f7bada757226c6f4aa63
URL: https://github.com/kamailio/kamailio/commit/9b6243d20a4dd27e44c6f7bada75722…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2020-10-02T21:46:11+02:00
modules: readme files regenerated - phonenum ... [skip ci]
---
Modified: src/modules/phonenum/README
---
Diff: https://github.com/kamailio/kamailio/commit/9b6243d20a4dd27e44c6f7bada75722…
Patch: https://github.com/kamailio/kamailio/commit/9b6243d20a4dd27e44c6f7bada75722…
---
diff --git a/src/modules/phonenum/README b/src/modules/phonenum/README
index ebe872869b..096a3efa4b 100644
--- a/src/modules/phonenum/README
+++ b/src/modules/phonenum/README
@@ -161,6 +161,13 @@ if(phonenum_match("1-484-555-8888", "src")) {
letter, e.g: "DE", "US", "ES"). The function has to be called before
accessing a key via: $phn(pvc=>key).
+ Note from libphonenumber library docs: country name code is the region
+ that is expected the number to be from. It is only used if the number
+ being parsed is not written in international format. The country code
+ for the number in this case would be stored as that of the region
+ supplied. If the number is guaranteed to start with a '+' followed by
+ the country calling code, then region 'ZZ'.
+
The parameters can be static strings or strings with variables.
It can be used from ANY_ROUTE.
### Description
Parsing a number using `phonenum_match_cn()` doesn't honor the country code filter.
#### Reproduction
I have the following in code:
```
if (phonenum_match_cn("$fU", "PA", "src")) {
if($phn(src=>valid)==1) {
xlog("L_NOTICE", "Caller is type: (V=$phn(src=>valid) | N=$phn(src=>number) | NN=$phn(src=>normalized) | CC=$phn(src=>cctel) | ISO=$phn(src=>ccname) | T=$phn(src=>ltype) | D=$phn(src=>ndesc))\n");
return;
}
}
```
Using `+15162085XXX` as an example, I'm getting the following when passing that snippet of code:
```
Oct 1 19:31:11 sbc01 sbc[17850]: NOTICE: {1 102 INVITE 05d2e55e06832c71060e69b630cd5c6d(a)A.B.C.D} <script>: Caller is type: (V=1 | N=+15162085XXX | NN=+15162085XXX | CC=1 | ISO=US | T=fixed-line-or-mobile | D=New York)
```
I would expect this case to return `$phn(src=>valid)=0`
### Additional Information
* **Kamailio version**:
```
version: kamailio 5.4.1 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 6.3.0
```
* **Operating System**:
```
Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch
```
--
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
Module: kamailio
Branch: master
Commit: dfd6c3966ed70d111a9196076bc29767c395d814
URL: https://github.com/kamailio/kamailio/commit/dfd6c3966ed70d111a9196076bc2976…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-02T21:38:16+02:00
phonenum: note about the role of country code name for phonenum_match_cn()
---
Modified: src/modules/phonenum/doc/phonenum_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/dfd6c3966ed70d111a9196076bc2976…
Patch: https://github.com/kamailio/kamailio/commit/dfd6c3966ed70d111a9196076bc2976…
---
diff --git a/src/modules/phonenum/doc/phonenum_admin.xml b/src/modules/phonenum/doc/phonenum_admin.xml
index d30c2026ee..f3a3e98ede 100644
--- a/src/modules/phonenum/doc/phonenum_admin.xml
+++ b/src/modules/phonenum/doc/phonenum_admin.xml
@@ -156,6 +156,14 @@ if(phonenum_match("1-484-555-8888", "src")) {
(two letter, e.g: "DE", "US", "ES"). The function has to be called
before accessing a key via: $phn(pvc=>key).
</para>
+ <para>
+ Note from libphonenumber library docs: country name code is the region
+ that is expected the number to be from. It is only used if the number
+ being parsed is not written in international format. The country code
+ for the number in this case would be stored as that of the region
+ supplied. If the number is guaranteed to start with a '+' followed
+ by the country calling code, then region 'ZZ'.
+ </para>
<para>
The parameters can be static strings or strings with variables.
</para>
Hello,
Kamailio SIP Server v5.2.8 stable release is out.
This is a maintenance release of the old stable branch (5.2), that includes fixes since the release of v5.2.7. There are no change to database schema or configuration language structure that you have to do on previous installations of v5.2.x. Unless major regressions are discovered after the release, this will be the last release of the 5.2 stable branch. The current stable branches 5.3 and 5.4 will continue to be maintained.
Deployments running previous v5.2.x versions are strongly recommended to be upgraded to v5.2.8.
For more details about version 5.2.8 (including links and guidelines to download the tar file or from GIT repository), visit:
https://www.kamailio.org/w/2020/10/kamailio-5-2-8-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Many thanks to all contributing and using Kamailio!
Cheers,
Henning
--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com<https://gilawa.com/>