[SR-Users] Phonenum module

Igor Olhovskiy igorolhovskiy at gmail.com
Fri Nov 1 10:10:07 CET 2019


Hi!

I'm playing around libphonenum to get validation accross e.164 numbers.

So, idea is simple
if (phonenum_match($fU, "src_num")) {
if ($phn(src_num=>valid) != 1) {
send_reply("400", "Invalid e.164 format");
xlog("L_ALERT","ALERT: FU: $fU is not e.164 number $phn(src_num=>error)\n");
exit;
}
}

But on every (actually valid e.164 number like 380442459966 or 61388141397) I got Parsing number failed in error result.
Tried both phonenum_match($fU, "src_num") and phonenum_match("$fU", "src_num")
Actually phonenum_match("380442459966", "src_num") also not working
Debian 10 Buster
version: kamailio 5.2.5 (x86_64/linux)
libphonenumber7 is already the newest version (7.1.0-5+b4).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191101/8b71ae7f/attachment.html>


More information about the sr-users mailing list