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 $duri;
my $t = $destination ? ($destination->timeout || 300) : 300; my $t = $destination ? ($destination->timeout || 300) : 300;
($d, $duri) = NGCP::Panel::Utils::Subscriber::destination_to_field($d); ($d, $duri) = NGCP::Panel::Utils::Subscriber::destination_to_field($d);
if ($d eq "uri") { $c->stash->{cf_tmp_params} = {
$c->stash->{cf_tmp_params} = { uri => {
uri => { destination => $duri,
destination => $duri, timeout => $t,
timeout => $t, },
}, id => $destination ? $destination->id : undef,
id => $destination ? $destination->id : undef, };
};
}
$params = { destination => $c->stash->{cf_tmp_params} }; $params = { destination => $c->stash->{cf_tmp_params} };
$params->{destination}{destination} = $d; $params->{destination}{destination} = $d;
$params->{ringtimeout} = $ringtimeout; $params->{ringtimeout} = $ringtimeout;

@ -78,6 +78,10 @@ has_field 'destination.uri.timeout' => (
type => '+NGCP::Panel::Field::PosInteger', type => '+NGCP::Panel::Field::PosInteger',
label => 'for (seconds)', label => 'for (seconds)',
default => 300, 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' => ( has_field 'destination.announcement_id' => (
type => 'Select', type => 'Select',

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

Loading…
Cancel
Save