sipxportlib  Version 3.3
Public Member Functions | List of all members
IStunSocket Class Referenceabstract

#include <IStunSocket.h>

Inheritance diagram for IStunSocket:
Inheritance graph
[legend]

Public Member Functions

virtual ~IStunSocket ()
 
virtual OsSocketgetSocket ()=0
 
virtual int socketWrite (const char *buffer, int bufferLength, const char *ipAddress, int port, PacketType packetType=UNKNOWN_PACKET)=0
 
virtual UtlBoolean getRelayIp (UtlString *ip, int *port)=0
 
virtual UtlBoolean getMappedIp (UtlString *ip, int *port)=0
 
virtual void enableTransparentReads (bool bEnable)=0
 
virtual void enableStun (const char *szStunServer, int stunPort, int iKeepAlive, int stunOptions, bool bReadFromSocket)=0
 
virtual void setStunAddress (const UtlString &address, const int iPort)=0
 
virtual void setTurnAddress (const UtlString &address, const int iPort)=0
 
virtual void markStunFailure ()=0
 
virtual void markStunSuccess (bool bAddressChanged)=0
 
virtual void markTurnFailure ()=0
 
virtual void markTurnSuccess ()=0
 
virtual void evaluateDestinationAddress (const UtlString &address, int iPort, int priority)=0
 
virtual void enableTurn (const char *szTurnSever, int turnPort, int iKeepAlive, const char *username, const char *password, bool bReadFromSocket)=0
 
virtual void readyDestination (const char *szAddress, int iPort)=0
 
virtual UtlBoolean applyDestinationAddress (const char *szAddress, int iPort)=0
 
virtual UtlBoolean getBestDestinationAddress (UtlString &address, int &iPort)=0
 
virtual void addAlternateDestination (const char *szAddress, int iPort, int priority)=0
 
virtual void setReadNotification (OsNotification *pNotification)=0
 
virtual bool getFirstReadTime (OsDateTime &time)=0
 
virtual bool getLastReadTime (OsDateTime &time)=0
 
virtual bool getFirstWriteTime (OsDateTime &time)=0
 
virtual bool getLastWriteTime (OsDateTime &time)=0
 
virtual void destroy ()=0
 

Detailed Description

Generic interface representing a media transport object. Implemented by VoiceEngineDatagramSocket, VoiceEngineConnectionSocket, and any other class which provides RTP transport for VoiceEngine.

Constructor & Destructor Documentation

virtual ~IStunSocket ( )
inlinevirtual

virtual destructor.

Member Function Documentation

virtual OsSocket* getSocket ( )
pure virtual
virtual int socketWrite ( const char *  buffer,
int  bufferLength,
const char *  ipAddress,
int  port,
PacketType  packetType = UNKNOWN_PACKET 
)
pure virtual

Standard write - should be used to invoke the base class's write method

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual UtlBoolean getRelayIp ( UtlString ip,
int *  port 
)
pure virtual
virtual UtlBoolean getMappedIp ( UtlString ip,
int *  port 
)
pure virtual
virtual void enableTransparentReads ( bool  bEnable)
pure virtual
virtual void enableStun ( const char *  szStunServer,
int  stunPort,
int  iKeepAlive,
int  stunOptions,
bool  bReadFromSocket 
)
pure virtual

Enable STUN. Enabling STUN will reset the the keep alive timer and will force a binding refresh.

Parameters
szStunServer
stunPort
iKeepAlive
stunOptions
bReadFromSocket

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void setStunAddress ( const UtlString address,
const int  iPort 
)
pure virtual

Sets the STUN-resolved address and port for this socket.

Parameters
addressString containing the stunned address.
iPortinteger value of the stunned port.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void setTurnAddress ( const UtlString address,
const int  iPort 
)
pure virtual

Set the TURN-dervied relay address for this socket.

Parameters
addressTURN-derived hostname/IP address
iPortTURN-derived port address

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void markStunFailure ( )
pure virtual

Report that a stun attempt failed.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void markStunSuccess ( bool  bAddressChanged)
pure virtual

Report that a stun attempt succeeded.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void markTurnFailure ( )
pure virtual

Report that a stun attempt failed.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void markTurnSuccess ( )
pure virtual

Report that a stun attempt succeeded.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void evaluateDestinationAddress ( const UtlString address,
int  iPort,
int  priority 
)
pure virtual

Reset the destination address for this OsNatDatagramSocket. This method is called by the OsStunAgentTask when a better address is found via STUN/ICE.

Parameters
addressThe new destination address
iPortThe new destination port
priorityPriority of the destination address

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void enableTurn ( const char *  szTurnSever,
int  turnPort,
int  iKeepAlive,
const char *  username,
const char *  password,
bool  bReadFromSocket 
)
pure virtual

Enable STUN. Enabling STUN will reset the the keep alive timer and will force a binding refresh.

Parameters
szTurnSever
turnPort
iKeepAlive
username
password
bReadFromSocket

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void readyDestination ( const char *  szAddress,
int  iPort 
)
pure virtual

Prepares a destination under TURN usage.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual UtlBoolean applyDestinationAddress ( const char *  szAddress,
int  iPort 
)
pure virtual

TODO: DOCS

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual UtlBoolean getBestDestinationAddress ( UtlString address,
int &  iPort 
)
pure virtual

TODO: DOCS

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void addAlternateDestination ( const char *  szAddress,
int  iPort,
int  priority 
)
pure virtual

Add an alternate destination to this OsNatDatagramSocket. Alternate destinations are tested by sending stun packets. If a stun response is received and the priority is greater than what has already been selected then that address is used.

Parameters
szAddressIP address of the alternate destination
iPortport number of the alternate destination
prioritypriority of the alternate where a higher number indicates a higher priority.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

virtual void setReadNotification ( OsNotification pNotification)
pure virtual

Set a notification object to be signaled when the first the data packet is received from the socket. Once this is signaled, the notification object is discarded.

Implemented in OsNatDatagramSocket, and OsNatSocketBaseImpl.

virtual bool getFirstReadTime ( OsDateTime &  time)
pure virtual

Get the timestamp of the first read data packet (excluding any STUN/TURN/NAT packets).

Implemented in OsNatSocketBaseImpl.

virtual bool getLastReadTime ( OsDateTime &  time)
pure virtual

Get the timestamp of the last read data packet (excluding any STUN/TURN/NAT packets).

Implemented in OsNatSocketBaseImpl.

virtual bool getFirstWriteTime ( OsDateTime &  time)
pure virtual

Get the timestamp of the first written data packet (excluding any STUN/TURN/NAT packets).

Implemented in OsNatSocketBaseImpl.

virtual bool getLastWriteTime ( OsDateTime &  time)
pure virtual

Get the timestamp of the last written data packet (excluding any STUN/TURN/NAT packets).

Implemented in OsNatSocketBaseImpl.

virtual void destroy ( )
pure virtual

Cleanup routine.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.