-
- # global ann filtering on INPUT
- if ($self->{inannfilter}) {
- my ($ann_dxcc, $ann_itu, $ann_cq, $org_dxcc, $org_itu, $org_cq) = (0..0);
- my @dxcc = Prefix::extract($field[1]);
- if (@dxcc > 0) {
- $ann_dxcc = $dxcc[1]->dxcc;
- $ann_itu = $dxcc[1]->itu;
- $ann_cq = $dxcc[1]->cq();
- }
- @dxcc = Prefix::extract($field[5]);
- if (@dxcc > 0) {
- $org_dxcc = $dxcc[1]->dxcc;
- $org_itu = $dxcc[1]->itu;
- $org_cq = $dxcc[1]->cq();
- }
- my ($filter, $hops) = $self->{inannfilter}->it(@field[1..6], $self->{call},
- $ann_dxcc, $ann_itu, $ann_cq, $org_dxcc, $org_itu, $org_cq);
- unless ($filter) {
- dbg("PCPROT: Rejected by input announce filter") if isdbg('chanerr');
- return;
+
+
+ # here's a bit of fun, convert incoming ann with a callsign in the first word
+ # or one saying 'to <call>' to a talk if we can route to the recipient
+ if ($ann_to_talk) {
+ my ($to, $call) = $field[3] =~ /^\s*([\w-]+)[\s:]+([\w-]+)/;
+ if ($to && $call) {
+ if ((uc $to eq 'TO' && is_callsign(uc $call)) || is_callsign($call = uc $to)) {
+ my $ref = Route::get($call);
+ if ($ref) {
+ my $dxchan = $ref->dxchan;
+ $dxchan->talk($field[1], $call, undef, $field[3], $field[5]) if $dxchan != $self;
+ return;
+ }
+ }