<div dir="ltr"><div><div><div><div>Hello Daniel!<br><br></div>Thanks for the lightning fast fix :-). I have tested with both libphonenumber7 and libphonenumber8 and it works with current master now!<br><br></div>Do you think it would be possible add more attributes in the future? Like region and operator? I know the quality of that info is not great but it might be nice to have for some territories. Thanks!<br><br></div>BR,<br></div>George<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 March 2018 at 16:15, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>on the flight to Singapore for Fossasia, I got a bit of time to
      look at it and the main issue was the documentation, it was no
      sync'ed with the code -- the readme listed different attribute
      names.</p>
    <p>In addition, I also found a bug on matching the pv name. Can
      someone test with master branch and if all ok, I will backport.</p>
    <p>For pv attribute names, see wiki at:</p>
    <p>  *
<a class="m_398950588148360876moz-txt-link-freetext" href="https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#phn_rid_key_-_phonenum_variables" target="_blank">https://www.kamailio.org/wiki/<wbr>cookbooks/devel/<wbr>pseudovariables#phn_rid_key_-_<wbr>phonenum_variables</a></p>
    <p>Cheers,<br>
      Daniel<br>
    </p><div><div class="h5">
    <br>
    <div class="m_398950588148360876moz-cite-prefix">On 21.03.18 13:09, Anthony Joseph
      Messina wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <pre>George, I do see the same problem, though I haven't had time to investigate 
yet.  -A

On Monday, March 19, 2018 1:16:17 PM CDT George Diamantopoulos wrote:
</pre>
      </div></div><blockquote type="cite"><div><div class="h5">
        <pre>Hello all,

It seems that the phonenum module in at least 5.1.2 (haven't tried previous
versions) is behaving somewhat erratically. More specifically, if there are
any references to any phn PVs with the key other than "number":

if ( phonenum_match("1-484-555-<wbr>8888", "src") ) {
xlog("number norm: $phn(src=>number)\n");
xlog("number country: $phn(src=>country)\n");
dbg_pv_dump(30, "L_ERR");
}

kamailio will not start:

Mar 19 20:06:49 modcom-sbc-dev1 kamailio[5042]:  0(5044) DEBUG: <core>
[core/pvapi.c:494]: pv_spec_lookup(): PV <$phn(src=>country)> is not in
cache
Mar 19 20:06:49 modcom-sbc-dev1 kamailio[5042]:  0(5044) DEBUG: phonenum
[phonenum_pv.c:160]: pv_parse_phonenum_name(): phonenum [src] - key
[country]
Mar 19 20:06:49 modcom-sbc-dev1 kamailio[5042]:  0(5044) ERROR: phonenum
[phonenum_pv.c:205]: pv_parse_phonenum_name(): error at PV phonenum name:
src=>country
Mar 19 20:06:49 modcom-sbc-dev1 kamailio[5042]:  0(5044) ERROR: <core>
[core/pvapi.c:951]: pv_parse_spec2(): pvar "phn" has an invalid name param
[src=>country]
Mar 19 20:06:49 modcom-sbc-dev1 kamailio[5042]:  0(5044) ERROR: <core>
[core/pvapi.c:1106]: pv_parse_spec2(): wrong char [)/41] in
[$phn(src=>country)] at [17 (5)]
Mar 19 20:06:49 modcom-sbc-dev1 kamailio[5042]:  0(5044) ERROR: xlog
[xlog.c:513]: xdbg_fixup_helper(): wrong format[number country:
$phn(src=>country)

If I comment the offending line, all is well, but when dumping PVs with
dbg_pv_dump(30, "L_ERR");, only $phn(src=>number) is listed, not the other
keys (country, operator, region according to the docs)

However, what is more disturbing is that phn(src=>number) always contains
the string provided to phonenum_match() function, even if invalid
characters are included, with no normalization. For example:

phonenum_match("14~8%^88", "src")

will result in dbg_pv_dump reporting:

"$phn(src=>number)": "14~8%^88"

Please note that I'm using sipwise's debian repository for stretch for
kamailio, and debian's stable stretch repository for libphonenumnber
(currently at 7.1.0-5+b1). I have also tried building current
libphonenumber myself (version v8.9.2), but the result is the same.

Is this a bug? Or am I missing something? Thanks!

BR,
George
</pre>
        <br>
        <fieldset class="m_398950588148360876mimeAttachmentHeader"></fieldset>
        <br>
        </div></div><pre>______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="m_398950588148360876moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="m_398950588148360876moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
      </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre class="m_398950588148360876moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_398950588148360876moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_398950588148360876moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="m_398950588148360876moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_398950588148360876moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
  </font></span></div>

<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">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/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div>