MT#16883 Set vmb prefix for cfb to voicemail.

API needs to be checked also!

Change-Id: Ia2368e25ffcdf7a667fe173359c54cffc8577330
changes/92/3692/3
Andreas Granig 10 years ago committed by Gerhard Jungwirth
parent 59bb04b69d
commit e456d6d8c6

@ -1091,6 +1091,7 @@ sub preferences_callforward :Chained('base') :PathPart('preferences/callforward'
domain => $c->stash->{subscriber}->domain->domain,
destination => $d,
uri => $dest->field('uri')->field('destination')->value,
cf_type => $cf_type,
);
$dest_set->voip_cf_destinations->create({
@ -1434,6 +1435,7 @@ sub preferences_callforward_destinationset_create :Chained('base') :PathPart('pr
domain => $c->stash->{subscriber}->domain->domain,
destination => $d,
uri => $dest->field('uri')->field('destination')->value,
cf_type => $cf_type,
);
$set->voip_cf_destinations->create({
@ -1602,6 +1604,7 @@ sub preferences_callforward_destinationset_edit :Chained('preferences_callforwar
domain => $c->stash->{subscriber}->domain->domain,
destination => $d,
uri => $dest->field('uri')->field('destination')->value,
cf_type => $cf_type,
);
$set->voip_cf_destinations->create({

@ -107,7 +107,7 @@ sub process_cdr_item {
$own_domain = $item->destination_domain;
# rewrite cf to voicemail to "voicemail"
if($item->destination_user_in =~ /^vmu/ &&
if($item->destination_user_in =~ /^vm[ub]/ &&
$item->destination_domain_in eq "voicebox.local") {
$resource->{other_cli} = "voicemail";
$other_normalize = 0;

@ -1037,9 +1037,14 @@ sub field_to_destination {
my $domain = $params{domain};
my $d = $params{destination};
my $uri = $params{uri};
my $cf_type = $params{cf_type};
my $vm_prefix = "vmu";
if(defined $cf_type && $cf_type eq "cfb") {
$vm_prefix = "vmb";
}
if($d eq "voicebox") {
$d = "sip:vmu$number\@voicebox.local";
$d = "sip:".$vm_prefix.$number."\@voicebox.local";
} elsif($d eq "fax2mail") {
$d = "sip:$number\@fax2mail.local";
} elsif($d eq "conference") {
@ -1393,8 +1398,8 @@ sub update_voicemail_number {
for my $cfset ($prov_subs->voip_cf_destination_sets->all) {
for my $cf ($cfset->voip_cf_destinations->all) {
if($cf->destination =~ /\@voicebox\.local$/) {
$cf->update({ destination => 'sip:vmu'.$cf_cli.'@voicebox.local' });
if($cf->destination =~ /^sip:(vm[ub]).+\@voicebox\.local$/) {
$cf->update({ destination => 'sip:'.$1.$cf_cli.'@voicebox.local' });
}
}
}

Loading…
Cancel
Save