sipxtacklib
Version 3.3
|
The SipUdpServer is owner/container of the sockets used for UDP communications. More...
#include <SipUdpServer.h>
Public Member Functions | |
SipUdpServer (int sipPort=SIP_PORT, SipUserAgent *userAgent=NULL, int udpReadBufferSize=-1, UtlBoolean bUseNextAvailablePort=FALSE, const char *szBoundIp=NULL) | |
virtual | ~SipUdpServer () |
int | run (void *pArg) |
void | shutdownListener () |
void | enableStun (const char *szStunServer, int iStunPort, const char *szLocalIp, int refreshPeriodInSecs, OsNotification *pNotification) |
UtlBoolean | sendTo (const SipMessage &message, const char *address, int port, const char *szLocalSipIp=NULL) |
UtlBoolean | addCrLfKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const int keepAliveSecs, OsNatKeepaliveListener *pListener) |
UtlBoolean | removeCrLfKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort) |
UtlBoolean | addStunKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const int keepAliveSecs, OsNatKeepaliveListener *pListener) |
UtlBoolean | removeStunKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort) |
UtlBoolean | addSipKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const char *szMethod, const int keepAliveSecs, OsNatKeepaliveListener *pListener) |
UtlBoolean | removeSipKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const char *szMethod) |
void | updateSipKeepAlive (const char *szLocalIp, const char *szMethod, const char *szRemoteIp, const int remotePort, const char *szContactIp, const int contactPort) |
void | sendSipKeepAlive (OsTimer *pTimer) |
void | printStatus () |
int | getServerPort (const char *szLocalIp=NULL) |
UtlBoolean | getStunAddress (UtlString *pIpAddress, int *pPort, const char *szLocalIp=NULL) |
UtlBoolean | addKeepAliveBinding (void *pBinding) |
UtlBoolean | removeKeepAliveBinding (void *pBinding) |
void * | findKeepAliveBinding (OsTimer *pTimer) |
void * | findKeepAliveBinding (OsSocket *pSocket, const char *szRemoteIp, const int remotePort, const char *szMethod) |
Public Member Functions inherited from SipProtocolServerBase | |
SipProtocolServerBase (SipUserAgent *userAgent, const char *protocolString, const char *taskName) | |
virtual | ~SipProtocolServerBase () |
virtual UtlBoolean | startListener () |
UtlBoolean | send (SipMessage *message, const char *hostAddress, int hostPort=SIP_PORT) |
void | removeOldClients (long oldTime) |
int | getClientCount () |
virtual UtlBoolean | isOk () |
Static Public Member Functions | |
static void | SipKeepAliveCallback (const intptr_t userData, const intptr_t eventData) |
Protected Member Functions | |
OsSocket * | buildClientSocket (int hostPort, const char *hostAddress, const char *localIp) |
Protected Member Functions inherited from SipProtocolServerBase | |
SipClient * | createClient (const char *hostAddress, int hostPort, const char *localIp) |
void | releaseClient (SipClient *client) |
void | startClients () |
void | shutdownClients () |
UtlBoolean | clientExists (SipClient *client) |
void | addClient (SipClient *client) |
Protected Attributes | |
OsMutex | mMapLock |
Protected Attributes inherited from SipProtocolServerBase | |
UtlString | mProtocolString |
UtlString | mDefaultIp |
int | mDefaultPort |
SipUserAgent * | mSipUserAgent |
UtlHashMap | mServerSocketMap |
UtlHashMap | mServerPortMap |
UtlHashMap | mServers |
SipServerBrokerListener * | mpServerBrokerListener |
The SipUdpServer is owner/container of the sockets used for UDP communications.
The SipUdpServer has a number of NAT APIs and coordinates NAT detection/keepalives with the OsNatDatagramSocket / OsNatAgentTask.
The SipUdpServer may contain multiple sockets if being used in a multi- home configuration. This mostly works, but needs additional testing and tweaking.
Most of the NAT keepalives are delegated to the OsNatAgentTask. The exception is the Sip keepalive. For this, the SipUdpServer uses callbacks to send off the Sip messages (as opposed to introducing a OsMsgQueue). The SipUdpServer never listens for responses, however, the SipUserAgent itself pays attention to rport results and notifies the OsNatAgentTask of local ip -> remote IP NAT bindings.
SipUdpServer | ( | int | sipPort = SIP_PORT , |
SipUserAgent * | userAgent = NULL , |
||
int | udpReadBufferSize = -1 , |
||
UtlBoolean | bUseNextAvailablePort = FALSE , |
||
const char * | szBoundIp = NULL |
||
) |
|
virtual |
|
virtual |
Implements SipProtocolServerBase.
|
virtual |
Implements SipProtocolServerBase.
void enableStun | ( | const char * | szStunServer, |
int | iStunPort, | ||
const char * | szLocalIp, | ||
int | refreshPeriodInSecs, | ||
OsNotification * | pNotification | ||
) |
UtlBoolean sendTo | ( | const SipMessage & | message, |
const char * | address, | ||
int | port, | ||
const char * | szLocalSipIp = NULL |
||
) |
UtlBoolean addCrLfKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const int | keepAliveSecs, | ||
OsNatKeepaliveListener * | pListener | ||
) |
UtlBoolean removeCrLfKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort | ||
) |
UtlBoolean addStunKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const int | keepAliveSecs, | ||
OsNatKeepaliveListener * | pListener | ||
) |
UtlBoolean removeStunKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort | ||
) |
UtlBoolean addSipKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const char * | szMethod, | ||
const int | keepAliveSecs, | ||
OsNatKeepaliveListener * | pListener | ||
) |
UtlBoolean removeSipKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const char * | szMethod | ||
) |
void updateSipKeepAlive | ( | const char * | szLocalIp, |
const char * | szMethod, | ||
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const char * | szContactIp, | ||
const int | contactPort | ||
) |
void sendSipKeepAlive | ( | OsTimer * | pTimer | ) |
|
static |
|
virtual |
Reimplemented from SipProtocolServerBase.
int getServerPort | ( | const char * | szLocalIp = NULL | ) |
UtlBoolean getStunAddress | ( | UtlString * | pIpAddress, |
int * | pPort, | ||
const char * | szLocalIp = NULL |
||
) |
UtlBoolean addKeepAliveBinding | ( | void * | pBinding | ) |
UtlBoolean removeKeepAliveBinding | ( | void * | pBinding | ) |
void * findKeepAliveBinding | ( | OsTimer * | pTimer | ) |
void * findKeepAliveBinding | ( | OsSocket * | pSocket, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const char * | szMethod | ||
) |
|
protectedvirtual |
Implements SipProtocolServerBase.
|
protected |