Currently you have the following information available when using phonenum_match(num, pvc)
from the phonenum
module:
It would be useful to have access also to the cc
information.
Right now, cctel
outputs the country code (digits) for the number.
Example:
+34123456789 --> cctel = 34
The enhancement would be to add the country code (string) for the number (maybe in the cc
position?):
+34123456789 --> cc = ES
Having a look at the phonenum module code (cphonenumber.cpp
), I understand (with my very little idea of C) that country code (string) information is in fact used to get the country code (digits). So I think it would be only a matter of returning one more key:value:
https://github.com/kamailio/kamailio/blob/master/src/modules/phonenum/cphonenumber.cpp#L138
string regionCode;
_phoneUtil.GetRegionCodeForNumber(parsedNumber, ®ionCode);
res->cctel = _phoneUtil.GetCountryCodeForRegion(regionCode);
Something like (pseudocode, this obviously doesn't work but gives the idea):
string regionCode;
_phoneUtil.GetRegionCodeForNumber(parsedNumber, ®ionCode);
res->cctel = _phoneUtil.GetCountryCodeForRegion(regionCode);
res->cc = regionCode;
So then later in kamailio you can do for example:
xlog("L_INFO", "Call from $phn(src=>cc) to $phn(dst=>cc)\n");
I have also seen that a function to provide this info exists in the module level, but I haven't seen it used anywhere else but the declaration:
https://github.com/kamailio/kamailio/blob/master/src/modules/phonenum/cphonenumber.cpp#L94
This feels like a really easy change and I tried to do it myself, but I didn't manage to get through the complete path from "getting the info" to "making it available in the pvc" so here I am asking for help.
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.