TT#63503 - Fix changing timeout for call forwards

* The timeout was defaulting to 300 for
	   any call forward besides URI. Removing
	   a sepcific validation for this case fixed
	   the issue

Change-Id: I2658d77cee08567047c40fb2b3711f5870b49d25
changes/28/32528/3
Flaviu Mates 6 years ago
parent 7699e25d78
commit 2f5dcfe343

@ -947,15 +947,13 @@ sub preferences_callforward :Chained('base') :PathPart('preferences/callforward'
my $duri;
my $t = $destination ? ($destination->timeout || 300) : 300;
($d, $duri) = NGCP::Panel::Utils::Subscriber::destination_to_field($d);
if ($d eq "uri") {
$c->stash->{cf_tmp_params} = {
uri => {
destination => $duri,
timeout => $t,
},
id => $destination ? $destination->id : undef,
};
}
$c->stash->{cf_tmp_params} = {
uri => {
destination => $duri,
timeout => $t,
},
id => $destination ? $destination->id : undef,
};
$params = { destination => $c->stash->{cf_tmp_params} };
$params->{destination}{destination} = $d;
$params->{ringtimeout} = $ringtimeout;

@ -78,6 +78,10 @@ has_field 'destination.uri.timeout' => (
type => '+NGCP::Panel::Field::PosInteger',
label => 'for (seconds)',
default => 300,
element_attr => {
rel => ['tooltip'],
title => ['NOTE: please note that for some scenarios the value is ignored, despite the fact that the field can be freely changed.']
},
);
has_field 'destination.announcement_id' => (
type => 'Select',

@ -1980,11 +1980,7 @@ sub create_cf_destination{
}
foreach my $dest(@$fields) {
my $d = $dest->field('destination')->value;
my $t = 300;
if ($d eq "uri") {
$t = $dest->field('uri')->field('timeout')->value;
# TODO: check for valid timeout here
}
my $t = $dest->field('uri')->field('timeout')->value || 300;
$d = NGCP::Panel::Utils::Subscriber::field_to_destination(
number => $numberstr,
domain => $subscriber->domain->domain,

Loading…
Cancel
Save