TT#151207 Save CF destinations to fax2mail with new prefix 'fax='

When the "Ignore domain" billing profile option is set, billing
fees will be matched against the 'destination_user_in' CDR field
(Instead of 'destination_user_in@destination_domain').
As a consequence, NGCP services such as vsc, conference, voicebox,
fax2mail cannot longer be charged by defining domain-based fee
entries (e.g. \.local$, @vsc\.local$, @conference\.local$,
@voicebox\.local$ and @fax2mail\.local$). Hence, these services
need to be matched differently when "Ignore domain" is set, if an
operator wants to charge for those services separately.

Only fax2mail calls has not predefined prefix that distinguishes it.
In order to normalize that and fix this issue the panel will create
and save in DB the CD destination for fax2mail with a new prefix:
'fax='.

Change-Id: I926909e46828b43e476c75f2b3e0c51e20a2a5b6
mr11.1
Daniel Grotti 3 years ago
parent 65b5c62e48
commit 878f48a562

@ -221,6 +221,13 @@ sub process_cdr_item {
$other_normalize = 0;
$other_skip_domain = 1;
$resource->{direction} = "out";
# rewrite cf to fax2mail to "fax2mail"
} elsif ($item->destination_user_in =~ /^fax=/ &&
$item->destination_domain_in eq "fax2mail.local") {
$resource->{other_cli} = "fax2mail";
$other_normalize = 0;
$other_skip_domain = 1;
$resource->{direction} = "out";
} else {
# for intra pbx in calls, use extension as other cli
if($intra && $src_sub && $src_sub->pbx_extension) {

@ -1415,7 +1415,7 @@ sub update_subscriber_numbers {
for my $cfset($prov_subs->voip_cf_destination_sets->all) {
for my $cf($cfset->voip_cf_destinations->all) {
if($cf->destination =~ /\@fax2mail\.local$/) {
$cf->update({ destination => 'sip:'.$cli.'@fax2mail.local' });
$cf->update({ destination => 'sip:fax='.$cli.'@fax2mail.local' });
} elsif($cf->destination =~ /\@conference\.local$/) {
$cf->update({ destination => 'sip:conf='.$cli.'@conference.local' });
}
@ -1844,7 +1844,7 @@ sub field_to_destination {
if($d eq "voicebox") {
$d = "sip:".$vm_prefix.$number."\@voicebox.local";
} elsif($d eq "fax2mail") {
$d = "sip:$number\@fax2mail.local";
$d = "sip:fax=$number\@fax2mail.local";
} elsif($d eq "conference") {
$d = "sip:conf=$number\@conference.local";
} elsif($d eq "callingcard") {

Loading…
Cancel
Save