GSP
Quick Navigator

Search Site

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

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::SIP::NATHELPER::SERVER (3)

.ds Aq ’

NAME

Net::SIP::NATHelper::Server - server for Net::SIP::NATHelper::Client

CONTENTS

DESCRIPTION

This module is a wrapper around Net::SIP::NATHelper::Base and will receive it’s instructions from Net::SIP::NATHelper::Client using RPC via sockets.

CONSTRUCTOR

new ( [ HELPER ], @FDS ) Will create an object which listens on all file descriptors given in FDS for RPC from clients.

If HELPER is given and a Net::SIP::NATHelper::Base object or derived it will be used, otherwise the helper will be created.

METHODS

do_command ( FD ) Called when FD is available for reading. Calls <B>acceptB> on FD and reads the RPC packet from the resulting file descriptor, executes it and returns result back.

Currently implemented commands are allocate,activate and close which will map to the local methods <B>allocate_socketsB>, <B>activate_sessionB> and <B>close_sessionB>.

One might redefine or add commands by changing $self->{commands}. The key of this hash reference is the command name and the value is the callback.

Unknown commands will be ignored, e.g nothing returned.

loop This will loop over all file descriptors it gets from <B>callbacksB> in Net::SIP::NATHelper::Base and the file descriptors for the RPC sockets.

When file descriptors gets available for reading it will execute the callbacks, e.g. forward the RTP data or call <B>do_commandB>. In regular intervals it will call <B>expireB> from Net::SIP::NATHelper::Base to expire the RTP sockets and sessions.

allocate_sockets ( ... ) Calls <B>allocate_socketsB> of the local Net::SIP::NATHelper::Base object. Takes and returns the same arguments.
activate_session ( ... ) Calls <B>activate_sessionB> of the local Net::SIP::NATHelper::Base object. Takes the same arguments and returns 1 if the session was newly activated, -1 if it was activated before and false if activation failed. Updates callbacks into the event loop.
close_session ( ... ) Calls <B>activate_sessionB> of the local Net::SIP::NATHelper::Base object. Takes the same arguments and returns the number of closed sessions. Updates callbacks into the event loop.
expire ( ... ) Calls <B>expireB> of the local Net::SIP::NATHelper::Base object. Takes the same arguments and returns the number of expired sessions. Updates callbacks into the event loop if necessary.

BUGS

The local event loop should be pluggable, so that other implementations could be used. Right now it’s a hard coded loop using select.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::SIP::NATHELPER::SERVER (3) 2009-01-23

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