<p></p>
<h3>Description</h3>
<p>Parsing a number using <code>phonenum_match_cn()</code> doesn't honor the country code filter.</p>
<h4>Reproduction</h4>
<p>I have the following in code:</p>
<pre><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;
        }
    }
</code></pre>
<p>Using <code>+15162085XXX</code> as an example, I'm getting the following when passing that snippet of code:</p>
<pre><code>Oct  1 19:31:11 sbc01 sbc[17850]: NOTICE: {1 102 INVITE 05d2e55e06832c71060e69b630cd5c6d@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)
</code></pre>
<p>I would expect this case to return <code>$phn(src=>valid)=0</code></p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio version</strong>:</li>
</ul>
<pre><code>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
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>Distributor ID:  Debian
Description:    Debian GNU/Linux 9.13 (stretch)
Release:        9.13
Codename:       stretch
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2495">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZLXQK7VLYAWVYHZ77DSIUSCXANCNFSM4SBDWNNA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZPY7YXOTCSBFHHHLA3SIUSCXA5CNFSM4SBDWNNKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KUDZKQA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2495",
"url": "https://github.com/kamailio/kamailio/issues/2495",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>