got routing essentially working
[spider.git] / cmd / disconnect.pl
1 #
2 # disconnect a local user
3 #
4 my ($self, $line) = @_;
5 my @calls = split /\s+/, $line;
6 my $call;
7 my @out;
8
9 if ($self->priv < 9) {
10   return (1, "not allowed");
11 }
12
13 foreach $call (@calls) {
14   $call = uc $call;
15   my $dxchan = DXChannel->get($call);
16   if ($dxchan) {
17     $dxchan->disconnect;
18         push @out, "disconnected $call";
19   } else {
20     push @out, "$call not connected locally";
21   }
22 }
23
24 return (1, @out);