Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::sip::receivechain(3pm) [debian man page]

Net::SIP::ReceiveChain(3pm)				User Contributed Perl Documentation			       Net::SIP::ReceiveChain(3pm)

NAME
Net::SIP::ReceiveChain - handle incoming packet by multiple receivers SYNOPSIS
# create proxy which works as a registrar too, but # all register requests should be authorized my $registrar = Net::SIP::Registrar->new... my $auth = Net::SIP::Authorize->new .... my $reg_chain = Net::SIP::ReceiveChain->new( [ $auth,$registrar ], methods => [ 'REGISTER' ], ); my $proxy = Net::SIP::StatelessProxy->new... my $chain = Net::SIP::ReceiveChain->new( [ $registrar,$proxy ] ); DESCRIPTION
This package is used to handle incoming packets by multiple receivers, e.g. make sure that requests for Net::SIP::Registrar will be authorized by Net::SIP::Authorize. Objects in the chain might be Net::SIP::Registrar, Net::SIP::StatelessProxy, Net::SIP::Authorize, Net::SIP::ReceiveChain itself and every other object which handles "receive" like described below. CONSTRUCTOR
new ( OBJECTS, %ARGS ) This creates a new registar object, OBJECTS is a reference to an array of objects implementing the "receive" method. %ARGS can have the following keys: filter A callback which gets called during "receive" with all arguments of the method. If it returns TRUE the packet will be handled by the chain, otherwise not. methods If filter is not given but methods is it will set filter to a callback which accepts only the methods specified in the array reference given to methods. METHODS
receive ( PACKET,LEG,FROM ) PACKET is the incoming packet, LEG is the Net::SIP::Leg where the packet arrived and FROM is the "ip:port" of the sender. Responses will be send back to the sender through the same leg. Called from the managing Net::SIP::Dispatcher object if a new packet arrives. Returns TRUE if the packet was fully handled by one of the objects in the chain, else FALSE: o If a filter was given checks the packet against the filter and returns FALSE if the filter does return FALSE. o Otherwise it will call "receive" on all objects in the chain until one of these returns TRUE. In this case it will return TRUE. o If no object in the chain handled the packet it will return FALSE. perl v5.14.2 2010-02-02 Net::SIP::ReceiveChain(3pm)

Check Out this Related Man Page

Net::SIP::Dropper(3pm)					User Contributed Perl Documentation				    Net::SIP::Dropper(3pm)

NAME
Net::SIP::Dropper - drops SIP messages based on callback 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, ... ] ); DESCRIPTION
Drops messages. This means, does no further processing in the Net::SIP chain and does not send something back if the incoming message match the settings. Some useful droppers are defined in Net::SIP::Dropper::ByIpPort and Net::SIP::Dropper::ByField. CONSTRUCTOR
new ( ARGS ) ARGS is a hash with key "cb" or "cbs". "cb" is a single callback to be processed, "cbs" is an arrayref with callbacks. If one of the callbacks returns true the message will be dropped. If all callbacks return false the message will be forwarded in the chain. Returns a new dropper object to be used in the chain. perl v5.14.2 2011-02-03 Net::SIP::Dropper(3pm)
Man Page