NatTraversalAgent Class Reference

#include <NatTraversalAgent.h>

Inheritance diagram for NatTraversalAgent:

AuthPlugin SipOutputProcessor OsNotification Plugin

List of all members.


Detailed Description

Auth Plugin responsible for implementing the nANT traversal feature.

The uses two hooks to examine the traffic passing by. First, the AuthPlugin::authorizeAndModify() method is used to see all the requests that traverse the system. The implementation of that method is mainly responsible for allocating CallTracker objects to track new calls made in through the system. Second, the SipOutputProcessor::handleOutputMessage() is used to monitor all requests and responses exiting the system and notify the appropriate CallTracker so that they can analyze and modify them as required to facilitate NAT Traversal.

Public Member Functions

virtual ~NatTraversalAgent ()
 destructor
virtual AuthResult authorizeAndModify (const UtlString &id, const Url &requestUri, RouteState &routeState, const UtlString &method, AuthResult priorResult, SipMessage &request, bool bSpiralingRequest, UtlString &reason)
 Called for any request - enforces the restrictions specified by authrules.
virtual void handleOutputMessage (SipMessage &message, const char *address, int port)
 Called when SIP messages are about to be sent by proxy.
virtual void readConfig (OsConfigDb &configDb)
 Read (or re-read) the authorization rules.
virtual void announceAssociatedSipRouter (SipRouter *sipRouter)
 Used to announce the SIP Router instance that is logically associated with this Auth Plugin. Plugins that need to interact with their associated SIP Router can override this method and save the passed pointer for later use.
virtual OsStatus signal (intptr_t eventData)

Protected Member Functions

void adjustViaForNatTraversal (SipMessage &message, const char *address, int port)
void adjustRecordRouteForNatTraversal (SipMessage &message, const char *address, int port)
void adjustReferToHeaderForNatTraversal (SipMessage &message, const char *address, int port)
bool restoreOriginalContact (SipMessage &request)
CallTrackercreateCallTrackerAndAddToMap (const UtlString &callId, ssize_t trackerHandle)
CallTrackergetCallTrackerForMessage (const SipMessage &sipMessage)
CallTrackergetCallTrackerFromCallId (const UtlString &callId)

Private Member Functions

void UndoChangesToRequestUri (SipMessage &message)
 NatTraversalAgent (const UtlString &instanceName)
 Constructor - private so that only the factory can call it.

Private Attributes

bool mbNatTraversalFeatureEnabled
bool mbOutputProcessorRegistrrationDone
UtlHashMap mCallTrackersMap
NatTraversalRules mNatTraversalRules
SipRoutermpSipRouter
OsRWMutex mMessageProcessingMutex
MediaRelaympMediaRelay
NatMaintainermpNatMaintainer
OsTimer mCleanupTimer
RegistrationDBmpRegistrationDB
bool mbConnectedToRegistrationDB
ssize_t mNextAvailableCallTrackerHandle

Friends

class NatTraversalAgentTest
AuthPlugingetAuthPlugin (const UtlString &name)
 Factory used by PluginHooks to dynamically link the plugin instance.


Constructor & Destructor Documentation

~NatTraversalAgent (  )  [virtual]

destructor

NatTraversalAgent ( const UtlString instanceName  )  [private]

Constructor - private so that only the factory can call it.

constructor

Parameters:
instanceName  the configured name for this plugin instance


Member Function Documentation

AuthPlugin::AuthResult authorizeAndModify ( const UtlString id,
const Url requestUri,
RouteState routeState,
const UtlString method,
AuthResult  priorResult,
SipMessage request,
bool  bSpiralingRequest,
UtlString reason 
) [virtual]

Called for any request - enforces the restrictions specified by authrules.

Parameters:
id  The authenticated identity of the request originator, if any (the null string if not). This is in the form of a SIP uri identity value as used in the credentials database (user) without the scheme or any parameters.
requestUri  parsed target Uri
routeState  the state for this request.
method  the request method
priorResult  results from earlier plugins.
request  see AuthPlugin regarding modifying
bSpiralingRequest  request spiraling indication
reason  rejection reason

Implements AuthPlugin.

void handleOutputMessage ( SipMessage message,
const char *  address,
int  port 
) [virtual]

Called when SIP messages are about to be sent by proxy.

Implements SipOutputProcessor.

void readConfig ( OsConfigDb configDb  )  [virtual]

Read (or re-read) the authorization rules.

Parameters:
configDb  a subhash of the individual configuration parameters for this instance of this plugin.

Implements AuthPlugin.

void announceAssociatedSipRouter ( SipRouter sipRouter  )  [virtual]

Used to announce the SIP Router instance that is logically associated with this Auth Plugin. Plugins that need to interact with their associated SIP Router can override this method and save the passed pointer for later use.

Reimplemented from AuthPlugin.

OsStatus signal ( intptr_t  eventData  )  [virtual]

Implements OsNotification.

void adjustViaForNatTraversal ( SipMessage message,
const char *  address,
int  port 
) [protected]

void adjustRecordRouteForNatTraversal ( SipMessage message,
const char *  address,
int  port 
) [protected]

void adjustReferToHeaderForNatTraversal ( SipMessage message,
const char *  address,
int  port 
) [protected]

bool restoreOriginalContact ( SipMessage request  )  [protected]

CallTracker * createCallTrackerAndAddToMap ( const UtlString callId,
ssize_t  trackerHandle 
) [protected]

CallTracker * getCallTrackerForMessage ( const SipMessage sipMessage  )  [protected]

CallTracker * getCallTrackerFromCallId ( const UtlString callId  )  [protected]

void UndoChangesToRequestUri ( SipMessage message  )  [private]


Friends And Related Function Documentation

friend class NatTraversalAgentTest [friend]

AuthPlugin* getAuthPlugin ( const UtlString name  )  [friend]

Factory used by PluginHooks to dynamically link the plugin instance.


Member Data Documentation

SipRouter* mpSipRouter [private]


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:50:17 build33 abuild