Net::S...Dropper(3pm)

πŸ’– Net::S...Dropper(3pm) β€” the perl manual page, bestie edition πŸ’–

okay so this is the manual page for Net::SIP::Dropper from the User Contributed Perl Documentation, section 3pm. it's a whole vibe. let's get into it 🫢


✨ NAME ✨

Net::SIP::Dropper β€” drops SIP messages based on callback. that's it. that's the job. it sees a message and it's like "not today" πŸ’…


🌸 SYNOPSIS 🌸

use Net::SIP::Dropper::ByIPPort;
my $drop_by_ipport = Net::SIP::Dropper::ByIPPort->new(
    database => '/path/to/database.drop',
    methods => [ 'REGISTER', '...', '' ],
    attempts => 10,
    interval => 60,
);

use Net::SIP::Dropper::ByField;
my $drop_by_field = Net::SIP::Dropper::ByField->new(
    methods => [ 'REGISTER', '...', '' ],
    'From' => qr/sip(?:vicious|sscuser)/,
    'User-Agent' => qr/^friendly-scanner$/,
);

my $drop_subscribe = sub {
    my ($packet,$leg,$from) = @_;
    # drop all subscribe requests and responses
    return $packet->method eq 'SUBSCRIBE' ? 1:0;
};

my $dropper = Net::SIP::Dropper->new(
    cbs => [ $drop_by_ipport, $drop_by_field, $drop_subscribe ]);

my $chain = Net::SIP::ReceiveChain->new(
    [ $dropper, ... ]
);

like look at that. three little droppers, one chain, zero unwanted messages. iconic honestly 😌✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it do? it drops messages. that's the whole thing, no cap.

which means: if an incoming message matches the settings, it does no further processing in the Net::SIP chain, and it does not send something back either. it just… doesn't. ghosting, but make it infrastructure πŸ’€

some useful droppers are already defined for you in Net::SIP::Dropper::ByIpPort and Net::SIP::Dropper::ByField. go off, queens πŸ‘‘


πŸŽ€ CONSTRUCTOR πŸŽ€

new ( ARGS )

ARGS is a hash with the key "cb" or "cbs" β€” pick your fighter:

  • "cb" is a single callback to be processed πŸ’«
  • "cbs" is an arrayref with callbacks 🧚

here's the rule, and it's important so listen up: if one of the callbacks returns true, the message will be dropped. periodt. if all of the callbacks return false, the message will be forwarded in the chain. that's the vibe check βœ…

Returns a new dropper object to be used in the chain. slay πŸ’…

fr fr, remember: any single true = gone. all false = it moves on. no in-between, no maybes πŸ’–

and that's the whole page, bestie!! 🌈⭐

this lil masterpiece lives in the User Contributed Perl Documentation for perl v5.40.1, dated 2025-12-07 β€” mwah, sending love to whoever wrote it, they ate πŸ“πŸ’œ

πŸ“¦ where this page comes from