.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::SIP 3pm" .TH Net::SIP 3pm "2023-09-29" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::SIP \- Framework SIP (Voice Over IP, RFC3261) .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&... .SH "DESCRIPTION" .IX Header "DESCRIPTION" Net::SIP consists of packages for handling the \s-1SIP\s0 packets, for transport of the packets, for processing the packets and on top of all that a simplified layer for common tasks. .PP 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 \&\fBinvoke_callback\fR which is used for all callbacks unless documentation specifies otherwise. This function supports a variety of different callback styles. .PP 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. .SS "\s-1SIP\s0 packet handling" .IX Subsection "SIP packet handling" .IP "Net::SIP::Packet" 4 .IX Item "Net::SIP::Packet" The base class for handling \s-1SIP\s0 packets and provides ways to parse, construct and manipulate \s-1SIP\s0 packets. .IP "Net::SIP::Request" 4 .IX Item "Net::SIP::Request" Derived from Net::SIP::Packet and handles the request packets. Provides ways to create special requests like \s-1ACK\s0 or \s-1CANCEL\s0 based on previous requests and responses, for creating responses based on requests, for authorization of requests. .IP "Net::SIP::Response" 4 .IX Item "Net::SIP::Response" Derived from Net::SIP::Packet and handles the response packets. .IP "Net::SIP::SDP" 4 .IX Item "Net::SIP::SDP" Handles \s-1SDP\s0 bodies from \s-1SIP\s0 packets. Provides ways to parse, construct these bodies, to get media information from them and to manipulate the \&\s-1SDP\s0 data for \s-1NAT\s0 etc. .SS "Transport of \s-1SIP\s0 packets" .IX Subsection "Transport of SIP packets" .IP "Net::SIP::Leg" 4 .IX Item "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 \fBVia\fR, \&\fBRecord-Route\fR. .IP "Net::SIP::Dispatcher" 4 .IX Item "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 \s-1DNS\s0 etc. .IP "Net::SIP::Dispatcher::Eventloop" 4 .IX Item "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 \s-1POE\s0. .SS "Processing of \s-1SIP\s0 packets, application layer" .IX Subsection "Processing of SIP packets, application layer" .IP "Net::SIP::Endpoint" 4 .IX Item "Net::SIP::Endpoint" Implements a \s-1SIP\s0 endpoint (\s-1UAC,UAS\s0). Provides ways to \s-1INVITE\s0 or \s-1BYE\s0 calls or to handle incoming calls. Calls themselves will be handled by Net::SIP::Endpoint::Context. .IP "Net::SIP::Registrar" 4 .IX Item "Net::SIP::Registrar" Simple implementation of a registrar. .IP "Net::SIP::StatelessProxy" 4 .IX Item "Net::SIP::StatelessProxy" Simple implementation of a stateless proxy. Stateful proxies should probably be implemented by putting multiple Net::SIP::Endpoints together. .IP "Net::SIP::Blocker" 4 .IX Item "Net::SIP::Blocker" Can block requests by method name with custom error code. .IP "Net::SIP::ReceiveChain" 4 .IX Item "Net::SIP::ReceiveChain" Can contain various objects for processing objects. Useful in connection with Net::SIP::Authorize. .IP "Net::SIP::Redirect" 4 .IX Item "Net::SIP::Redirect" Works together with a registrar and redirects requests. .IP "Net::SIP::Authorize" 4 .IX Item "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. .SS "Simplified Layer for common tasks" .IX Subsection "Simplified Layer for common tasks" .IP "Net::SIP::Simple" 4 .IX Item "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 \s-1RTP\s0 data (\s-1PCMU/8000\s0). .SS "Error handling" .IX Subsection "Error handling" Unless otherwise documented the common way to propagate errors is to raise an exception, e.g. call \fBdie()\fR. 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. .SH "EXPORTS" .IX Header "EXPORTS" By default nothing is exported. There are various arguments for exporting: .IP ":alias" 4 .IX Item ":alias" Exports constants as aliases for the Net::SIP::* packages, e.g. \&'Simple' for 'Net::SIP::Simple', 'Registrar' for 'Net::SIP::Registrar', \&'Packet' for 'Net::SIP::Packet', 'NATHelper_Client' for 'Net::SIP::NATHelper::Client' etc. .IP ":util" 4 .IX Item ":util" Exports everything (tag ':all') from Net::SIP::Util. .IP ":debug" 4 .IX Item ":debug" Exports the default exports from Net::SIP::Debug. .IP ":all" 4 .IX Item ":all" Everything from ':debug', ':util' and ':alias'. .IP "rtp=MINPORT\-MAXPORT|rtp:MINPORT\-MAXPORT" 4 .IX Item "rtp=MINPORT-MAXPORT|rtp:MINPORT-MAXPORT" Set the range of ports to be used for creating \s-1RTP\s0 sockets to \s-1MINPORT..MAXPORT.\s0 This affects Net::SIP::Util::create_rtp_sockets. .IP "debug=LEVEL|debug:LEVEL" 4 .IX Item "debug=LEVEL|debug:LEVEL" Set Debugging level to \s-1LEVEL\s0 .IP "string" 4 .IX Item "string" Strings where the first character is upper case will be interpreted as aliases for Net::SIP::* and it will try to export it. If the first character is lower case it will try to import it from Net::SIP::Util. .SS "\s-1EXAMPLES\s0" .IX Subsection "EXAMPLES" .Vb 3 \& use Net::SIP \*(Aqinvoke_callback\*(Aq; # use Net::SIP::Util \*(Aqinvoke_callback\*(Aq \& use Net::SIP \*(Aq:debug\*(Aq; # use Net::SIP::Debug \& use Net::SIP \*(Aq:util\*(Aq; # use Net::SIP::Util \*(Aq:all\*(Aq \& \& use Net::SIP \*(Aq:alias\*(Aq; \& Packet\->new( ... ); # Net::SIP::Packet\->new( ... ) \& \& \& # restrict rtp sockets from command line \& perl \-MNet::SIP=rtp:4000\-4010 program.pl .Ve .SH "BUGS" .IX Header "BUGS" Support for \s-1TCP\s0 and \s-1SIPS\s0 and not or not fully implemented. .SH "COPYRIGHT" .IX Header "COPYRIGHT" This module and are modules in the Net::SIP Hierarchy distributed together with this module are copyright (c) 2006\-2013, Steffen Ullrich. All Rights Reserved. These modules are free software. They may be used, redistributed and/or modified under the same terms as Perl itself.