Hi @all,
I have following problem. I have registered all my phones on OpenSER
with the full number. e.g. 43 11555 1007
When one employee from one site wants to call an employee from the same
site I want them only to dial 1007 not
The whole number. I have following perl script, but when I use the
"canonical" function, it always adds "+" in front of the number.
I get following message:
canonical number in 'sip:1777@server.com' is '+43115551007'
After the execution of the perl script I want to check, if the user with
43115551007:
It looks like this:
if (uri=~"sip:[0-9]+@.*")
{
perl_exec("canonical");
if (does_uri_exist())
{
route(2);
} else {
#route to LCR-Module
route(3);
};
}
But it does not run well.
The script looks like this:
-------------------------------------------------
use OpenSER::Constants;
use OpenSER::Utils::PhoneNumbers;
sub canonical {
my $m = shift;
if ($m->getMethod() eq "INVITE") {
my $p = new
OpenSER::Utils::PhoneNumbers(publicAccessPrefix => "",
internationalPrefix => "",
longDistancePrefix => "",
countryCode =>
"43",
areaCode =>
"11555",
pbxCode => "");
my $u = $m->getRURI();
if ($u =~ m/(.*)sip:([+0-9]+)\@(.*)/) {
my $c = $p->canonicalForm($2);
OpenSER::log(L_INFO, "canonical number in '$u'
is '$c'\n");
} else {
OpenSER::log(L_INFO, "Not a POTS number.\n");
}
}
return 1;
}
Can anyone provide me some help?
Thanks
martin
Show replies by date