<div dir="ltr">Any phonenum users out there? Could really use any kind of input on this... Thanks!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 March 2018 at 20:16, George Diamantopoulos <span dir="ltr"><<a href="mailto:georgediam@gmail.com" target="_blank">georgediam@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 dir="ltr"><div><div><div><div><div><div><div><div>Hello all,<br><br></div>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":<br><br><span style="font-family:monospace,monospace">if ( phonenum_match("1-484-555-8888<wbr>", "src") ) {<br></span><div style="margin-left:40px"><span style="font-family:monospace,monospace">xlog("number norm: $phn(src=>number)\n");<br>xlog("number country: $phn(src=>country)\n");<br>dbg_pv_dump(30, "L_ERR");<br></span></div><span style="font-family:monospace,monospace">}</span><br><br>kamailio will not start:<br><br><span style="font-family:monospace,monospace">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<br>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]<br>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<br>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]<br>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)]<br>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)</span><br><br></div>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)<br><br></div>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:<br><br><span style="font-family:monospace,monospace">phonenum_match("14~8%^88", "src")</span><br><br></div>will result in <span style="font-family:monospace,monospace">dbg_pv_dump</span> reporting:<br><br><span style="font-family:monospace,monospace">"$phn(src=>number)": "14~8%^88"</span><br><br></div>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.<br><br></div>Is this a bug? Or am I missing something? Thanks!<br><br></div>BR,<br></div>George<br></div>
</blockquote></div><br></div>