Net::SIP::Redirect - Send redirect to Requests based on lookup at a registrar
my $reg = Net::SIP::Registrar->new(...); my $redir = Net::SIP::Redirect( dispatcher => $dispatcher, registrar => $reg, );
This package implements a simple redirection of Requests using the information provided by a registrar.
This creates a new redirect object, %ARGS can have the following keys:
Net::SIP::Dispatcher object managing the registar. Mandatory.
Registrar object. This is an object like a Net::SIP::Registrar, which has a query(address) method which returns a list of contacts.
query(address)
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.
"ip:port"
Called from the managing Net::SIP::Dispatcher object if a new packet arrives. Will return () and ignore the packet if it's an REGISTER request.
()
For Requests it will query the registrar and return either 302 Moved Temporarily with the list of contacts or 404 Not Found if the address is not registered.
302 Moved Temporarily
404 Not Found
To install Net::SIP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SIP
CPAN shell
perl -MCPAN -e shell install Net::SIP
For more information on module installation, please visit the detailed CPAN module installation guide.