Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::sip::request(3pm) [debian man page]

Net::SIP::Request(3pm)					User Contributed Perl Documentation				    Net::SIP::Request(3pm)

NAME
Net::SIP::Request - handling of SIP request packets SYNOPSIS
my $req = Net::SIP::Request->new( 'INVITE',... ); my $ack = $req->create_ack(); DESCRIPTION
Subclass of Net::SIP::Packet for handling request packets. Has methods to create responses to requests and to authorize requests. EXAMPLES
# create INVITE request my $invite = Net::SIP::Request->new( 'INVITE', 'sip:you@example.com', { from => ..., to => ... }, Net::SIP::SDP->new( ... ) ); # somehow send request and retrieve response $resp ... if ( $resp->code eq '401' or $resp->code eq '407' ) { # need to authorize request $invite->authorize( $resp, [ username, password ] ); # somehow send again and retrieve response $resp ... } if ( $resp->code ~m{^[2345]dd} ) { # got final response, send ACK my $ack = $invite->create_ack( $resp ); # somehow send $ack ... } CONSTRUCTOR
Inherited from Net::SIP::Packet. See there. METHODS
method Get method of request. uri Get URI part of request. set_uri ( STRING ) Set URI of request to STRING set_cseq ( NUMBER ) Set sequence number if "CSeq" header to NUMBER. create_ack ( RESPONSE ) Returns Net::SIP::Request object for ACK request for the case when Net::SIP::Response RESPONSE was received in reply for packet $self. create_cancel Returns Net::SIP::Request object to cancel request in $self. create_response ( CODE, [MSG,] [ \%HEADER, BODY ] ) Returns Net::SIP::Response packet for the received request $self with numerical code CODE and text message MSG. Header for the response will be based on the request, but can be added or overridden using \%HEADER. If MSG is not given (e.g. argument is missing, second argument is \%HEADER already) a builtin message for the code will be used. For details to \%HEADER and BODY see new_from_parts in Net::SIP::Packet. authorize ( RESPONSE, AUTH ) Tries to authorize request $self based on the information in RESPONSE (a 401 or 407 "Authorization required" response) and AUTH. AUTH is either "[ user,pass ]" if a global authorization info exists for all realms or "{ realm1 => [ user1,pass1 ], realm2 => [ user2,pass2 ],... }" if different credentials are provided for different realms or a callback "callback(realm)->[user,pass]". The realms, for which authorization is needed, are read from RESPONSE. The request $self is modified in-place. If a modification occurred, e.g. if (parts of) the authorization requests could be resolved it will return TRUE, else FALSE. Supports only RFC2617 with md5 and empty qop or qop 'auth', not md5-sess or qop's like 'auth-int'. perl v5.14.2 2012-06-26 Net::SIP::Request(3pm)

Check Out this Related Man Page

Net::SIP::Registrar(3pm)				User Contributed Perl Documentation				  Net::SIP::Registrar(3pm)

NAME
Net::SIP::Registrar - Endpoint for registering SIP clients SYNOPSIS
my $reg = Net::SIP::Registrar->new( dispatcher => $dispatcher, min_expires => 10, max_expires => 60, domains => [ 'example.com','example.org' ], ); DESCRIPTION
This package implements a simple SIP registrar. In the current implementation registry information are only kept in memory, e.g. they are not preserved over restarts. The implementation itself does not checking if the UAC is authorized to register the given address. This can be done with using an appropriate Authorize Module inside a ReceiveChain in front of the registrar. CONSTRUCTOR
new ( %ARGS ) This creates a new registar object, %ARGS can have the following keys: dispatcher Net::SIP::Dispatcher object manging the registar. Mandatory. max_expires Maximum expires time accepted. If the client requests a larger expires value it will be capped at max_expires Defaults to 300. min_expires Minimum expires value. If the client requests a smaller value the registrar will return a response of "423 Interval too brief". Defaults to 30. domains or domain Either string or reference to list of strings containing the names of the domains the registrar is responsable for. If not given the registrar accepts everything. 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. Will return "()" and ignore the packet if it's not a REGISTER request or if it is not responsable for the domain given in the "From" heeader of the REGISTER request. If it is responsable for the packet it will create a response and return the code of the response. Responses are either "423 Interval too brief" if the request expires time is too small, or "200 Ok" if the expires time is 0 (e.g. the client should be unregistered) or greater or equal min_expires. In case of a successful response it wil also update the internal registry information. query ( ADDR ) Search for ADDR (which has format "proto:user@domain") in the registry. Returns @List of all sip or sips contacts for ADDR. expire Removes all expired entries from the internal registry. Called whenever the registry information gets updated from sub receive. perl v5.14.2 2010-08-09 Net::SIP::Registrar(3pm)
Man Page