6 # Copyright (c) 2005 Dirk Koopman G1TLH
13 use vars qw($VERSION $BRANCH);
14 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
15 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/ || (0,0));
16 $main::build += $VERSION;
17 $main::branch += $BRANCH;
30 unless ($thing->{Aranea}) {
31 my $s = sprintf "%X", int(rand() * 100000000);
32 my $auth = Verify->new("DXSp,$main::mycall,$s");
33 $thing->{Aranea} = Aranea::genmsg($thing, 'Bye',
35 auth=>$auth->challenge($main::me->user->passphrase)
38 return $thing->{Aranea};
47 if ($dxchan->{call} eq $thing->{origin}) {
49 # for directly connected calls
50 # if ($Thingy::Hello::verify_on_login) {
51 # my $pp = $dxchan->user->passphrase;
53 # dbglog('err', "Thingy::Bye::handle: verify on and $thing->{origin} has no passphrase");
56 # my $auth = Verify->new("DXSp,$thing->{origin},$thing->{s}");
57 # unless ($auth->verify($thing->{auth}, $dxchan->user->passphrase)) {
58 # dbglog('err', "Thingy::Bye::handle: verify on and $thing->{origin} failed auth check");
63 my $int = $thing->{user} || $thing->{origin};
64 RouteDB::delete_interface($int);
67 # for otherwise connected calls, that come in relayed from other nodes
68 # note that we cannot do any connections at this point
69 my $nref = Route::Node::get($thing->{origin});
71 if (my $user = $thing->{user}) {
72 my $ur = Route::get($user);
74 if ($ur->isa('Route::Node')) {
76 } elsif ($ur->isa('Route::User')) {
85 $thing->broadcast($dxchan);
91 my $thing = $pkg->SUPER::new(origin=>$main::mycall, @_);