Net::SIP consists of packages for handling the SIP packets, for transport of the packets, for processing
the packets and on top of all that a simplified layer for common tasks.
Addionally Net::SIP::Util provides utility functions and Net::SIP::Debug provides a debugging layer used
by all these packages. Especially it provides the function invoke_callback which is used for all
callbacks unless documentation specifies otherwise. This function supports a variety of different
callback styles.
For first and simple applications you best start with Net::SIP::Simple. If this is no longer enough you
might look at the details of Net::SIP::Dispatcher, Net::SIP::Endpoint, Net::SIP::Register and
Net::SIP::StatelessProxy. Although these packages are in itself well documented the functionality and
the design is best understandable if you look how it gets used in the source of Net::SIP::Simple.
SIPpackethandling
Net::SIP::Packet
The base class for handling SIP packets and provides ways to parse, construct and manipulate SIP
packets.
Net::SIP::Request
Derived from Net::SIP::Packet and handles the request packets. Provides ways to create special
requests like ACK or CANCEL based on previous requests and responses, for creating responses based on
requests, for authorization of requests.
Net::SIP::Response
Derived from Net::SIP::Packet and handles the response packets.
Net::SIP::SDP
Handles SDP bodies from SIP packets. Provides ways to parse, construct these bodies, to get media
information from them and to manipulate the SDP data for NAT etc.
TransportofSIPpackets
Net::SIP::Leg
Encapsulates socket for transport of packet. Provides way to find out, if target is reachable through
this socket. Prepares incoming, outgoing and forwarding packets by removing or adding header like
Via, Record-Route.
Net::SIP::Dispatcher
Handles new packets coming in through a Net::SIP::Leg. Delivers outgoing packets through the
appropriate Net::SIP::Leg. Handles timeouts and retransmission of outgoing packets, lookup of the
appropriate leg through DNS etc.
Net::SIP::Dispatcher::Eventloop
Simple implementation of an event loop for handling socket events and timers. Can be replaced to
integrate into other event loops, like Tk, Lib::Event or POE.
ProcessingofSIPpackets,applicationlayer
Net::SIP::Endpoint
Implements a SIP endpoint (UAC,UAS). Provides ways to INVITE or BYE calls or to handle incoming
calls. Calls themselves will be handled by Net::SIP::Endpoint::Context.
Net::SIP::Registrar
Simple implementation of a registrar.
Net::SIP::StatelessProxy
Simple implementation of a stateless proxy. Stateful proxies should probably be implemented by
putting multiple Net::SIP::Endpoints together.
Net::SIP::Blocker
Can block requests by method name with custom error code.
Net::SIP::ReceiveChain
Can contain various objects for processing objects. Useful in connection with Net::SIP::Authorize.
Net::SIP::Redirect
Works together with a registrar and redirects requests.
Net::SIP::Authorize
If put into a Net::SIP::ReceiveChain it requests and checks authorization and gives only authorized
requests to the next member of the chain.
SimplifiedLayerforcommontasks
Net::SIP::Simple
Provides simple layer for common tasks and tests, like sending a voice message to somebody, receiving
a message or even implementing an answer machine. Together with Net::SIP::Simple::RTP it is possible
to handle simple RTP data (PCMU/8000).
Errorhandling
Unless otherwise documented the common way to propagate errors is to raise an exception, e.g. call die().
This might especially happen when parsing packets from strings, so unless you want to crash your
application on bad input you should catch these exceptions with eval.