diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index cfe34d5b66..d9a2b05418 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -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; diff --git a/lib/NGCP/Panel/Form/SubscriberCFSimple.pm b/lib/NGCP/Panel/Form/SubscriberCFSimple.pm index 22439e1cbf..252c8fbf03 100644 --- a/lib/NGCP/Panel/Form/SubscriberCFSimple.pm +++ b/lib/NGCP/Panel/Form/SubscriberCFSimple.pm @@ -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', diff --git a/lib/NGCP/Panel/Utils/Subscriber.pm b/lib/NGCP/Panel/Utils/Subscriber.pm index 712563a432..3dc72804f3 100644 --- a/lib/NGCP/Panel/Utils/Subscriber.pm +++ b/lib/NGCP/Panel/Utils/Subscriber.pm @@ -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,