my $ref = DXChannel->get($call);
$ref->send("$call de $field[1]: $text") if $ref && $ref->{talk};
} else {
- route($field[2], $line); # relay it on its way
+ $self->route($field[2], $line); # relay it on its way
}
return;
}
# route 'foreign' pc26s
if ($pcno == 26) {
if ($field[7] ne $main::mycall) {
- route($field[7], $line);
+ $self->route($field[7], $line);
return;
}
}
}
} else {
- route($field[2], $line);
+ $self->route($field[2], $line);
}
return;
# route 'foreign' pc27s
if ($pcno == 27) {
if ($field[8] ne $main::mycall) {
- route($field[8], $line);
+ $self->route($field[8], $line);
return;
}
}
if ($pcno == 25) { # merge request
if ($field[1] ne $main::mycall) {
- route($field[1], $line);
+ $self->route($field[1], $line);
return;
}
if ($field[2] eq $main::mycall) {
if ($pcno == 49 || $field[1] eq $main::mycall) {
DXMsg::process($self, $line);
} else {
- route($field[1], $line);
+ $self->route($field[1], $line);
}
return;
}
$self->send(pc35($main::mycall, $field[2], "$main::mycall:your attempt is logged, Tut tut tut...!"));
}
} else {
- route($field[1], $line);
+ $self->route($field[1], $line);
}
return;
}
delete $rcmds{$field[2]} if !$dxchan;
}
} else {
- route($field[1], $line);
+ $self->route($field[1], $line);
}
return;
}
if ($field[1] eq $main::mycall) {
;
} else {
- route($field[1], $line);
+ $self->route($field[1], $line);
}
return;
}
} else {
# route down an appropriate thingy
- route($field[1], $line);
+ $self->route($field[1], $line);
}
return;
}
#
sub route
{
- my ($call, $line) = @_;
+ my ($self, $call, $line) = @_;
my $cl = DXCluster->get_exact($call);
- if ($cl) {
+ if ($cl) { # don't route it back down itself
+ return if ref $self && $call eq $self->{call};
my $hops;
my $dxchan = $cl->{dxchan};
if ($dxchan) {
my $r = {};
$r->{call} = $from;
$r->{t} = $main::systime;
- route($to, pc51($to, $main::mycall, 1));
+ route(undef, $to, pc51($to, $main::mycall, 1));
push @$ref, $r;
}
$r->{call} = $from;
$r->{t} = $main::systime;
$r->{cmd} = $cmd;
- route($to, pc34($main::mycall, $to, $cmd));
+ route(undef, $to, pc34($main::mycall, $to, $cmd));
$rcmds{$to} = $r;
}
1;