Net::SIP::Dropper::ByField - drops SIP messages based on fields in SIP header
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, ... ]);
Net::SIP::Dropper::ByField one can drop packets based on the contents of the fields in the SIP header. This can be used to drop specific user agents.
ARGS is a hash with the following keys:
Optional argument to restrict dropping to specific methods.
Is array reference of method names, if one of the names is empty also responses will be considered. If not given all packets will be checked.
Any argument other then
methods will be considered a field name. The value is a callback given to
invoke_callback, like for instance a Regexp.