TT#32990 validate if hostname or ip is set for peers

Change-Id: Ic58ba48c11e2c23b5a9e6c84aada56ed4be1068a
changes/45/19145/1
Gerhard Jungwirth 8 years ago
parent c9e0723db6
commit 398edbd273

@ -143,12 +143,18 @@ sub validate_via_route {
$field->add_error("Invalid SIP URI, must be (comma-separated) SIP URI(s) in form sip:ip:port");
}
}
#sub validate {
# my ($self) = @_;
# my $c = $self->ctx;
# return unless $c;
# my $model = $c->
#}
sub validate {
my ($self) = @_;
my $host = $self->value->{host};
my $ip = $self->value->{ip};
if (!$ip && !$host) {
$self->field('host')->add_error("At least one of the fields 'host' or 'ip' have to be present");
}
return;
}
1;
__END__

Loading…
Cancel
Save