Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  NET::SIP::STATELESSPROXY (3)

.ds Aq ’


Net::SIP::StatelessProxy - Simple implementation of a stateless proxy





This package implements a simple stateless SIP proxy. Basic idea is that the proxy has either a single or two legs and that the packets are exchanged between those legs, e.g. packets incoming on one leg will be forwarded through the other leg.

Because this is a stateless proxy no retransmits will be done by the proxy.

If the proxy should work as a registrar too it should be put after a Net::SIP::Registrar in a Net::SIP::ReceiveChain.

While forwarding the proxy will be insert itself into the packet, e.g. it will add <B>ViaB> and <B>Record-RouteB> header while forwarding requests.

Additionally it will rewrite the <B>ContactB> header while forwarding packets (see below), e.g. if the <B>ContactB> header points to some client it will rewrite it, so that it points to the proxy and if it already points to the proxy it will rewrite it back so that it again points to the client.


new ( %ARGS ) Creates a new stateless proxy. With %ARGS the behavior can be influenced:
dispatcher The Net::SIP::Dispatcher object managing the proxy.
rewrite_contact Callback which is used in rewriting <B>ContactB> headers. If one puts user@host in it should rewrite it and if one puts something without ’@’ it should try to rewrite it back (and return <B>()B> if it cannot rewrite it back). A working default implementation is provided.
nathelper Optional Net::SIP::NATHelper::* object. When given it will be used to do NAT, e.g. if the incoming and outgoing legs are different it will rewrite the SDP bodies to use local sockets and the nathelper will transfer the RTP data between the local and the original sockets.
force_rewrite Usually the contact header will only be rewritten, if the incoming and outgoing leg are different. With this option one can force the rewrite, even if they are the same.


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.

Called from the dispatcher on incoming packets. The packet will be rewritten (Via and Record-Route headers added, <B>ContactB> modified) and then the packet will be forwarded.

For requests it can determine the target of the forwarded packet by looking at the route or if no route it looks at the URI. For responses it looks at the next <B>ViaB> header.

do_nat ( PACKET, INCOMING_LEG, OUTGOING_LEG ) This will be called from <B>receiveB> while forwarding data. If <B>nathelperB> is defined it will be used to rewrite SDP bodies and update nathelpers internal states to forward RTP data.

Return values are like <B>forward_outgoingB> in Net::SIP::Leg, e.g. it will return [code,text] on error or () on success, where success can be that the packet was rewritten or that there was no need to touch it.


Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 NET::SIP::STATELESSPROXY (3) 2010-02-02

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.