17 # should eventually get these out of the MIB...
19 my %dispatch_table = (
20 'isdnMibCallInformation', \&trap_call_setup,
29 my ($reqid, $addr, $community);
31 # if this is a timeout, then there will be no args...
33 $ref->[1]->[2] = SNMP::translateObj($ref->[1]->val);
34 $trapType = $ref->[1]->val;
36 ($reqid, $addr, $community) = @{$args};
38 $trapType = 'timeout';
41 if (defined($dispatch_table{$trapType})) {
42 &{$dispatch_table{$trapType}}($session, $ref);
43 } elsif (defined($dispatch_table{'.'})) {
44 &{$dispatch_table{'.'}}($session, $ref);
46 # don't do anything... silently discard.
55 my $trapType = $ref->[1]->val;
57 warn "unexpected trap " . $trapType;
67 my $ifIndex = $varlist->[2]->val;
68 my $isdnBearerOperStatus = $varlist->[3]->val;
69 my $isdnBearerPeerAddress = $varlist->[4]->val;
70 my $isdnBearerPeerSubAddress = $varlist->[5]->val;
71 my $isdnBearerInfoType = $varlist->[6]->val;
72 my $isdnBearerCallOrigin = $varlist->[5]->val;
74 my ($reqid, $ipaddr, $community) = @{$args};
76 printf "Call from %s", $isdnBearerPeerAddress;
77 printf "*%s", $isdnBearerPeerSubAddress if ($isdnBearerPeerSubAddress ne '');
81 my $session = new SNMP::Session(
82 DestHost => '0.0.0.0',
88 if (!defined($session)) {
89 die "can't create listener session";
92 # otherwise assume that ErrorNum is zero...
94 $session->SNMP::_catch([\&trap_dispatcher, $session]);