+ } elsif ($sort eq 'R') {
+ if (my $dxchan = DXChannel::get($from)) {
+ handle_pc92_find_reply($dxchan, $pcall, $from, $target, @_[6,7]);
+ } else {
+ my $ref = Route::get($from);
+ if ($ref) {
+ my @dxchan = grep {$_->do_pc9x} $ref->alldxchan;
+ if (@dxchan) {
+ $_->send($line) for @dxchan;
+ } else {
+ dbg("PCPROT: no return route, ignored") if isdbg('chanerr')
+ }
+ } else {
+ dbg("PCPROT: no return route, ignored") if isdbg('chanerr')
+ }
+ }
+ return;
+ }
+ } elsif ($sort eq 'A' || $sort eq 'D' || $sort eq 'C') {
+
+ # remember the last channel we arrived on
+ $parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call;
+
+ # this is the main route section
+ # here is where all the routes are created and destroyed
+
+ # cope with missing duplicate node calls in the first slot for A or D
+ my $me = $_[4] || '';
+ if (($sort eq 'A' || $sort eq 'D')) {
+ $me ||= _encode_pc92_call($parent) if !$me ;
+ } else {
+ unless ($me) {
+ dbg("PCPROT: this type of PC92 *must* have a node call in the first slot, ignored") if is_dbg('chanerr');
+ return;
+ }
+ }
+
+ my @ent = map {[ _decode_pc92_call($_) ]} grep {$_ && /^[0-7]/} $me, @_[5 .. $#_];
+
+ if (@ent) {
+
+ # look at the first one which will always be a node of some sort
+ # except in the case of 'A' or 'D' in which the $pcall is used
+ # otherwise use the node call and update any information
+ # that needs to be done.
+ my ($call, $is_node, $is_extnode, $here, $version, $build) = @{$ent[0]};
+ if ($call && $is_node) {
+ if ($call eq $main::mycall) {
+ dbg("PCPROT: $call looped back onto $main::mycall, ignored") if isdbg('chanerr');