.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::SIP::Request 3pm" .TH Net::SIP::Request 3pm "2012-06-26" "perl v5.14.2" "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::Request \- handling of SIP request packets .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& my $req = Net::SIP::Request\->new( \*(AqINVITE\*(Aq,... ); \& my $ack = $req\->create_ack(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Subclass of Net::SIP::Packet for handling request packets. Has methods to create responses to requests and to authorize requests. .SH "EXAMPLES" .IX Header "EXAMPLES" .Vb 6 \& # create INVITE request \& my $invite = Net::SIP::Request\->new( \& \*(AqINVITE\*(Aq, \*(Aqsip:you@example.com\*(Aq, \& { from => ..., to => ... }, \& Net::SIP::SDP\->new( ... ) \& ); \& \& # somehow send request and retrieve response $resp \& ... \& if ( $resp\->code eq \*(Aq401\*(Aq or $resp\->code eq \*(Aq407\*(Aq ) { \& # need to authorize request \& $invite\->authorize( $resp, [ username, password ] ); \& \& # somehow send again and retrieve response $resp \& ... \& } \& \& if ( $resp\->code ~m{^[2345]\ed\ed} ) { \& # got final response, send ACK \& my $ack = $invite\->create_ack( $resp ); \& \& # somehow send $ack \& ... \& } .Ve .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" Inherited from Net::SIP::Packet. See there. .SH "METHODS" .IX Header "METHODS" .IP "method" 4 .IX Item "method" Get method of request. .IP "uri" 4 .IX Item "uri" Get \s-1URI\s0 part of request. .IP "set_uri ( \s-1STRING\s0 )" 4 .IX Item "set_uri ( STRING )" Set \s-1URI\s0 of request to \s-1STRING\s0 .IP "set_cseq ( \s-1NUMBER\s0 )" 4 .IX Item "set_cseq ( NUMBER )" Set sequence number if \f(CW\*(C`CSeq\*(C'\fR header to \s-1NUMBER\s0. .IP "create_ack ( \s-1RESPONSE\s0 )" 4 .IX Item "create_ack ( RESPONSE )" Returns Net::SIP::Request object for \s-1ACK\s0 request for the case when Net::SIP::Response \s-1RESPONSE\s0 was received in reply for packet \f(CW$self\fR. .IP "create_cancel" 4 .IX Item "create_cancel" Returns Net::SIP::Request object to cancel request in \f(CW$self\fR. .IP "create_response ( \s-1CODE\s0, [\s-1MSG\s0,] [ \e%HEADER, \s-1BODY\s0 ] )" 4 .IX Item "create_response ( CODE, [MSG,] [ %HEADER, BODY ] )" Returns Net::SIP::Response packet for the received request \f(CW$self\fR with numerical code \s-1CODE\s0 and text message \s-1MSG\s0. Header for the response will be based on the request, but can be added or overridden using \e%HEADER. If \s-1MSG\s0 is not given (e.g. argument is missing, second argument is \e%HEADER already) a builtin message for the code will be used. .Sp For details to \e%HEADER and \s-1BODY\s0 see \fBnew_from_parts\fR in Net::SIP::Packet. .IP "authorize ( \s-1RESPONSE\s0, \s-1AUTH\s0 )" 4 .IX Item "authorize ( RESPONSE, AUTH )" Tries to authorize request \f(CW$self\fR based on the information in \s-1RESPONSE\s0 (a 401 or 407 \*(L"Authorization required\*(R" response) and \s-1AUTH\s0. \s-1AUTH\s0 is either \&\f(CW\*(C`[ user,pass ]\*(C'\fR if a global authorization info exists for all realms or \&\f(CW\*(C`{ realm1 => [ user1,pass1 ], realm2 => [ user2,pass2 ],... }\*(C'\fR if different credentials are provided for different realms or a callback \&\f(CW\*(C`callback(realm)\->[user,pass]\*(C'\fR. The realms, for which authorization is needed, are read from \s-1RESPONSE\s0. .Sp The request \f(CW$self\fR is modified in-place. If a modification occurred, e.g. if (parts of) the authorization requests could be resolved it will return \&\s-1TRUE\s0, else \s-1FALSE\s0. .Sp Supports only \s-1RFC2617\s0 with md5 and empty qop or qop 'auth', not md5\-sess or qop's like 'auth\-int'.