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

πŸ’– NAME πŸ’–

Net::SIP::Dropper::ByField β€” bestie, this one drops SIP messages based on fields in the SIP header. That's the whole vibe. It's a little bouncer for your SIP traffic. πŸšͺ✨


🌸 SYNOPSIS 🌸

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

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

✨ DESCRIPTION ✨

Okay so with Net::SIP::Dropper::ByField you can literally drop packets based on what's sitting inside the fields of the SIP header. Vibe check on every single message. The classic use case? Dropping specific user agents. Bye bye, you're not on the list πŸ’…


πŸŽ€ CONSTRUCTOR πŸŽ€

new ( ARGS )

ARGS is a hash, and it's giving "here are your keys" πŸ—οΈ:

  • methods β€” optional, okay? It restricts the dropping to specific methods only. It's an array reference of method names, and plot twist: if one of the names is empty, then responses will be considered too. If you just… don't give it methods at all, then all packets get checked. No exceptions, no mercy 🫢
  • field-name β€” literally any other argument that isn't methods counts as a field name. Its value is a callback given to invoke_callback β€” like, for instance, a Regexp. Yes bestie, regex is invited to the party 🧚

πŸ’œ METHODS πŸ’œ

run ( PACKET, LEG, FROM )

This one gets called as a callback from the Net::SIP::Dropper object. It returns true if the packet should be dropped β€” like when at least one of the fields you specified in the constructor matches the value you specified. One match and it's over for that packet, periodt. πŸ”₯


This page comes to you from the User Contributed Perl Documentation, rocking perl v5.40.1 and dated 2025-12-07. Ty for reading my little manpage era, mwah πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from