GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::SIP::ReceiveChain(3) User Contributed Perl Documentation Net::SIP::ReceiveChain(3)

Net::SIP::ReceiveChain - handle incoming packet by multiple receivers

  # 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 ]
  );

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.

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.

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:

  • If a filter was given checks the packet against the filter and returns FALSE if the filter does return FALSE.
  • Otherwise it will call "receive" on all objects in the chain until one of these returns TRUE. In this case it will return TRUE.
  • If no object in the chain handled the packet it will return FALSE.
2021-05-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.