+ dbg(ref($self) . " deleting $call from " . $self->{call} . "->\{$field\}") if isdbg('routelow');
+ push @out, $c;
+ }
+ }
+ return @out;
+}
+
+sub _haslist
+{
+ my $self = shift;
+ my $field = shift;
+ my @out;
+ my $call = shift;
+ my $r = grep $_->{call} eq $call, @{$self->{$field}};
+ dbg(ref($self) . " $call is " . $r?'in':'NOT in' . " $self->{call}\->\{$field\}") if isdbg('routelow');
+}
+
+sub is_empty
+{
+ my $self = shift;
+ return @{$self->{$_[0]}} == 0;
+}
+
+#
+# flag field constructors/enquirers
+#
+# These can be called in various ways:-
+#
+# Route::here or $ref->here returns 1 or 0 depending on value of the here flag
+# Route::here(1) returns 1 (the bit value of the here flag)
+# $ref->here(1) or $ref->here(0) sets the here flag
+#
+# these are now redundant really as we are not interested in conferences
+# and here is back to being '1'.
+
+sub here
+{
+ my $self = shift;
+ $self->{flags} = shift if @_;
+ return $self->{flags};
+}
+
+# conferencing in the ak1a sense is not supported
+sub conf
+{
+ my $self = shift;
+ return 0;
+}
+
+sub parents
+{
+ my $self = shift;
+ return @{$self->{parent}};
+}
+
+#
+# display routines
+#
+
+sub user_call
+{
+ my $self = shift;
+ my $call = sprintf "%s", $self->{call};
+ return $self->here ? "$call" : "($call)";
+}
+
+sub config
+{
+ my $self = shift;
+ my $nodes_only = shift;
+ my $level = shift;
+ my $seen = shift;
+ my @out;
+ my $line;
+ my $call = $self->user_call;
+ my $printit = 1;
+
+ # allow ranges
+ if (@_) {
+ $printit = grep $call =~ m|$_|, @_;
+ }
+
+ if ($printit) {
+ $line = ' ' x ($level*2) . "$call";
+ $call = ' ' x length $call;
+
+ # recursion detector
+ if ((DXChannel::get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
+ $line .= ' ...';
+# push @out, $line;
+ return @out;
+ }
+ push @$seen, $self->{call};
+
+ # print users
+ unless ($nodes_only) {
+ if (@{$self->{users}}) {
+ $line .= '->';
+ foreach my $ucall (sort @{$self->{users}}) {
+ my $uref = Route::User::get($ucall);
+ my $c;
+ if ($uref) {
+ $c = $uref->user_call;
+ } else {
+ $c = "$ucall?";
+ }
+ if ((length $line) + (length $c) + 1 < 79) {
+ $line .= $c . ' ';
+ } else {
+ $line =~ s/\s+$//;
+ push @out, $line;
+ $line = ' ' x ($level*2) . "$call->$c ";
+ }
+ }
+ }
+ }
+ $line =~ s/->$//g;
+ $line =~ s/\s+$//;
+ push @out, $line if length $line;
+ }
+
+ # deal with more nodes
+ foreach my $ncall (sort @{$self->{nodes}}) {
+ my $nref = Route::Node::get($ncall);
+
+ if ($nref) {
+ my $c = $nref->user_call;
+# dbg("recursing from $call -> $c") if isdbg('routec');
+ push @out, $nref->config($nodes_only, $level+1, $seen, @_);
+ } else {
+ push @out, ' ' x (($level+1)*2) . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_);